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
e6fa7eeca7c3f6b04db472347777925537bf8fab
diff --git a/spec/rtens/mockster/FilterFixture.php b/spec/rtens/mockster/FilterFixture.php index <HASH>..<HASH> 100644 --- a/spec/rtens/mockster/FilterFixture.php +++ b/spec/rtens/mockster/FilterFixture.php @@ -14,7 +14,7 @@ class FilterFixture extends Fixture { /** * @var array|\ReflectionMethod[] */ - private $filterOutput = []; + private $filterOutput = array(); public function givenTheFilterWithTheBitMask($bitmask) { $this->filter = new Filter($bitmask);
fixed array declaration in FilterFixture to be compatible with PHP <I>
rtens_mockster
train
php
496ea492e52079803b20eb4526d29ea04489ad3b
diff --git a/template/gulpfile.js b/template/gulpfile.js index <HASH>..<HASH> 100644 --- a/template/gulpfile.js +++ b/template/gulpfile.js @@ -1,4 +1,5 @@ var args = require('yargs').argv; +var clear = require('cli-clear'); if (args.env && ['staging', 'production'].indexOf(args.env) > -1) { process.env.NODE_ENV = args.env; @@ -145,7 +146,7 @@ gulp.task('preview', function (cb) { }); gulp.task('banner', function () { - spawn('clear', [null], { stdio: 'inherit' }); + clear(); console.log( chalk.magenta( figlet.textSync('Reactatouille', { horizontalLayout: 'full' })
clear fix as seen in issue #1 for for compat in windows
heldrida_reactatouille-boilerplate
train
js
76c4d9b583b8636624557eeffc8c9dc8942d269e
diff --git a/wafer/talks/forms.py b/wafer/talks/forms.py index <HASH>..<HASH> 100644 --- a/wafer/talks/forms.py +++ b/wafer/talks/forms.py @@ -102,8 +102,8 @@ class TalkForm(forms.ModelForm): self.helper = FormHelper(self) self.helper.include_media = False - submit_button = Submit('submit', _('Submit')) instance = kwargs['instance'] + submit_button = Submit('submit', _('Save') if instance else _('Submit')) if instance: self.helper.layout.append( FormActions(
When editing an existing talk, offer to Save, not Submit it
CTPUG_wafer
train
py
198cf3691b1eef78fcca610c7a43863428744f46
diff --git a/tests/parser/features/test_gas.py b/tests/parser/features/test_gas.py index <HASH>..<HASH> 100644 --- a/tests/parser/features/test_gas.py +++ b/tests/parser/features/test_gas.py @@ -1,7 +1,3 @@ -from vyper.parser import parser_utils -from vyper.parser.parser import parse_to_lll - - def test_gas_call(get_contract_with_gas_estimation): gas_call = """ @external @@ -13,19 +9,3 @@ def foo() -> uint256: assert c.foo(call={"gas": 50000}) < 50000 assert c.foo(call={"gas": 50000}) > 25000 - - print("Passed gas test") - - -def test_gas_estimate_repr(): - code = """ -x: int128 - -@external -def __init__(): - self.x = 1 - """ - parser_utils.LLLnode.repr_show_gas = True - out = parse_to_lll(code) - assert "35261" in str(out)[:28] - parser_utils.LLLnode.repr_show_gas = False
test: remove test that brings me no joy
ethereum_vyper
train
py
e1ec5467e9bde0564c4194d0c98ca73b0a3f5272
diff --git a/src/Importer.php b/src/Importer.php index <HASH>..<HASH> 100755 --- a/src/Importer.php +++ b/src/Importer.php @@ -300,7 +300,7 @@ class Importer // @todo Винести це в конігурацію. // INSERT/UPDATE statement in STRICT mode // throw error SQLSTATE[HY000]: General error: 1364 Field 'fieldName' doesn't have a default value - $this->getDb()->exec('SET SESSION sql_mode = "NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"'); + $this->getDb()->exec('SET SESSION sql_mode = "NO_ENGINE_SUBSTITUTION"'); $sqlMode = true; } $this->saveMode($row, $table);
Support for MYSQL 8
popovserhii_php-importer
train
php
5e700fdcdba053f0627eb8c3a7bf562be0cf43da
diff --git a/phy/cluster/manual/session.py b/phy/cluster/manual/session.py index <HASH>..<HASH> 100644 --- a/phy/cluster/manual/session.py +++ b/phy/cluster/manual/session.py @@ -33,6 +33,18 @@ class Session(object): """Register a view so that it gets updated after clustering actions.""" self._views.append(view) + def select(self, clusters): + self.selector.selected_clusters = clusters + self._update_views() + + def _update_views(self): + for view in self._views: + self._update_view(view) + + def _update_view(self, view): + # TODO + pass + def _clustering_updated(self, up): """Update the selectors and views with an UpdateInfo object."""
Added select() method in session.
kwikteam_phy
train
py
3cef58e00a20a3865001ca15c1166625441ea091
diff --git a/SUFIA_VERSION b/SUFIA_VERSION index <HASH>..<HASH> 100644 --- a/SUFIA_VERSION +++ b/SUFIA_VERSION @@ -1 +1 @@ -3.6.0 +3.6.1 diff --git a/lib/sufia/version.rb b/lib/sufia/version.rb index <HASH>..<HASH> 100644 --- a/lib/sufia/version.rb +++ b/lib/sufia/version.rb @@ -1,3 +1,3 @@ module Sufia - VERSION = "3.6.0" + VERSION = "3.6.1" end diff --git a/sufia-models/lib/sufia/models/version.rb b/sufia-models/lib/sufia/models/version.rb index <HASH>..<HASH> 100644 --- a/sufia-models/lib/sufia/models/version.rb +++ b/sufia-models/lib/sufia/models/version.rb @@ -1,5 +1,5 @@ module Sufia module Models - VERSION = "3.6.0" + VERSION = "3.6.1" end end
Preparing for <I> release
samvera_hyrax
train
SUFIA_VERSION,rb,rb
b8920a11c36b2b263c7c80bee8b48d4688b327d0
diff --git a/jax/core.py b/jax/core.py index <HASH>..<HASH> 100644 --- a/jax/core.py +++ b/jax/core.py @@ -618,9 +618,6 @@ class MainTrace: class TraceStack: # See comments in https://github.com/google/jax/pull/3370 - upward: List[MainTrace] - downward: List[MainTrace] - def __init__(self): eval_trace = MainTrace(0, EvalTrace) self.stack = [eval_trace] @@ -766,7 +763,7 @@ def find_top_trace(xs) -> Trace: default=None, key=attrgetter('level')) dynamic = thread_local_state.trace_state.trace_stack.dynamic top_main = (dynamic if top_main is None or dynamic.level > top_main.level - else top_main) + else top_main) return top_main and top_main.with_cur_sublevel() # type: ignore
Rm old attribute annotations from TraceStack
tensorflow_probability
train
py
dd8a49b82feceb8c155e24b7a92534dec523ac1b
diff --git a/shared/local-debug.desktop.js b/shared/local-debug.desktop.js index <HASH>..<HASH> 100644 --- a/shared/local-debug.desktop.js +++ b/shared/local-debug.desktop.js @@ -56,14 +56,22 @@ if (!__STORYBOOK__) { if (PERF) { console.warn('\n\n\nlocal debug PERF is ONNNNNn!!!!!1!!!11!!!!\nAll console.logs disabled!\n\n\n') + // $FlowIssue doens't like messing w/ console console._log = console.log + // $FlowIssue doens't like messing w/ console console._warn = console.warn + // $FlowIssue doens't like messing w/ console console._error = console.error + // $FlowIssue doens't like messing w/ console console._info = console.info + // $FlowIssue doens't like messing w/ console console.log = noop + // $FlowIssue doens't like messing w/ console console.warn = noop + // $FlowIssue doens't like messing w/ console console.error = noop + // $FlowIssue doens't like messing w/ console console.info = noop config.enableActionLogging = false
fix flow (#<I>)
keybase_client
train
js
cf5461f10bb99ea27a165bc1e5129f35fead69d1
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -17,12 +17,12 @@ setup( install_requires=["requests", "beautifulsoup4"], tests_require=['unittest', 'vcrpy'], classifiers=[ - 'Development Status :: Beta', + 'Development Status :: 4 - Beta', 'Environment :: Console', 'Intended Audience :: Developers', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Topic :: Software Development :: Web', - 'License :: MIT License' + 'Topic :: Internet :: WWW/HTTP', + 'License :: OSI Approved :: MIT License' ] )
<I> uploaded to pypi
michigan-com_linkGrabber
train
py
65f80f07d738a45cc43cfceaeeb9111ad560b0d5
diff --git a/peri/opt/optimize.py b/peri/opt/optimize.py index <HASH>..<HASH> 100644 --- a/peri/opt/optimize.py +++ b/peri/opt/optimize.py @@ -1665,6 +1665,13 @@ def do_levmarq_all_particle_groups(s, region_size=40, max_iter=2, damping=1.0, def do_levmarq_one_direction(s, direction, max_iter=2, run_length=2, damping=1e-3, collect_stats=False, **kwargs): + """ + Optimization of a state along one direction. + s : state + direction : np.ndarray; transformed to a unit vector internally + The rest are the same **kwargs in LMEngine. + """ + normal = direction / np.sqrt(np.dot(direction, direction)) obj = OptState(s, direction) lo = LMOptObj(obj, max_iter=max_iter, run_length=run_length, damping=damping, **kwargs)
opt: levmarq 1 direction transforms direction into a normal.
peri-source_peri
train
py
70df8a6e749e34c71da416769f01c3361efefa60
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -34,6 +34,17 @@ test('run array of promises sequentially', function (t) { }) }) +test('run array consisting of only one promise', function (t) { + t.plan(1) + + return promiseWaterfall([ + addOne + ]) + .then(function (sum) { + t.equals(sum, 1) + }) +}) + test('reject array', function (t) { t.plan(1)
add test for array consisting of one promise
notjrbauer_promise.waterfall
train
js
9841da8400d5933c26fc69d22454d79e1d681be9
diff --git a/lib/model.js b/lib/model.js index <HASH>..<HASH> 100644 --- a/lib/model.js +++ b/lib/model.js @@ -233,7 +233,8 @@ Model.prototype.updateIndexes = function (oldDoc, newDoc) { for (i = 0; i < keys.length; i += 1) { try { - if (skipId && keys[i] != '_id') this.indexes[keys[i]].update(oldDoc, newDoc); + // if (! (skipId && keys[i] == '_id')) this.indexes[keys[i]].update(oldDoc, newDoc); + this.indexes[keys[i]].update(oldDoc, newDoc); } catch (e) { failingIndex = i; error = e;
Radical fix, revert skipId
Ivshti_linvodb3
train
js
c96a19984e27171ed75d3f76025cb8576b27f203
diff --git a/lib/ffi_yajl/encoder.rb b/lib/ffi_yajl/encoder.rb index <HASH>..<HASH> 100644 --- a/lib/ffi_yajl/encoder.rb +++ b/lib/ffi_yajl/encoder.rb @@ -47,7 +47,7 @@ module FFI_Yajl if str.respond_to?(:scrub) str.scrub! else - str.encode!("UTF-8", undef: :replace, invalid: :replace) + str.encode!("UTF-16le", undef: :replace, invalid: :replace).encode!('UTF-8') end end str @@ -68,7 +68,7 @@ module FFI_Yajl if token.respond_to?(:scrub) token.scrub! else - token.encode("utf-8", undef: :replace, invalid: :replace) + token.encode!("UTF-16le", undef: :replace, invalid: :replace).encode!('UTF-8') end case status when 1 # yajl_gen_keys_must_be_strings
fixes for <I> and <I> this is kind of shitty code, but once <I> and <I> are dropped and we can use #scrub then all the shitty code can go away...
chef_ffi-yajl
train
rb
3cf530333bc4fd8d34611bcd82397d095a6331e0
diff --git a/apluslms_roman/builder.py b/apluslms_roman/builder.py index <HASH>..<HASH> 100644 --- a/apluslms_roman/builder.py +++ b/apluslms_roman/builder.py @@ -1,4 +1,4 @@ -from os import environ, getuid, getegid +from os import environ, getuid, getegid, mkdir from os.path import isdir from apluslms_yamlidator.utils.decorator import cached_property @@ -38,6 +38,9 @@ class Builder: backend.prepare(task, observer) observer.enter_build() + # FIXME: add support for other build paths + if not isdir('_build'): + mkdir('_build') result = backend.build(task, observer) observer.done(data=result)
Fix build in folder without _build
apluslms_roman
train
py
8b0fbd0655e173a6efb12fd5ca0559b9816dd4ad
diff --git a/salt/states/pip.py b/salt/states/pip.py index <HASH>..<HASH> 100644 --- a/salt/states/pip.py +++ b/salt/states/pip.py @@ -160,7 +160,6 @@ def installed(name, def removed(name, - packages=None, requirements=None, bin_env=None, log=None,
rm unused arg `packages` from states.pip.removed
saltstack_salt
train
py
8a6c109515212cb2fb6ff6938464d7317a2cc25c
diff --git a/lib/xcodeproj/project/object/native_target.rb b/lib/xcodeproj/project/object/native_target.rb index <HASH>..<HASH> 100644 --- a/lib/xcodeproj/project/object/native_target.rb +++ b/lib/xcodeproj/project/object/native_target.rb @@ -189,7 +189,7 @@ module Xcodeproj # @!group Build Phases Helpers # @return [PBXFrameworksBuildPhase] - # the copy files build phases of the target. + # the frameworks build phases of the target. # def frameworks_build_phases build_phases.find { |bp| bp.class == PBXFrameworksBuildPhase } @@ -203,7 +203,7 @@ module Xcodeproj end # @return [Array<PBXShellScriptBuildPhase>] - # the copy files build phases of the target. + # the shell script build phases of the target. # def shell_script_build_phases build_phases.grep(PBXShellScriptBuildPhase)
Fix invalid docs for build_phases methods
CocoaPods_Xcodeproj
train
rb
8d6c0baebb2d43374e7072b295c579919f953bdd
diff --git a/includes/class-freemius.php b/includes/class-freemius.php index <HASH>..<HASH> 100755 --- a/includes/class-freemius.php +++ b/includes/class-freemius.php @@ -10717,7 +10717,9 @@ 'license_key' => $fs->apply_filters( 'license_key', $license_key ) ); - $install = $api->call( '/', 'put', $params ); + $path = $fs->add_show_pending( '/' ); + + $install = $api->call( $path, 'put', $params ); if ( FS_Api::is_api_error( $install ) ) { $error = FS_Api::is_api_error_object( $install ) ? @@ -13435,6 +13437,9 @@ ); $url = WP_FS__ADDRESS . '/action/service/user/install/'; + + $url = $this->add_show_pending( $url ); + $response = self::safe_remote_post( $url, $request ); if ( is_wp_error( $response ) ) {
[api] [license] Include the `show_pending` param in the API request when activating a license so that activation will work with pending plans.
Freemius_wordpress-sdk
train
php
9095c2acf77c5da4e0bac4850c3f78b383768532
diff --git a/tensorflow_datasets/image_classification/imagenet2012_real.py b/tensorflow_datasets/image_classification/imagenet2012_real.py index <HASH>..<HASH> 100644 --- a/tensorflow_datasets/image_classification/imagenet2012_real.py +++ b/tensorflow_datasets/image_classification/imagenet2012_real.py @@ -58,7 +58,10 @@ _REAL_LABELS_URL = 'https://raw.githubusercontent.com/google-research/reassessed class Imagenet2012Real(tfds.core.GeneratorBasedBuilder): """ImageNet validation images with ReaL labels.""" - VERSION = tfds.core.Version('1.0.0', 'Initial release.') + VERSION = tfds.core.Version('1.0.0') + RELEASE_NOTES = { + '1.0.0': 'Initial release', + } MANUAL_DOWNLOAD_INSTRUCTIONS = """\ manual_dir should contain `ILSVRC2012_img_val.tar` file.
Add release notes for imagenet<I>_real
tensorflow_datasets
train
py
bc2b524cbbe505a45df9fa235eae470df511c6f4
diff --git a/hawkular-wildfly-agent/src/main/java/org/hawkular/agent/monitor/cmd/AbstractResourcePathCommand.java b/hawkular-wildfly-agent/src/main/java/org/hawkular/agent/monitor/cmd/AbstractResourcePathCommand.java index <HASH>..<HASH> 100644 --- a/hawkular-wildfly-agent/src/main/java/org/hawkular/agent/monitor/cmd/AbstractResourcePathCommand.java +++ b/hawkular-wildfly-agent/src/main/java/org/hawkular/agent/monitor/cmd/AbstractResourcePathCommand.java @@ -114,7 +114,7 @@ RESP extends ResourcePathResponse> implements Command<REQ, RESP> { if (endpointService == null) { throw new IllegalArgumentException(String.format( "Cannot perform [%s] on a [%s] given by inventory path [%s]: unknown managed server [%s]", - this.getOperationName(envelope), entityType, managedServerName)); + this.getOperationName(envelope), entityType, resourceId, managedServerName)); } validate(envelope, endpointService.getMonitoredEndpoint());
forgot to pass argument for %s
hawkular_hawkular-agent
train
java
f62d1f8d9817ff2fa8f0fa8f6d1641eca86f1e75
diff --git a/src/main/groovy/json/JsonTokenType.java b/src/main/groovy/json/JsonTokenType.java index <HASH>..<HASH> 100644 --- a/src/main/groovy/json/JsonTokenType.java +++ b/src/main/groovy/json/JsonTokenType.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2011 the original author or authors. + * Copyright 2003-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
One more dummy commit to test github post receive hook
apache_groovy
train
java
c07712db17e1131abdfe671fb660eeb48f82f2a4
diff --git a/competency/classes/api.php b/competency/classes/api.php index <HASH>..<HASH> 100644 --- a/competency/classes/api.php +++ b/competency/classes/api.php @@ -2409,6 +2409,9 @@ class api { $sql .= " AND p.userid $insql"; $params += $inparams; + // Order by last updated, seconded by ID to prevent random ordering. + $sql .= " ORDER BY p.timemodified DESC, p.id ASC"; + $plans = array(); $records = $DB->get_recordset_sql($select . $sql, $params, $skip, $limit); foreach ($records as $record) {
MDL-<I> competency: False negative when listing plans to review
moodle_moodle
train
php
261f6c1ff852040c6f2e50acf14cdc5a5fe166ba
diff --git a/salt/client.py b/salt/client.py index <HASH>..<HASH> 100644 --- a/salt/client.py +++ b/salt/client.py @@ -224,7 +224,6 @@ class LocalClient(object): arg, expr_form, ret, - timeout, **kwargs) try: return pub_data['jid']
Don't pass through timeout with cmd_async
saltstack_salt
train
py
7742f8876a5370fa95ed105cca05f09ab0c1d6bf
diff --git a/roaringbitmap/src/main/java/org/roaringbitmap/ContainerAppender.java b/roaringbitmap/src/main/java/org/roaringbitmap/ContainerAppender.java index <HASH>..<HASH> 100644 --- a/roaringbitmap/src/main/java/org/roaringbitmap/ContainerAppender.java +++ b/roaringbitmap/src/main/java/org/roaringbitmap/ContainerAppender.java @@ -81,7 +81,10 @@ public class ContainerAppender<C extends WordStorage<C>, currentKey = key; } } - container = container.add(lowbits(value)); + C tmp = container.add(lowbits(value)); + if (tmp != container) { + container = tmp; + } } @Override
avoid potentially costly write barrier when container instance hasn't changed (#<I>)
RoaringBitmap_RoaringBitmap
train
java
4447b0f94f79e6c0064ece0b2a009c3ce948ec94
diff --git a/src/NafUtil.js b/src/NafUtil.js index <HASH>..<HASH> 100644 --- a/src/NafUtil.js +++ b/src/NafUtil.js @@ -16,6 +16,8 @@ module.exports.getNetworkOwner = function(entity) { var components = entity.components; if (components.hasOwnProperty('networked-remote')) { return entity.components['networked-remote'].data.owner; + } else if (components.hasOwnProperty('networked-share')) { + return entity.components['networked-share'].data.owner; } else if (components.hasOwnProperty('networked')) { return entity.components['networked'].owner; }
add networked-share to getNetworkOwner
networked-aframe_networked-aframe
train
js
caa8574847274e0db5f0ed35844b50542cc753f1
diff --git a/openquake/server/views.py b/openquake/server/views.py index <HASH>..<HASH> 100644 --- a/openquake/server/views.py +++ b/openquake/server/views.py @@ -149,6 +149,8 @@ def calc_info(request, calc_id): calc = oqe_models.OqJob.objects.get(pk=calc_id) response_data = vars(calc.get_oqparam()) response_data['status'] = calc.status + response_data['start_time'] = str(calc.jobstats.start_time) + response_data['stop_time'] = str(calc.jobstats.stop_time) except ObjectDoesNotExist: return HttpResponseNotFound()
Added start_time and stop_time to the response_data for engine server calculations
gem_oq-engine
train
py
85b33108649e3a1c7e4f85ddf627506f544c7130
diff --git a/svc/control_plane.go b/svc/control_plane.go index <HASH>..<HASH> 100644 --- a/svc/control_plane.go +++ b/svc/control_plane.go @@ -422,7 +422,10 @@ func (s *ControlSvc) getDefaultResourcePool() (pool *serviced.ResourcePool, err err = dbmap.Insert(&default_pool) return &default_pool, err } - *pool = *obj.(*serviced.ResourcePool) + pool, ok := obj.(*serviced.ResourcePool) + if !ok { + log.Printf("Could not cast obj.") + } return pool, err }
handle type assertion correctly when retriving pool from database.
control-center_serviced
train
go
06ba0b04528f4754cb7cb01803af6e493c16fbb3
diff --git a/lib/moodlelib.php b/lib/moodlelib.php index <HASH>..<HASH> 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -1754,7 +1754,7 @@ function set_send_count($user,$reset=false) { $pref->name = 'email_send_count'; $pref->value = 1; $pref->userid = $user->id; - insert_record('user_preferences',$pref); + insert_record('user_preferences',$pref, false); } } @@ -1772,7 +1772,7 @@ function set_bounce_count($user,$reset=false) { $pref->name = 'email_bounce_count'; $pref->value = 1; $pref->userid = $user->id; - insert_record('user_preferences',$pref); + insert_record('user_preferences',$pref, false); } }
Merged from MOODLE_<I>_STABLE - Tell insert record we don't care about inserted id
moodle_moodle
train
php
2fb57cc2debe9e3864619ed37e0cbffe8f145c69
diff --git a/benchexec/tablegenerator/react-table/src/components/Overview.js b/benchexec/tablegenerator/react-table/src/components/Overview.js index <HASH>..<HASH> 100644 --- a/benchexec/tablegenerator/react-table/src/components/Overview.js +++ b/benchexec/tablegenerator/react-table/src/components/Overview.js @@ -31,7 +31,7 @@ const menuItems = [ } ]; -const getCurrentPath = () => document.location.hash.substr(1); +const getCurrentPath = () => document.location.hash.split("?")[0].substr(1); export default class Overview extends React.Component { constructor(props) { @@ -61,7 +61,9 @@ export default class Overview extends React.Component { filtered: [], tabIndex: 0, - active: menuItems.find(i => i.path === getCurrentPath()).key, + active: ( + menuItems.find(i => i.path === getCurrentPath()) || { key: "summary" } + ).key, quantilePreSelection: tools[0].columns[1] };
Fix selection of active tab on initial load
sosy-lab_benchexec
train
js
e49ac97922f65ad0e4da15acfe095095cd8369bc
diff --git a/GPy/testing/rv_transformation_tests.py b/GPy/testing/rv_transformation_tests.py index <HASH>..<HASH> 100644 --- a/GPy/testing/rv_transformation_tests.py +++ b/GPy/testing/rv_transformation_tests.py @@ -68,10 +68,16 @@ class RVTransformationTestCase(unittest.TestCase): def test_Logexp(self): self._test_trans(GPy.constraints.Logexp()) + + @unittest.skip("Gradient not checking right, @jameshensman what is going on here?") + def test_Logexp_grad(self): self._test_grad(GPy.constraints.Logexp()) def test_Exponent(self): self._test_trans(GPy.constraints.Exponent()) + + @unittest.skip("Gradient not checking right, @jameshensman what is going on here?") + def test_Exponent_grad(self): self._test_grad(GPy.constraints.Exponent())
[rv tests] Gradient not checking right, @jameshensman what is going on here?
SheffieldML_GPy
train
py
d5b9a580a8a8079129f67b6a08a053c103ac41ae
diff --git a/lib/serverengine/daemon_logger.rb b/lib/serverengine/daemon_logger.rb index <HASH>..<HASH> 100644 --- a/lib/serverengine/daemon_logger.rb +++ b/lib/serverengine/daemon_logger.rb @@ -19,6 +19,15 @@ module ServerEngine require 'logger' + class ::Logger::LogDevice + def reopen! + if filename = @filename + @dev.reopen(filename, 'a') + @dev.sync = true + end + end + end + class DaemonLogger < Logger def initialize(logdev, config={}) @rotate_age = config[:log_rotate_age] || 5 diff --git a/spec/daemon_logger_spec.rb b/spec/daemon_logger_spec.rb index <HASH>..<HASH> 100644 --- a/spec/daemon_logger_spec.rb +++ b/spec/daemon_logger_spec.rb @@ -11,9 +11,13 @@ describe ServerEngine::DaemonLogger do it 'reopen' do subject.warn "ABCDEF" File.open('tmp/se1.log', "w") {|f| } - subject.warn "test2" + subject.warn "test2" File.read('tmp/se1.log').should_not =~ /ABCDEF/ + + subject.reopen! + subject.warn "test3" + File.read('tmp/se1.log').should =~ /test3/ end it 'reset path' do
fixed DaemonLogger at Ruby >= <I>
treasure-data_serverengine
train
rb,rb
1acf84fc2959544b114300351f48dbced70a9388
diff --git a/hepnames/fields/bd1xx.py b/hepnames/fields/bd1xx.py index <HASH>..<HASH> 100644 --- a/hepnames/fields/bd1xx.py +++ b/hepnames/fields/bd1xx.py @@ -175,10 +175,11 @@ def ids(self, key, value): a_value = _try_to_correct_value(type_, a_value) - return { - 'type': type_, - 'value': a_value, - } + if type_ and a_value: + return { + 'type': type_, + 'value': a_value, + } @hepnames2marc.over('035', '^ids$')
dojson: don't produce incomplete ids
inspirehep_inspire-dojson
train
py
a69bffbf033c16031af198b4756b9eda9bb95b19
diff --git a/src/main/java/org/acra/config/ACRAConfiguration.java b/src/main/java/org/acra/config/ACRAConfiguration.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/acra/config/ACRAConfiguration.java +++ b/src/main/java/org/acra/config/ACRAConfiguration.java @@ -42,7 +42,6 @@ import java.io.Serializable; * * Use {@link ConfigurationBuilder} to programmatically construct an ACRAConfiguration. */ -@SuppressWarnings("unused") public final class ACRAConfiguration implements Serializable { private final ImmutableSet<String> additionalDropBoxTags;
remove unused suppress on configuration: this should not contain anything unused
ACRA_acra
train
java
d530e25e7f1508bad1128390917128c18daf9fd0
diff --git a/lib/cursor.js b/lib/cursor.js index <HASH>..<HASH> 100644 --- a/lib/cursor.js +++ b/lib/cursor.js @@ -150,7 +150,7 @@ MongolianCursor.prototype.nextBatch = function(callback) { * Returns the next available document, or undefined if there is none */ MongolianCursor.prototype.next = function(callback) { - if (callback && !(callback instanceof Function)) throw new Error("callback is not a function!") + if (!(callback instanceof Function)) throw new Error("callback is not a function!") var self = this // We have a retrieved batch that hasn't been exhausted if (self._currentBatch && self._currentIndex < self._currentBatch.numberReturned) {
cursor.next() requires a callback now
marcello3d_node-mongolian
train
js
7da1788d5c67f15fa58a702052602f7566aa2232
diff --git a/tests/ProxyManagerTest/Functional/MultipleProxyGenerationTest.php b/tests/ProxyManagerTest/Functional/MultipleProxyGenerationTest.php index <HASH>..<HASH> 100644 --- a/tests/ProxyManagerTest/Functional/MultipleProxyGenerationTest.php +++ b/tests/ProxyManagerTest/Functional/MultipleProxyGenerationTest.php @@ -99,7 +99,7 @@ class MultipleProxyGenerationTest extends PHPUnit_Framework_TestCase */ public function getTestedClasses() { - return array( + $data = array( array('ProxyManagerTestAsset\\BaseClass'), array('ProxyManagerTestAsset\\ClassWithMagicMethods'), array('ProxyManagerTestAsset\\ClassWithByRefMagicMethods'), @@ -109,7 +109,13 @@ class MultipleProxyGenerationTest extends PHPUnit_Framework_TestCase array('ProxyManagerTestAsset\\ClassWithPublicProperties'), array('ProxyManagerTestAsset\\EmptyClass'), array('ProxyManagerTestAsset\\HydratedObject'), - array('ProxyManagerTestAsset\\ClassWithSelfHint'), ); + + if (PHP_VERSION_ID >= 50401) { + // PHP < 5.4.1 misbehaves, throwing strict standards, see https://bugs.php.net/bug.php?id=60573 + $data[] = array('ProxyManagerTestAsset\\ClassWithSelfHint'); + } + + return $data; } }
Skipping `self` hint tests for PHP < <I> as of <URL>
Ocramius_ProxyManager
train
php
6a2d8b1a1b511ce0b826686fe01e79fc8d2dc986
diff --git a/system/Commands/Utilities/Routes/ControllerMethodReader.php b/system/Commands/Utilities/Routes/ControllerMethodReader.php index <HASH>..<HASH> 100644 --- a/system/Commands/Utilities/Routes/ControllerMethodReader.php +++ b/system/Commands/Utilities/Routes/ControllerMethodReader.php @@ -156,7 +156,7 @@ final class ControllerMethodReader if ($classShortname === $defaultController) { $pattern = '#' . preg_quote(lcfirst($defaultController), '#') . '\z#'; - $routeWithoutController = preg_replace($pattern, '', $uriByClass); + $routeWithoutController = rtrim(preg_replace($pattern, '', $uriByClass), '/'); $routeWithoutController = $routeWithoutController ?: '/'; $output[] = [
fix: remove / after sub-directory
codeigniter4_CodeIgniter4
train
php
5f085df923ebc123c9fb47503432987a09e7fb76
diff --git a/lib/gtx.js b/lib/gtx.js index <HASH>..<HASH> 100644 --- a/lib/gtx.js +++ b/lib/gtx.js @@ -101,7 +101,6 @@ function wrapGrunt(grunt) { // helper gtx.call = function (name, func) { - grunt.log.writeln('call ' + name + ' ' + (typeof func)); if (arguments.length === 1) { func = name; name = lib.getNameUID(prefix);
killed debug log in gtx.call()
Bartvds_gruntfile-gtx
train
js
63f8e689ffdee9ec48e600efa3c8a0438129b12a
diff --git a/src/Awjudd/AssetProcessor/AssetProcessor.php b/src/Awjudd/AssetProcessor/AssetProcessor.php index <HASH>..<HASH> 100644 --- a/src/Awjudd/AssetProcessor/AssetProcessor.php +++ b/src/Awjudd/AssetProcessor/AssetProcessor.php @@ -298,7 +298,7 @@ class AssetProcessor ))); } - return ''; + return $output; } // Are we looking at CDNs?
Bug fix, returning $output instead of empty string in case of CDNs being used
awjudd_l4-assetprocessor
train
php
ed4c58bf6be76a720abc88da374d4b391869de3d
diff --git a/src/Cygnite/Console/src/Apps/Controllers/Controller.php b/src/Cygnite/Console/src/Apps/Controllers/Controller.php index <HASH>..<HASH> 100644 --- a/src/Cygnite/Console/src/Apps/Controllers/Controller.php +++ b/src/Cygnite/Console/src/Apps/Controllers/Controller.php @@ -1,4 +1,3 @@ - namespace Apps\Controllers; use Cygnite\Application; @@ -71,7 +70,7 @@ class %controllerName% extends AbstractBaseController public function indexAction() { $%controllerName% = array(); - $%controllerName% = %StaticModelName%::fetchAll( + $%controllerName% = %StaticModelName%::all( array( 'orderBy' => 'id desc', /*'paginate' => array(
Dynamic finder fetchAll() finder changed to all() Dynamic finder fetchAll() finder changed to all()
cygnite_framework
train
php
fbf0893413218496bf5f88b548d996ae6d70c125
diff --git a/lib/gateway/Shard.js b/lib/gateway/Shard.js index <HASH>..<HASH> 100644 --- a/lib/gateway/Shard.js +++ b/lib/gateway/Shard.js @@ -110,15 +110,16 @@ class Shard extends EventEmitter { this.emit("error", err, this.id); } + this.ws = null; + this.reset(); + /** * Fired when the shard disconnects * @event Shard#disconnect * @prop {Error?} err The error, if any */ super.emit("disconnect", error || null); - this.ws = null; - this.reset(); if(options.reconnect === "auto" && this.client.options.autoreconnect) { /** * Fired when stuff happens and gives more info
Fix shard disconnect event logic (#<I>)
abalabahaha_eris
train
js
2081faa1f14267d05997cbdada2dd79c1736c73f
diff --git a/satpy/plugin_base.py b/satpy/plugin_base.py index <HASH>..<HASH> 100644 --- a/satpy/plugin_base.py +++ b/satpy/plugin_base.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (c) 2011 SMHI +# Copyright (c) 2011-2017 PyTroll # Author(s): @@ -37,6 +37,7 @@ LOG = logging.getLogger(__name__) class Plugin(object): + """The base plugin class. It is not to be used as is, it has to be inherited by other classes. """
pep8 editorial, and fixing copyright
pytroll_satpy
train
py
c177c8fabea2072bcfc252b7b3160c55a0db7354
diff --git a/tests/CouchDB/Tests/ConnectionTest.php b/tests/CouchDB/Tests/ConnectionTest.php index <HASH>..<HASH> 100644 --- a/tests/CouchDB/Tests/ConnectionTest.php +++ b/tests/CouchDB/Tests/ConnectionTest.php @@ -21,6 +21,13 @@ class ConnectionTest extends TestCase } } + public function testIsConnected() + { + $this->assertFalse($this->conn->isConnected()); + $this->conn->initialize(); + $this->assertTrue($this->conn->isConnected()); + } + public function testListDatabases() { $databases = $this->conn->listDatabases();
Add test for isConnected method
Baachi_CouchDB
train
php
b46126de456b14d0e98bef785ef5123be502c2e5
diff --git a/lib/gush/cli.rb b/lib/gush/cli.rb index <HASH>..<HASH> 100644 --- a/lib/gush/cli.rb +++ b/lib/gush/cli.rb @@ -111,6 +111,7 @@ module Gush desc "viz [WorkflowClass]", "Displays graph, visualising job dependencies" def viz(name) + client workflow = name.constantize.new("start") GraphViz.new(:G, type: :digraph, dpi: 200, compound: true) do |g| g[:compound] = true
Initialize client with loads Gushfile.
chaps-io_gush
train
rb
45583da4781134bae44f5570abf5b1ca7dc2d17b
diff --git a/tests/csvmanager_test.py b/tests/csvmanager_test.py index <HASH>..<HASH> 100644 --- a/tests/csvmanager_test.py +++ b/tests/csvmanager_test.py @@ -44,6 +44,7 @@ class TableTestCase(unittest.TestCase): with archive.open('b', 'w') as f: f.write('3,4') self.assertEqual(archive.extract_filenames(), set('ab')) + self.assertEqual(archive.open('a').read(), '1,2') finally: os.remove(archive.name)
Added a test for the zip archive functionality
gem_oq-engine
train
py
5feef5919142c4b555eef33d57190cdca7deb5ce
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ setup( name='cltk', packages=find_packages(), url='https://github.com/cltk/cltk', - version='0.1.96', + version='0.1.97', zip_safe=True, test_suite='cltk.tests.test_cltk', )
Bump vers for Akkadian Completion of GSoC <I> project by Andrew Deloucas ( @adeloucas , PR #<I> )
cltk_cltk
train
py
c02d5d38dcd69247197b54211766788d06634b1a
diff --git a/upup/pkg/fi/cloudup/awstasks/securitygroup.go b/upup/pkg/fi/cloudup/awstasks/securitygroup.go index <HASH>..<HASH> 100644 --- a/upup/pkg/fi/cloudup/awstasks/securitygroup.go +++ b/upup/pkg/fi/cloudup/awstasks/securitygroup.go @@ -91,7 +91,7 @@ func (e *SecurityGroup) findEc2(c *fi.Context) (*ec2.SecurityGroup, error) { filters = append(filters, awsup.NewEC2Filter("vpc-id", *vpcID)) filters = append(filters, awsup.NewEC2Filter("group-name", *e.Name)) - request.Filters = cloud.BuildFilters(e.Name) + request.Filters = filters } response, err := cloud.EC2().DescribeSecurityGroups(request)
Fix bug in security group matching We were matching only by the name tag, instead of using the group-name If users had an SG with the same Name in different VPCs we could have matched SGs in both VPCs. This seems unlikely, and particularly tricky to then get through the remaining sanity checks (even in the find function itself). Fix #<I>
kubernetes_kops
train
go
be8d392f067b72f84455d126dc0326aa82e8cb03
diff --git a/scripts/homestead.rb b/scripts/homestead.rb index <HASH>..<HASH> 100644 --- a/scripts/homestead.rb +++ b/scripts/homestead.rb @@ -202,6 +202,12 @@ class Homestead s.args = [site["map"].tr('^A-Za-z0-9', '')] end end + else + config.vm.provision "shell" do |s| + s.name = "Checking for old Schedule" + s.inline = "rm -f /etc/cron.d/$1" + s.args = [site["map"].tr('^A-Za-z0-9', '')] + end end end end
Cleans up leftover schedules (#<I>)
laravel_homestead
train
rb
a78de91a90c996850247d5493622ba7fc30b4b43
diff --git a/lib/setupHttpRoutes.js b/lib/setupHttpRoutes.js index <HASH>..<HASH> 100644 --- a/lib/setupHttpRoutes.js +++ b/lib/setupHttpRoutes.js @@ -406,9 +406,11 @@ function setupHttpRoutes(server, skynet){ // Returns all devices owned by authenticated user // curl -X GET http://localhost:3000/mydevices/0d3a53a0-2a0b-11e3-b09c-ff4de847b2cc?token=qirqglm6yb1vpldixflopnux4phtcsor server.get('/mydevices', function(req, res){ + var query = req.query || {}; authorizeRequest(req, res, function(fromDevice){ skynet.sendActivity(getActivity('mydevices',req, fromDevice)); - getDevices(fromDevice, {owner: fromDevice.uuid}, true, function(data){ + query.owner = fromDevice.uuid; + getDevices(fromDevice, query, true, function(data){ if(data.error){ errorResponse(data.error, res); } else {
Enable queries in mydevices for HTTP
octoblu_meshblu
train
js
cd65ea6d60e38e1e51ed76a4d1e9c55e8095dd5e
diff --git a/lib/navigationlib.php b/lib/navigationlib.php index <HASH>..<HASH> 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -3748,7 +3748,14 @@ class flat_navigation extends navigation_node_collection { if ($course->id > 1) { // It's a real course. $url = new moodle_url('/course/view.php', array('id' => $course->id)); - $flat = new flat_navigation_node(navigation_node::create($course->shortname, $url), 0); + + $coursecontext = context_course::instance($course->id, MUST_EXIST); + // This is the name that will be shown for the course. + $coursename = empty($CFG->navshowfullcoursenames) ? + format_string($course->shortname, true, array('context' => $coursecontext)) : + format_string($course->fullname, true, array('context' => $coursecontext)); + + $flat = new flat_navigation_node(navigation_node::create($coursename, $url), 0); $flat->key = 'coursehome'; $courseformat = course_get_format($course);
MDL-<I> navigation: Fix course names in flat nav
moodle_moodle
train
php
f509de45832d616fc9fb2302b3b65db372415796
diff --git a/src/Message/Request/FetchPaymentMethodsRequest.php b/src/Message/Request/FetchPaymentMethodsRequest.php index <HASH>..<HASH> 100755 --- a/src/Message/Request/FetchPaymentMethodsRequest.php +++ b/src/Message/Request/FetchPaymentMethodsRequest.php @@ -32,6 +32,23 @@ class FetchPaymentMethodsRequest extends AbstractMollieRequest } /** + * @param string $includeWallets + * @return $this + */ + public function setIncludeWallets($includeWallets) + { + return $this->setParameter('includeWallets', $includeWallets); + } + + /** + * @return string + */ + public function getIncludeWallets() + { + return $this->getParameter('includeWallets'); + } + + /** * @param string $locale * @return $this */ @@ -106,6 +123,7 @@ class FetchPaymentMethodsRequest extends AbstractMollieRequest 'billingCountry' => $this->getBillingCountry(), 'locale' => $this->getLocale(), 'resource' => $this->getResource(), + 'includeWallets' => $this->getIncludeWallets(), 'sequenceType' => $this->getSequenceType(), ]; }
Add Apple Pay support to FetchPaymentMethodsRequest
thephpleague_omnipay-mollie
train
php
27dffe4394931f813c026d730fbaeebd1e6ec096
diff --git a/src/messages/ru/hipanel.finance.billTypes.php b/src/messages/ru/hipanel.finance.billTypes.php index <HASH>..<HASH> 100644 --- a/src/messages/ru/hipanel.finance.billTypes.php +++ b/src/messages/ru/hipanel.finance.billTypes.php @@ -44,6 +44,8 @@ return [ 'Websa private Cloud monthly fee' => 'Абонплата Websa Private Cloud', 'Private Cloud backup disk usage' => 'Бэкап Private Cloud', 'Automatic VPS backup monthly fee' => 'Автобэекап', + 'DevOps support monthly fee' => 'DevOps поддержка', + 'DevOps support time' => 'DevOps поддержка', 'monthly' => 'абонплата', 'overuse' => 'перебор',
Add DevOps support translations
hiqdev_hipanel-module-finance
train
php
c81391e3148dad86adbb79e017cf105b61c8d869
diff --git a/patroni/dcs/etcd.py b/patroni/dcs/etcd.py index <HASH>..<HASH> 100644 --- a/patroni/dcs/etcd.py +++ b/patroni/dcs/etcd.py @@ -188,7 +188,8 @@ class AbstractEtcdClientWithFailover(etcd.Client): logger.debug("Retrieved list of machines: %s", machines) if machines: random.shuffle(machines) - self._update_dns_cache(self._dns_resolver.resolve_async, machines) + if not self._use_proxies: + self._update_dns_cache(self._dns_resolver.resolve_async, machines) return machines except Exception as e: self.http.clear() diff --git a/patroni/dcs/etcd3.py b/patroni/dcs/etcd3.py index <HASH>..<HASH> 100644 --- a/patroni/dcs/etcd3.py +++ b/patroni/dcs/etcd3.py @@ -617,7 +617,7 @@ class Etcd3(AbstractEtcd): return self.retry(self._do_refresh_lease) except (Etcd3ClientError, RetryFailedError): logger.exception('refresh_lease') - raise Etcd3Error('Failed ro keepalive/grant lease') + raise Etcd3Error('Failed to keepalive/grant lease') def create_lease(self): while not self._lease:
Don't resolve cluster members when use_proxies is set (#<I>) Close <URL>
zalando_patroni
train
py,py
b08817a118fc9de7a1e90c55511534384232f051
diff --git a/src/Gica/MongoDB/Selector/Selector.php b/src/Gica/MongoDB/Selector/Selector.php index <HASH>..<HASH> 100644 --- a/src/Gica/MongoDB/Selector/Selector.php +++ b/src/Gica/MongoDB/Selector/Selector.php @@ -99,6 +99,15 @@ class Selector implements \IteratorAggregate, Selectable }); } + public function sortIfNecessary($field, ?bool $ascending): self + { + return $field + ? $this->mutate(function (self $selector) use ($field, $ascending) { + $selector->sort[$field] = ($ascending ? 1 : -1); + }) + : $this; + } + public function clearSort(): self { return $this->mutate(function (self $selector) { @@ -472,7 +481,7 @@ class Selector implements \IteratorAggregate, Selectable $parent = ''; foreach ($fields as $field) { $mongoStack[] = [ - '$unwind' => '$' . $parent . $field, + '$unwind' => '$' . $parent . $field, ]; $parent = $field . '.'; }
added \Gica\MongoDB\Selector\Selector::sortIfNecessary
xprt64_mongodb-selector
train
php
2c50256917d1b0c7361177a50af7d0b46cbd8d40
diff --git a/host/pydaq/HL/spi.py b/host/pydaq/HL/spi.py index <HASH>..<HASH> 100644 --- a/host/pydaq/HL/spi.py +++ b/host/pydaq/HL/spi.py @@ -85,6 +85,4 @@ class spi(HardwareLayer): def get_data(self, addr=0, size=None): if(size == None): size = self._conf['mem_bytes'] - print "spi.get_data() 0x%x 0x%x"%(self._conf['base_addr'], self._conf['mem_bytes']) - data=self._intf.read(self._conf['base_addr'] + 8 + self._conf['mem_bytes'], size) - return data + return self._intf.read(self._conf['base_addr'] + 8 + self._conf['mem_bytes'], size)
MAINT: <I> was done by mistake, revert to <I>
SiLab-Bonn_basil
train
py
ddd9bec4d6b458e3e72a3c121adac8c68543c8c1
diff --git a/recordlinkage/algorithms/numeric.py b/recordlinkage/algorithms/numeric.py index <HASH>..<HASH> 100644 --- a/recordlinkage/algorithms/numeric.py +++ b/recordlinkage/algorithms/numeric.py @@ -12,7 +12,7 @@ def _step_sim(d, offset=0, origin=0): expr = 'abs(d - origin) <= offset' - return pandas.eval(expr).astype(np.int64) + return pandas.eval(expr).astype(np.float64) def _linear_sim(d, scale, offset=0, origin=0):
Changed return type of step similarity algorithm into float
J535D165_recordlinkage
train
py
8571d69e47ea5167fb01efe362dab4b5832297ed
diff --git a/nameko/exceptions.py b/nameko/exceptions.py index <HASH>..<HASH> 100644 --- a/nameko/exceptions.py +++ b/nameko/exceptions.py @@ -98,18 +98,22 @@ def deserialize_to_instance(exc_type): return exc_type +class BadRequest(Exception): + pass + + @deserialize_to_instance -class MalformedRequest(Exception): +class MalformedRequest(BadRequest): pass @deserialize_to_instance -class MethodNotFound(Exception): +class MethodNotFound(BadRequest): pass @deserialize_to_instance -class IncorrectSignature(Exception): +class IncorrectSignature(BadRequest): pass
add exception superclass for identifying bad requests
nameko_nameko
train
py
aa58f3bc688605a109b7ba23135745ae71eaad50
diff --git a/src/main/java/nl/garvelink/iban/package-info.java b/src/main/java/nl/garvelink/iban/package-info.java index <HASH>..<HASH> 100644 --- a/src/main/java/nl/garvelink/iban/package-info.java +++ b/src/main/java/nl/garvelink/iban/package-info.java @@ -26,7 +26,7 @@ * IBAN iban = IBAN.valueOf( "NL91ABNA0417164300" ); * * // Input may be formatted. - * iban = IBAN.valueOf( "NL91 ABNA 0417 1643 00" ); + * iban = IBAN.valueOf( "BE68 5390 0754 7034" ); * * // The valueOf() method returns null if its argument is null. * iban.valueOf( null ); @@ -39,11 +39,11 @@ * Collections.sort( ibans, IBAN.LEXICAL_ORDER ); * * // You can use the Modulo97 class directly to compute or verify the check digits. - * String candidate = "NL91ABNA0417164300"; + * String candidate = "GB29 NWBK 6016 1331 9268 19"; * Modulo97.verifyCheckDigits( candidate ); * * // API methods take CharSequence, not just String. - * StringBuilder builder = new StringBuilder( "NL00ABNA0417164300" ); + * StringBuilder builder = new StringBuilder( "LU280019400644750000" ); * int checkDigits = Modulo97.calculateCheckDigits( builder ); * </pre> *
Use international sample IBAN's in the package summary javadoc.
barend_java-iban
train
java
e83a6a22d454a480dc8c389db84eaf591ec7d86a
diff --git a/mod/label/lib.php b/mod/label/lib.php index <HASH>..<HASH> 100644 --- a/mod/label/lib.php +++ b/mod/label/lib.php @@ -181,7 +181,7 @@ function label_reset_userdata($data) { * * @return array */ -function lable_get_extra_capabilities() { +function label_get_extra_capabilities() { return array('moodle/site:accessallgroups'); }
MDL-<I> fix lable typo credit goes to fautrero
moodle_moodle
train
php
9dee5899dc6a9b6f7b54ac84d08339e5f3cddad2
diff --git a/index.js b/index.js index <HASH>..<HASH> 100755 --- a/index.js +++ b/index.js @@ -136,6 +136,7 @@ var inject = module.exports = function (cache, config) { }), paramap(function (pkg, cb) { unpack(pkg, {target: pkg.path}, function (err, hash) { + if(err) return cb(err) if(hash !== pkg.shasum) return cb(new Error( 'expected ' + pkg.name +'@' + pkg.version +'\n' + 'to have shasum=' + pkg.shasum + ' but was='+hash))
if there was an error, cb before making error about hash
dominictarr_npmd-install
train
js
d3ce79c7b207fa090ac04abc4997b7137f67b234
diff --git a/spec/helpers_spec.rb b/spec/helpers_spec.rb index <HASH>..<HASH> 100644 --- a/spec/helpers_spec.rb +++ b/spec/helpers_spec.rb @@ -24,3 +24,12 @@ describe '#fixture' do expect(data['success']).to eq(true) end end + +describe '#fixture_property' do + fixture :data, [:test] + fixture_property :data_success, :data, ['success'] + + it 'should define the test property correctly' do + expect(data_success).to eq(true) + end +end
Add a spec for fixture_property
meew0_discordrb
train
rb
c8b967ba3732d2c9d94217216ea8e296a5c7b1a3
diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/Engine.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/Engine.java index <HASH>..<HASH> 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/Engine.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/Engine.java @@ -338,6 +338,12 @@ public class Engine { } } } + } + } + for (AnalysisPhase phase : AnalysisPhase.values()) { + final List<Analyzer> analyzerList = analyzers.get(phase); + + for (Analyzer a : analyzerList) { closeAnalyzer(a); } }
updated engine to fix bug with archive analyzer prematurely deleting fiels Former-commit-id: dd<I>e3c<I>f2d9bf7bf3b<I>f<I>be<I>d6d<I>
jeremylong_DependencyCheck
train
java
b9cd14673f1b66db21371299888141da14de5c8e
diff --git a/tests/test_snap.py b/tests/test_snap.py index <HASH>..<HASH> 100644 --- a/tests/test_snap.py +++ b/tests/test_snap.py @@ -15,6 +15,14 @@ class TestPrimTeardown(unittest.TestCase): self.jr = PoppyErgoJr(simulator='poppy-simu', use_snap=True, snap_port=port) self.base_url = 'http://127.0.0.1:{}'.format(port) + # Make sure the Snap API is running before actually testing. + while True: + try: + self.get('/') + break + except requests.exceptions.ConnectionError: + time.sleep(1) + def get(self, url): url = '{}{}'.format(self.base_url, url) return requests.get(url)
Make sure the Snap API is running before unit testing. See <URL>
poppy-project_pypot
train
py
3a2583125838860b05bd09a23a292736764e4834
diff --git a/backtrader/lineiterator.py b/backtrader/lineiterator.py index <HASH>..<HASH> 100644 --- a/backtrader/lineiterator.py +++ b/backtrader/lineiterator.py @@ -95,9 +95,14 @@ class MetaLineIterator(LineSeries.__class__): if _obj._owner is not None: _obj._owner.addindicator(_obj) + if _obj._ltype == _obj.IndType and _obj.fullsize() == 1: + # For single line indicators ... return only the 1st line + return _obj.line, args, kwargs + return _obj, args, kwargs + class LineIterator(six.with_metaclass(MetaLineIterator, LineSeries)): _ltype = LineSeries.IndType
Single line LineSeries return line instead of object
backtrader_backtrader
train
py
4016a5efd3d8f0850932c45f8b3300df16ca9a1b
diff --git a/closure/goog/log/log.js b/closure/goog/log/log.js index <HASH>..<HASH> 100644 --- a/closure/goog/log/log.js +++ b/closure/goog/log/log.js @@ -90,6 +90,16 @@ goog.log.getLogger = function(name, opt_level) { }; +/** + * Returns the root logger. + * + * @return {?goog.log.Logger} The root logger, or null if logging is disabled. + */ +goog.log.getRootLogger = function() { + return goog.log.getLogger(goog.log.ROOT_LOGGER_NAME); +}; + + // TODO(johnlenz): try to tighten the types to these functions. /** * Adds a handler to the logger. This doesn't use the event system because
Add goog.log.getRootLogger. RELNOTES[NEW]: goog.log.getRootLogger has been added. PiperOrigin-RevId: <I>
google_closure-library
train
js
68ffc847a77869ef83f0f7717561b2f2f4828341
diff --git a/HARK/core.py b/HARK/core.py index <HASH>..<HASH> 100644 --- a/HARK/core.py +++ b/HARK/core.py @@ -592,7 +592,7 @@ class AgentType(HARKobject): None ''' for var_name in self.shock_vars: - setattr(self, var_name, self.shock_history[var_name][self.t_sim, :]) + self.shocks[var_name] = self.shock_history[var_name][self.t_sim, :] def getStates(self): ''' @@ -681,7 +681,10 @@ class AgentType(HARKobject): for t in range(sim_periods): self.simOnePeriod() for var_name in self.track_vars: - self.history[var_name][self.t_sim,:] = getattr(self,var_name) + if var_name in self.shock_vars: + self.history[var_name][self.t_sim,:] = self.shocks[var_name] + else: + self.history[var_name][self.t_sim,:] = getattr(self,var_name) self.t_sim += 1 def clearHistory(self):
read_shocks to the shocks dict; track shocks from the shocks dict
econ-ark_HARK
train
py
86893e9cdebd1740d6f7d341e0bae003dfc79eef
diff --git a/includes/modules/export/xhtml/class-pb-xhtml11.php b/includes/modules/export/xhtml/class-pb-xhtml11.php index <HASH>..<HASH> 100644 --- a/includes/modules/export/xhtml/class-pb-xhtml11.php +++ b/includes/modules/export/xhtml/class-pb-xhtml11.php @@ -563,7 +563,7 @@ class Xhtml11 extends Export { printf( '<h2 class="subtitle">%s</h2>', @$metadata['pb_subtitle'] ); printf( '<div class="logo"></div>' ); printf( '<h3 class="author">%s</h3>', @$metadata['pb_author'] ); - printf( '<h4 class="author">%s</h4>', @$metadata['pb_contributing_authors'] ); + printf( '<h4 class="contributing-authors">%s</h4>', @$metadata['pb_contributing_authors'] ); printf( '<h4 class="publisher">%s</h4>', @$metadata['pb_publisher'] ); printf( '<h5 class="publisher-city">%s</h5>', @$metadata['pb_publisher_city'] ); }
changing contributing authors class, because it was breaking PDF running heads.
pressbooks_pressbooks
train
php
2dad2ff4f5ac04c1617e1aab9ae00ad9afdfb16c
diff --git a/src/config/ios/findProject.js b/src/config/ios/findProject.js index <HASH>..<HASH> 100644 --- a/src/config/ios/findProject.js +++ b/src/config/ios/findProject.js @@ -8,7 +8,7 @@ const GLOB_PATTERN = '**/*.xcodeproj'; /** * These folders will be excluded from search to speed it up */ -const GLOB_EXCLUDE_PATTERN = ['node_modules/**', 'Examples/**', 'examples/**']; +const GLOB_EXCLUDE_PATTERN = ['node_modules/**', 'Examples/**', 'examples/**', 'Pods/**']; /** * Finds iOS project by looking for all .xcodeproj files
Ignore Cocoapods autogenerated project
rnpm_rnpm
train
js
c78fa20de52468ceb2cdbbee952f486ac2533902
diff --git a/helusers/apps.py b/helusers/apps.py index <HASH>..<HASH> 100644 --- a/helusers/apps.py +++ b/helusers/apps.py @@ -9,4 +9,4 @@ class HelusersConfig(AppConfig): class HelusersAdminConfig(AdminConfig): - default_site = 'helusers.admin.AdminSite' + default_site = 'helusers.admin_site.AdminSite'
Fix wrong path for helusers AdminSite
City-of-Helsinki_django-helusers
train
py
c265293f38771348ebd596ec68ae196daf44c0ef
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,6 @@ setup(name='numina', author='Sergio Pascual', author_email='sergiopr@fis.ucm.es', url='http://guaix.fis.ucm.es/projects/emir', - download_url='ftp://astrax.fis.ucm.es/pub/software/numina/numina-%s.tar.gz' % __version__, license='GPLv3', description='Numina reduction package', packages=find_packages('.'),
Removing download_url, by default from PyPI
guaix-ucm_numina
train
py
8bf67b13ff9e307f0ceac906471e3bc8681ceb2f
diff --git a/src/org/opencms/db/CmsImportFolder.java b/src/org/opencms/db/CmsImportFolder.java index <HASH>..<HASH> 100644 --- a/src/org/opencms/db/CmsImportFolder.java +++ b/src/org/opencms/db/CmsImportFolder.java @@ -280,8 +280,7 @@ public class CmsImportFolder { */ private void importZipResource(ZipInputStream zipStreamIn, String importPath, boolean noSubFolder) throws Exception { - int todo = 0; - // TODO: this method looks very crude, it should be re-written sometime... + // HACK: this method looks very crude, it should be re-written sometime... boolean isFolder = false; int j, r, stop, size;
Replaced not used declaration with a HACK.
alkacon_opencms-core
train
java
674f37854515a7199df7e0f955579d5eae1ba70e
diff --git a/server/src/main/java/com/orientechnologies/orient/server/security/ODefaultServerSecurity.java b/server/src/main/java/com/orientechnologies/orient/server/security/ODefaultServerSecurity.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/com/orientechnologies/orient/server/security/ODefaultServerSecurity.java +++ b/server/src/main/java/com/orientechnologies/orient/server/security/ODefaultServerSecurity.java @@ -594,10 +594,12 @@ public class ODefaultServerSecurity implements OSecurityFactory, OServerLifecycl for (OClientConnection cc : ccm.getConnections()) { try { ODatabaseDocumentTx ccDB = cc.getDatabase(); - ccDB.activateOnCurrentThread(); - if (ccDB != null && !ccDB.isClosed() && ccDB.getURL() != null) { - if (ccDB.getURL().equals(dbURL)) { - ccDB.reloadUser(); + if(ccDB != null) { + ccDB.activateOnCurrentThread(); + if (!ccDB.isClosed() && ccDB.getURL() != null) { + if (ccDB.getURL().equals(dbURL)) { + ccDB.reloadUser(); + } } } } catch (Exception ex) {
fixed null pointer in case of missing database in default security
orientechnologies_orientdb
train
java
eed6811857b1b1a5315a914a5127f478bc41d9c8
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -76,6 +76,8 @@ Exception.readable('toJSON', function extract() { // if (this.capture) return this.capture; + var cpus = os.cpus(); + return { node: process.versions, version: require('./package.json').version.split('.').shift(), @@ -92,6 +94,13 @@ Exception.readable('toJSON', function extract() { platform: process.platform, arch: process.arch, hostname: os.hostname(), + cpu: { + cores: cpus.length, + speed: cpus.reduce(function sum(memo, cpu) { + return memo + cpu.speed; + }, 0) / cpus.length, + model: cpus[0].model + } }, process: { load: os.loadavg(),
[minor] Added missing cpu information
observing_exception
train
js
a95ced6260494f108df72f0f9ffe9c60498365ad
diff --git a/examples/distillation/distiller.py b/examples/distillation/distiller.py index <HASH>..<HASH> 100644 --- a/examples/distillation/distiller.py +++ b/examples/distillation/distiller.py @@ -295,7 +295,10 @@ class Distiller: if self.is_master: logger.info(f'--- Ending epoch {self.epoch}/{self.params.n_epoch-1}') self.end_epoch() - if self.is_master: logger.info('Training is finished') + if self.is_master: + logger.info(f'Save very last checkpoint as `pytorch_model.bin`.') + self.save_checkpoint(checkpoint_name=f'pytorch_model.bin') + logger.info('Training is finished') def step(self, input_ids: torch.tensor,
[Distillation] save last chkpt as `pytorch_model.bin`
huggingface_pytorch-pretrained-BERT
train
py
6d8cee3757d48ec83ff8fb0b6673053b9e5dae31
diff --git a/src/delombok/lombok/delombok/Delombok.java b/src/delombok/lombok/delombok/Delombok.java index <HASH>..<HASH> 100644 --- a/src/delombok/lombok/delombok/Delombok.java +++ b/src/delombok/lombok/delombok/Delombok.java @@ -366,6 +366,7 @@ public class Delombok { for (File fileToParse : filesToParse) { Comments comments = new Comments(); + context.put(Comments.class, (Comments) null); context.put(Comments.class, comments); @SuppressWarnings("deprecation")
Making delombok compatible with post-resolution transformers meant delombok would fail with a 'duplicate context value' error. Fixes issue #<I> Thanks to Neildo for using the <I> beta and spotting the problem - the tests don't run 1 delombok with multiple files. Maybe we should change that.
rzwitserloot_lombok
train
java
f2f64d1e809864cb4b24d1a1b1ebcea3681e9adf
diff --git a/core/src/main/java/com/google/bitcoin/core/Wallet.java b/core/src/main/java/com/google/bitcoin/core/Wallet.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/bitcoin/core/Wallet.java +++ b/core/src/main/java/com/google/bitcoin/core/Wallet.java @@ -3588,6 +3588,12 @@ public class Wallet extends BaseTaggableObject implements Serializable, BlockCha } } + @Override + public synchronized void setTag(String tag, ByteString value) { + super.setTag(tag, value); + saveNow(); + } + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Boilerplate for running event listeners - dispatches events onto the user code thread (where we don't do @@ -4105,10 +4111,4 @@ public class Wallet extends BaseTaggableObject implements Serializable, BlockCha public ReentrantLock getLock() { return lock; } - - @Override - public synchronized void setTag(String tag, ByteString value) { - super.setTag(tag, value); - saveNow(); - } }
Wallet: move setTag to the extensions section of the file.
bitcoinj_bitcoinj
train
java
6b929f15a4b7dfb69d9690a7b067b1351d9296bd
diff --git a/cwltool/job.py b/cwltool/job.py index <HASH>..<HASH> 100644 --- a/cwltool/job.py +++ b/cwltool/job.py @@ -69,7 +69,7 @@ with open(sys.argv[1], "r") as f: if sp.stdin: sp.stdin.close() rcode = sp.wait() - if isinstance(stdin, file): + if stdin is not subprocess.PIPE: stdin.close() if stdout is not sys.stderr: stdout.close()
Fix Python 3 incompatibility in PYTHON_RUN_SCRIPT. `file` is no longer a built-in with the new `io` framework. Was causing jobs to fail depending on the python in the conda env.
common-workflow-language_cwltool
train
py
6687f28bf705284ce21e99158e46ad49f4eb4d9d
diff --git a/src/main/java/de/galan/commons/time/Durations.java b/src/main/java/de/galan/commons/time/Durations.java index <HASH>..<HASH> 100644 --- a/src/main/java/de/galan/commons/time/Durations.java +++ b/src/main/java/de/galan/commons/time/Durations.java @@ -64,7 +64,7 @@ public class Durations { String result = ""; if ((date != null) && (reference != null)) { long time = reference.toEpochMilli() - date.toEpochMilli(); - result = humanize(time, " "); + result = humanize(time, SPACE); } return result; } @@ -76,7 +76,7 @@ public class Durations { } - private static String humanize(long time, String separator) { + public static String humanize(long time, String separator) { StringBuilder result = new StringBuilder(); if (time == 0L) { result.append("0ms");
Opened method with custom seperator
galan_commons
train
java
00365496341fb21b6fbeaf31374af66700bca184
diff --git a/lib/payment.js b/lib/payment.js index <HASH>..<HASH> 100644 --- a/lib/payment.js +++ b/lib/payment.js @@ -146,7 +146,7 @@ function txToPayment(tx, opts) { // Advanced options invoice_id: tx.InvoiceID, - paths: tx.paths || '', + paths: tx.paths || [], flag_partial_payment: (tx.Flags & 0x00010000 ? true : false), flag_no_direct_ripple: (tx.Flags & 0x00020000 ? true : false), diff --git a/lib/tx.js b/lib/tx.js index <HASH>..<HASH> 100644 --- a/lib/tx.js +++ b/lib/tx.js @@ -17,13 +17,13 @@ module.exports.getTx = function(remote, tx_hash, callback) { } // Get container ledger to find close_time - remote.requestLedger(tx.inLedger, function(err, ledger){ + remote.requestLedger(tx.inLedger, function(err, res){ if (err) { callback(err); return; } - tx.close_time_unix = ripple.utils.toTimestamp(ledger.close_time); + tx.close_time_unix = ripple.utils.toTimestamp(res.ledger.close_time); callback(null, tx);
[FIX] Fixed timestamp bug
ripple_ripple-rest
train
js,js
af5f2d743cc236c595c5a285979520969e1d580d
diff --git a/Lib/ufo2ft/featureWriters/baseFeatureWriter.py b/Lib/ufo2ft/featureWriters/baseFeatureWriter.py index <HASH>..<HASH> 100644 --- a/Lib/ufo2ft/featureWriters/baseFeatureWriter.py +++ b/Lib/ufo2ft/featureWriters/baseFeatureWriter.py @@ -154,7 +154,13 @@ class BaseFeatureWriter: raise NotImplementedError def _insert( - self, feaFile, classDefs=None, markClassDefs=None, lookups=None, features=None + self, + feaFile, + classDefs=None, + anchorDefs=None, + markClassDefs=None, + lookups=None, + features=None, ): """ Insert feature, its classDefs or markClassDefs and lookups at insert @@ -229,6 +235,10 @@ class BaseFeatureWriter: if classDefs: others.extend(classDefs) others.append(ast.Comment("")) + # Insert anchorDefs + if anchorDefs: + others.extend(anchorDefs) + others.append(ast.Comment("")) # Insert markClassDefs if markClassDefs: others.extend(markClassDefs)
BaseFeatureWriter: _insert() may also insert anchorDefs
googlefonts_ufo2ft
train
py
4521cfb20ab489e6f3ab7748cf9fbdfee4d97ad2
diff --git a/message_sender/factory.py b/message_sender/factory.py index <HASH>..<HASH> 100644 --- a/message_sender/factory.py +++ b/message_sender/factory.py @@ -177,6 +177,7 @@ class WassupApiSender(object): self.session = ( session or WASSUP_SESSIONS.setdefault(token, requests.Session())) self.session.headers.update({ + 'Authorization': 'Token %s' % (self.token,), 'User-Agent': 'SeedMessageSender/%s' % ( distribution.version,) })
include the Authorization token in the header
praekeltfoundation_seed-message-sender
train
py
25c78b5b1adb8a5df566470ef7b944de7bd15810
diff --git a/test/Task/GroupTaskTest.php b/test/Task/GroupTaskTest.php index <HASH>..<HASH> 100644 --- a/test/Task/GroupTaskTest.php +++ b/test/Task/GroupTaskTest.php @@ -32,5 +32,33 @@ class GroupTaskTest extends DeployerTester $this->runCommand('group'); } + + public function testAfter() + { + $mock = $this->getMock('stdClass', ['callback']); + $mock->expects($this->exactly(2)) + ->method('callback') + ->will($this->returnValue(true)); + + task('task1', function () { + }); + + task('task2', function () { + }); + + task('group', ['task1', 'task2']); + + after('task1', function () use($mock) { + $mock->callback(); + }); + + task('after', function () use($mock) { + $mock->callback(); + }); + + after('task1', 'after'); + + $this->runCommand('group'); + } } \ No newline at end of file
Test after/before task in group tasks :beetle:
deployphp_deployer
train
php
2a19eba9a7a44b221f73fc3f5cabda1baf432184
diff --git a/umi_tools/umi_methods.py b/umi_tools/umi_methods.py index <HASH>..<HASH> 100644 --- a/umi_tools/umi_methods.py +++ b/umi_tools/umi_methods.py @@ -202,6 +202,9 @@ def get_bundles(insam, read_events, else: read_events['Input Reads'] += 1 + if paired: + read_events['Paired Reads'] += 1 + if subset: if random.random() >= subset: read_events['Randomly excluded'] += 1
updates logging to include number of paired reads
CGATOxford_UMI-tools
train
py
6612961d2ab47e14a5c97b4f2a6fee688eb2e7d5
diff --git a/modules_v3/lightbox/module.php b/modules_v3/lightbox/module.php index <HASH>..<HASH> 100644 --- a/modules_v3/lightbox/module.php +++ b/modules_v3/lightbox/module.php @@ -27,6 +27,8 @@ if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); exit; } +// prevents the error where image on Lightbox fails to close - How? I don't know +require_once WT_ROOT.'includes/functions/functions_print_lists.php'; class lightbox_WT_Module extends WT_Module implements WT_Module_Config, WT_Module_Tab { // Extend WT_Module
reverse change <I> - it is required and it prevents the error where image on Lightbox fails to close - How? I don't know.
fisharebest_webtrees
train
php
e3b9aad702d8e5ed3d25d859da267cc3b12893ea
diff --git a/board.go b/board.go index <HASH>..<HASH> 100644 --- a/board.go +++ b/board.go @@ -1,7 +1,6 @@ package jira import ( - //"fmt" "fmt" "net/http" ) diff --git a/project_test.go b/project_test.go index <HASH>..<HASH> 100644 --- a/project_test.go +++ b/project_test.go @@ -68,7 +68,7 @@ func TestProjectGet_NoProject(t *testing.T) { projects, resp, err := testClient.Project.Get("99999999") if projects != nil { - t.Errorf("Expected nil. Got %s", err) + t.Errorf("Expected nil. Got %+v", projects) } if resp.Status == "404" {
cosmetic fix in boards imports, tests in projects
andygrunwald_go-jira
train
go,go
171f5b7a47ee419bfc3729ee9136b67414195430
diff --git a/src/Tags.php b/src/Tags.php index <HASH>..<HASH> 100644 --- a/src/Tags.php +++ b/src/Tags.php @@ -38,6 +38,6 @@ class Tags extends Field return $tags->map(function (Tag $tag) { return ['id' => $tag->id, 'name' => $tag->name]; - }); + })->values(); } }
Fix resolveAttribute on forms Without this, the following error occurs on forms when there are more than 1 tag returned. "TypeError: this.field.value.map is not a function"
spatie_nova-tags-field
train
php
4b3d98ce9898f9f6f3af2b35fc8b988317d75e65
diff --git a/src/MvcCore/Ext/Views/Helpers/Assets.php b/src/MvcCore/Ext/Views/Helpers/Assets.php index <HASH>..<HASH> 100644 --- a/src/MvcCore/Ext/Views/Helpers/Assets.php +++ b/src/MvcCore/Ext/Views/Helpers/Assets.php @@ -417,7 +417,8 @@ class Assets extends \MvcCore\Ext\Views\Helpers\AbstractHelper try { @chmod($tmpDir, 0777); } catch (\Exception $e) { - throw new \Exception('['.__CLASS__.'] ' . $e->getMessage()); + $selfClass = version_compare(PHP_VERSION, '5.5', '>') ? self::class : __CLASS__; + throw new \Exception('['.$selfClass.'] ' . $e->getMessage()); } } }
Direct usage of deprecated __CLASS__ constant conditioned.
mvccore_ext-view-helper-assets
train
php
3a755964072977917de6c0cf2542483a6bf62d68
diff --git a/qtpy/QtCore.py b/qtpy/QtCore.py index <HASH>..<HASH> 100644 --- a/qtpy/QtCore.py +++ b/qtpy/QtCore.py @@ -24,8 +24,10 @@ if PYQT5: del pyqtSignal, pyqtSlot, pyqtProperty, QT_VERSION_STR elif PYSIDE2: from PySide2.QtCore import * - from PySide2.QtGui import QStringListModel - + try: # may be limited to PySide-5.11a1 only + from PySide2.QtGui import QStringListModel + except: + pass elif PYQT4: from PyQt4.QtCore import * # Those are things we inherited from Spyder that fix crazy crashes under
PySide-<I>a2 preventive change
spyder-ide_qtpy
train
py
4d4aa6eb1f25d545bf3d8249060c6230fb2e5035
diff --git a/lintools/data.py b/lintools/data.py index <HASH>..<HASH> 100644 --- a/lintools/data.py +++ b/lintools/data.py @@ -73,7 +73,10 @@ class Data(object): self.mol2.GetSubstructMatches(mol, uniquify=1) except AttributeError: self.mol2 = Chem.MolFromMol2File(mol2_file,removeHs=False,sanitize=False) - self.mol2.UpdatePropertyCache(strict=False) + try: + self.mol2.UpdatePropertyCache(strict=False) + except AttributeError: + assert self.mol2 != None, "The MOL2 file could not be imported in RDKit environment. Suggestion: Check the atomtypes." assert self.mol2 != None, "The MOL2 file could not be imported in RDKit environment." def rename_ligand(self,ligand_name):
Add assertion error for MOL2 Sometimes MOL2 files cannot be imported since the atom types are not of SYBYL type that RDKit likes. I will at some point write a solution for that although it can be messy
ldomic_lintools
train
py
3d0ecddd9f107df87c1f47e5570124e1830bbc02
diff --git a/lib/assets/Xml.js b/lib/assets/Xml.js index <HASH>..<HASH> 100644 --- a/lib/assets/Xml.js +++ b/lib/assets/Xml.js @@ -29,9 +29,6 @@ extendWithGettersAndSetters(Xml.prototype, { }), document = domParser.parseFromString(this.text, 'text/xml'); - if (!firstParseError && document && (!document.documentElement || document.documentElement.nodeName !== 'svg')) { - firstParseError = new Error('non-SVG document'); - } if (firstParseError) { var err = new errors.ParseError({message: 'Parse error in ' + (this.url || 'inline Xml' + (this.nonInlineAncestor ? ' in ' + this.nonInlineAncestor.url : '')) + '\n' + firstParseError.message, asset: this}); if (this.assetGraph) {
Fixed copy/paste error that required XML documents to have an <svg> element at the top level (assetgraph-builder#<I>).
assetgraph_assetgraph
train
js
6fa038d0c444da2dbbc8be17f4016dc875dfdd6e
diff --git a/lib/dock0/config.rb b/lib/dock0/config.rb index <HASH>..<HASH> 100644 --- a/lib/dock0/config.rb +++ b/lib/dock0/config.rb @@ -36,7 +36,9 @@ module Dock0 def finalize puts "Packing config into #{@paths['output']}" - tar = Dir.chdir(File.dirname(@paths['build'])) { run 'tar cz .' } + tar = Dir.chdir(File.dirname(@paths['build'])) do + run 'tar -cz --owner=root --group=root .' + end File.open(@paths['output'], 'w') { |fh| fh << tar } end
set owner/group on config to root
dock0_dock0
train
rb
ed7defb1fbebcf370fde603f81ebd4844ce8c79b
diff --git a/src/main/java/de/jfachwert/bank/Geldbetrag.java b/src/main/java/de/jfachwert/bank/Geldbetrag.java index <HASH>..<HASH> 100644 --- a/src/main/java/de/jfachwert/bank/Geldbetrag.java +++ b/src/main/java/de/jfachwert/bank/Geldbetrag.java @@ -945,11 +945,16 @@ public class Geldbetrag implements MonetaryAmount, Comparable<MonetaryAmount>, F if (roundingMode == null) { roundingMode = RoundingMode.HALF_UP; } - BigDecimal scaled = n.setScale(monetaryContext.getMaxScale(), roundingMode); - if (scaled.compareTo(n) != 0) { - throw new LocalizedArithmeticException(value, "lost_precision"); + int scale = monetaryContext.getMaxScale(); + if (scale < 0) { + return n; + } else { + BigDecimal scaled = n.setScale(scale, roundingMode); + if (scaled.compareTo(n) != 0) { + throw new LocalizedArithmeticException(value, "lost_precision"); + } + return scaled; } - return scaled; } /**
scale -1 is ignored in context; TCK: still <I> tests failing
oboehm_jfachwert
train
java
7c9bccf11ede54f06762a8ae56048917caa586ff
diff --git a/web/auth_test.go b/web/auth_test.go index <HASH>..<HASH> 100644 --- a/web/auth_test.go +++ b/web/auth_test.go @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build integration +// +build root, integration package web
adding root tag to build statemnt.
control-center_serviced
train
go
68753542cb5689bc672031ccdd72f69b241a7636
diff --git a/fathom-rest-security/src/main/java/fathom/rest/controller/extractors/AuthExtractor.java b/fathom-rest-security/src/main/java/fathom/rest/controller/extractors/AuthExtractor.java index <HASH>..<HASH> 100644 --- a/fathom-rest-security/src/main/java/fathom/rest/controller/extractors/AuthExtractor.java +++ b/fathom-rest-security/src/main/java/fathom/rest/controller/extractors/AuthExtractor.java @@ -58,7 +58,8 @@ public class AuthExtractor implements TypedExtractor, NamedExtractor, Configurab @Override public Account extract(Context context) { Account session = context.getSession(AuthConstants.ACCOUNT_ATTRIBUTE); - Account account = Optional.fromNullable(session).or(Account.GUEST); + Account local = context.getLocal(AuthConstants.ACCOUNT_ATTRIBUTE); + Account account = Optional.fromNullable(session).or(Optional.fromNullable(local).or(Account.GUEST)); return account; } }
Try to extract Account from local if there is no Account in the session
gitblit_fathom
train
java
3e53ad5a6f0f67776a163f7fded5a456f637ae88
diff --git a/pydsl/Grammar/Definition.py b/pydsl/Grammar/Definition.py index <HASH>..<HASH> 100644 --- a/pydsl/Grammar/Definition.py +++ b/pydsl/Grammar/Definition.py @@ -71,6 +71,9 @@ class RegularExpressionDefinition(GrammarDefinition): import re self.regexp = re.compile(regexp, flags) + def __hash__(self): + return hash(self.regexpstr) + def __eq__(self, other): if not isinstance(other, RegularExpressionDefinition): return False
hash support for regexp grammars
nesaro_pydsl
train
py
fc7f3cb06c191aff4fcad6af88f0c3012d7d1a65
diff --git a/anndata/base.py b/anndata/base.py index <HASH>..<HASH> 100644 --- a/anndata/base.py +++ b/anndata/base.py @@ -397,6 +397,10 @@ class _ViewMixin(_SetItemMixin): self._view_args = view_args super().__init__(*args, **kwargs) + def __deepcopy__(self, memo): + parent, k = self._view_args + return deepcopy(getattr(parent._adata_ref, k)) + class ArrayView(_SetItemMixin, np.ndarray): def __new__(
fix repeated slicing / uns deepcopying problem (#<I>)
theislab_anndata
train
py
427dd14c46660e45965fcde9fd8a08c1e37d68c5
diff --git a/src/ContactPoint.php b/src/ContactPoint.php index <HASH>..<HASH> 100644 --- a/src/ContactPoint.php +++ b/src/ContactPoint.php @@ -1,16 +1,13 @@ <?php -/** - * @file - * Contains CultuurNet\UDB3\ContactPoint. - */ - namespace CultuurNet\UDB3; use Broadway\Serializer\SerializableInterface; /** * ContactPoint info. + * @todo Remove $type? Seems unused throughout the rest of the codebase. + * @see https://jira.uitdatabank.be/browse/III-1508 */ class ContactPoint implements SerializableInterface, JsonLdSerializableInterface {
III-<I>: Added @todo with Jira ticket to remove $type property on ContactPoint.
cultuurnet_udb3-php
train
php
5d36f200dbb3bfb43ec5f2529e5e7cb0b36426d5
diff --git a/lib/maruku/version.rb b/lib/maruku/version.rb index <HASH>..<HASH> 100644 --- a/lib/maruku/version.rb +++ b/lib/maruku/version.rb @@ -19,7 +19,7 @@ #++ module MaRuKu - Version = '0.5.1.1' + Version = '0.5.2' MarukuURL = 'http://maruku.rubyforge.org/'
pumping version number because gem seems to have problems with <I> git-svn-id: svn://rubyforge.org/var/svn/maruku/trunk@<I> 7e2f<I>f0-5a<I>-4fd6-<I>-<I>c<I>b<I>
bhollis_maruku
train
rb
3fea657277a7932fe0cdd3df9629de34a7b36687
diff --git a/lib/basecamp/resources/todo_list.rb b/lib/basecamp/resources/todo_list.rb index <HASH>..<HASH> 100644 --- a/lib/basecamp/resources/todo_list.rb +++ b/lib/basecamp/resources/todo_list.rb @@ -1,6 +1,4 @@ module Basecamp; class TodoList < Basecamp::Resource - parent_resources :project - # Returns all lists for a project. If complete is true, only completed lists # are returned. If complete is false, only uncompleted lists are returned. def self.all(project_id, complete = nil) @@ -14,7 +12,15 @@ module Basecamp; class TodoList < Basecamp::Resource find(:all, :params => { :project_id => project_id, :filter => filter }) end + def project + @project ||= Project.find(project_id) + end + def todo_items(options = {}) @todo_items ||= TodoItem.find(:all, :params => options.merge(:todo_list_id => id)) end + + def prefix_options + { :project_id => project_id } + end end; end \ No newline at end of file
Accessing project from todo_list is now possible
anibalcucco_basecamp-wrapper
train
rb
6a49e9aab04c16d79844411a334068c5968e1dd9
diff --git a/example/speech-demo/lstm_bucketing.py b/example/speech-demo/lstm_bucketing.py index <HASH>..<HASH> 100644 --- a/example/speech-demo/lstm_bucketing.py +++ b/example/speech-demo/lstm_bucketing.py @@ -393,7 +393,7 @@ if __name__ == '__main__': assert name_vals[0][0] == 'Acc_exlude_padding' curr_acc = name_vals[0][1] - if n_epoch > 0 and curr_acc < last_acc: + if n_epoch > 0 and lr_scheduler.base_lr > lower_bnd and curr_acc < last_acc: logging.info('*** Reducing Learning Rate %g => %g ***' % \ (lr_scheduler.base_lr, lr_scheduler.base_lr / float(factor))) # reduce learning rate
enforce a lower bound for lr decaying
apache_incubator-mxnet
train
py
771afb34c884336396e3b528e5536fb4ef69d065
diff --git a/retext.py b/retext.py index <HASH>..<HASH> 100755 --- a/retext.py +++ b/retext.py @@ -42,6 +42,7 @@ def main(fileNames): app.setStyleSheet(QTextStream(sheetfile).readAll()) sheetfile.close() window = ReTextWindow() + window.show() for fileName in fileNames: try: fileName = QString.fromUtf8(fileName) @@ -50,7 +51,6 @@ def main(fileNames): pass if QFile.exists(fileName): window.openFileWrapper(fileName) - window.show() sys.exit(app.exec_()) if __name__ == '__main__':
Show the window before opening files to fix issues when wrong window title was displayed
retext-project_retext
train
py