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
2f8d2c33147ee30722678ea701899833db3a6ca7
diff --git a/marathon_acme/sse_protocol.py b/marathon_acme/sse_protocol.py index <HASH>..<HASH> 100644 --- a/marathon_acme/sse_protocol.py +++ b/marathon_acme/sse_protocol.py @@ -89,6 +89,9 @@ class SseProtocol(Protocol, TimeoutMixin): def _abortConnection(self): if self._abort_connection_cb is not None: self._abort_connection_cb() + else: + self.log.error('Unable to abort connection: transport has no ' + 'abortConnection method') def _reset_event_data(self): self._event = 'message'
SseProtocol: Log an error when we can't abort the connection
praekeltfoundation_marathon-acme
train
py
0bf98dc75cbaf95ff6ade3bc0b28a639dfd69a77
diff --git a/lib/oauth2/access_token.rb b/lib/oauth2/access_token.rb index <HASH>..<HASH> 100644 --- a/lib/oauth2/access_token.rb +++ b/lib/oauth2/access_token.rb @@ -70,7 +70,7 @@ module OAuth2 # # @return [Boolean] def expired? - expires? && (expires_at < Time.now.to_i) + expires? && (expires_at <= Time.now.to_i) end # Refreshes the current Access Token diff --git a/spec/oauth2/access_token_spec.rb b/spec/oauth2/access_token_spec.rb index <HASH>..<HASH> 100644 --- a/spec/oauth2/access_token_spec.rb +++ b/spec/oauth2/access_token_spec.rb @@ -133,6 +133,13 @@ describe AccessToken do expect(access).to be_expired end + it 'is true if expires_at is now' do + @now = Time.now + access = AccessToken.new(client, token, :refresh_token => 'abaca', :expires_at => @now.to_i) + allow(Time).to receive(:now).and_return(@now) + expect(access).to be_expired + end + end describe '#refresh!' do
Token is expired if 'expired_at' time is now.
oauth-xx_oauth2
train
rb,rb
ebf3003b5add8a7a93f09653a5bdf2bbcd68a3fb
diff --git a/app/models/unidom/common/concerns/sha2_digester.rb b/app/models/unidom/common/concerns/sha2_digester.rb index <HASH>..<HASH> 100644 --- a/app/models/unidom/common/concerns/sha2_digester.rb +++ b/app/models/unidom/common/concerns/sha2_digester.rb @@ -1,3 +1,6 @@ +## +# SHA-2 Digester 基于 SHA-2 算法的摘要逻辑关注点。 + module Unidom::Common::Concerns::Sha2Digester extend ActiveSupport::Concern
1, Improve the SHA-2 Digester for the document.
topbitdu_unidom-common
train
rb
0338c322fed01c6a87aa07cfcb48d2913cfbafcf
diff --git a/packages/select/src/Select.js b/packages/select/src/Select.js index <HASH>..<HASH> 100644 --- a/packages/select/src/Select.js +++ b/packages/select/src/Select.js @@ -84,6 +84,12 @@ const Select = ({ const [newOptions, setNewOptions] = useState([]); + let _cacheUniq = attributes.cacheUniq; + + if (!Array.isArray(_cacheUniq)) { + _cacheUniq = [_cacheUniq]; + } + const getOptionLabel = (option) => { if (option.__isNew__) { return option.label; @@ -296,6 +302,7 @@ const Select = ({ components={components} options={selectOptions} defaultOptions={waitUntilFocused ? [] : true} + cacheUniqs={_cacheUniq} styles={{ ...styles, placeholder: (provided, state) => {
fix(select): ensure cacheUniq is an array and rename to cacheUniqs
Availity_availity-react
train
js
7e5382ffda62323f2f2ae92ad18a3f55bfd1dd6d
diff --git a/packages/@vue/cli-service-global/lib/util.js b/packages/@vue/cli-service-global/lib/util.js index <HASH>..<HASH> 100644 --- a/packages/@vue/cli-service-global/lib/util.js +++ b/packages/@vue/cli-service-global/lib/util.js @@ -3,9 +3,31 @@ const path = require('path') exports.toPlugin = id => ({ id, apply: require(id) }) +// Based on https://stackoverflow.com/questions/27367261/check-if-file-exists-case-sensitive +// Case checking is required, to avoid errors raised by case-sensitive-paths-webpack-plugin +function fileExistsWithCaseSync (filepath) { + const dir = path.dirname(filepath) + + if (dir === '/' || dir === '.') { + return true + } + + try { + const filenames = fs.readdirSync(dir) + if (!filenames.includes(path.basename(filepath))) { + return false + } + } catch (e) { + // dir does not exist + return false + } + + return fileExistsWithCaseSync(dir) +} + exports.findExisting = (context, files) => { for (const file of files) { - if (fs.existsSync(path.join(context, file))) { + if (fileExistsWithCaseSync(path.join(context, file))) { return file } }
fix: `findExisting` should be case sensitive closes #<I> We have added `case-sensitive-paths-webpack-plugin` to the base config. So the filename of instant prototyping entry should also be case-sensitive.
vuejs_vue-cli
train
js
80e24176e9ab3ab455ae35ed29266fc38578b7a0
diff --git a/ggplot/guides/guides.py b/ggplot/guides/guides.py index <HASH>..<HASH> 100644 --- a/ggplot/guides/guides.py +++ b/ggplot/guides/guides.py @@ -31,7 +31,7 @@ class guides(dict): def __init__(self, **kwargs): aes_names = {'alpha', 'color', 'fill', - 'shape', 'size'} + 'linetype', 'shape', 'size'} if 'colour' in kwargs: kwargs['color'] = kwargs.pop('colour')
Add linetype to aesthetics that can have a guide
has2k1_plotnine
train
py
e34a7426c77318af11e797bc92969ba04b5f54cd
diff --git a/src/PeekAndPoke/Component/Psi/Functions/Unary/Matcher/IsDateString.php b/src/PeekAndPoke/Component/Psi/Functions/Unary/Matcher/IsDateString.php index <HASH>..<HASH> 100644 --- a/src/PeekAndPoke/Component/Psi/Functions/Unary/Matcher/IsDateString.php +++ b/src/PeekAndPoke/Component/Psi/Functions/Unary/Matcher/IsDateString.php @@ -36,6 +36,10 @@ class IsDateString extends AbstractUnaryFunction return false; } + if (preg_match('/(\d{4})-(\d{2})-(\d{2})T((\d{2}):(\d{2}):(\d{2}))\.(\d{3})Z/', $str)) { + return true; + } + $stamp = strtotime($str); if (!is_numeric($stamp)) {
moved files added multiple new matchers and checks add PeekAndPoke\Horizons add ValueHolderInterface for delays data access
PeekAndPoke_psi
train
php
02bdc8bd3224ff4fed23eecbffd8c9ea415d61dc
diff --git a/lib/kafka-consumer.js b/lib/kafka-consumer.js index <HASH>..<HASH> 100644 --- a/lib/kafka-consumer.js +++ b/lib/kafka-consumer.js @@ -119,7 +119,12 @@ Consumer.prototype._onWrapper = function (consumerInstance, eventName, cb) { * @return {*} The deserialized value. */ Consumer.prototype.deserialize = function (type, value) { - var parsed = magicByte.fromMessageBuffer(type, value).value; + try { + var parsed = magicByte.fromMessageBuffer(type, value).value; + } catch(ex) { + log.warn('deserialize() :: Error deserializing:', ex); + return null; + } return parsed; };
Catch errors thrown by deserializer
waldophotos_kafka-avro
train
js
d08b0be2931ab46e2d15f87d14fa4b2895243e68
diff --git a/simulator/src/main/java/com/hazelcast/simulator/coordinator/Coordinator.java b/simulator/src/main/java/com/hazelcast/simulator/coordinator/Coordinator.java index <HASH>..<HASH> 100644 --- a/simulator/src/main/java/com/hazelcast/simulator/coordinator/Coordinator.java +++ b/simulator/src/main/java/com/hazelcast/simulator/coordinator/Coordinator.java @@ -310,6 +310,7 @@ public final class Coordinator { echo(HORIZONTAL_RULER); } finally { int runningWorkerCount = componentRegistry.workerCount(); + echo("Terminating %d Workers...", runningWorkerCount); remoteClient.terminateWorkers(true); if (!failureContainer.waitForWorkerShutdown(runningWorkerCount, FINISHED_WORKER_TIMEOUT_SECONDS)) { Set<SimulatorAddress> finishedWorkers = failureContainer.getFinishedWorkers();
Added logging to clarify when TerminateOperation is sent to Workers.
hazelcast_hazelcast-simulator
train
java
48f29be61af001001ec7afb57b8ba44bbc6a32c2
diff --git a/lib/acts_as_revisable/acts/revisable.rb b/lib/acts_as_revisable/acts/revisable.rb index <HASH>..<HASH> 100644 --- a/lib/acts_as_revisable/acts/revisable.rb +++ b/lib/acts_as_revisable/acts/revisable.rb @@ -307,6 +307,7 @@ module FatJam run_callbacks(:after_revise) end force_revision!(false) + true end # Returns true if the _record_ (not just this instance
be sure to always return true from #after_revisable_update in revisables
rich_acts_as_revisable
train
rb
e41f27f2007cedfe23af1605585d4ba877a615fa
diff --git a/lib/tri_table/__init__.py b/lib/tri_table/__init__.py index <HASH>..<HASH> 100644 --- a/lib/tri_table/__init__.py +++ b/lib/tri_table/__init__.py @@ -557,10 +557,9 @@ class Column(RefinableObject): @classmethod @class_shortcut( - call_target__attribute='choice', + call_target__attribute='choice_queryset', bulk__call_target__attribute='multi_choice_queryset', query__call_target__attribute='multi_choice_queryset', - cell__format=lambda value, **_: ', '.join(['%s' % x for x in value.all()]), ) def multi_choice_queryset(cls, call_target, **kwargs): setdefaults_path(kwargs, dict(
Column.multi_choice_queryset was broken
TriOptima_tri.table
train
py
78bfa420f322ce21caa7b0500537c3984c892847
diff --git a/ghostjs-core/src/ghostjs.js b/ghostjs-core/src/ghostjs.js index <HASH>..<HASH> 100644 --- a/ghostjs-core/src/ghostjs.js +++ b/ghostjs-core/src/ghostjs.js @@ -16,6 +16,13 @@ class GhostJS { resolve(status); }) }) + }, + { + // The dnode `weak` dependency is failing to install on travis. + // Disable this for now until someone needs it. + dnodeOpts: { + weak: false + } }) }) }
Disable dnode/weak for failing to install on travis.
KevinGrandon_ghostjs
train
js
7b763bc1c36b71084497e72cedd39f1a3e278ea2
diff --git a/flux_led/device.py b/flux_led/device.py index <HASH>..<HASH> 100644 --- a/flux_led/device.py +++ b/flux_led/device.py @@ -575,7 +575,7 @@ class LEDENETDevice: print("RGBW command sent to non-RGBW device") raise ValueError("RGBW command sent to non-RGBW device") - if brightness != None: + if brightness != None and r is not None and g is not None and b is not None: (r, g, b) = self._calculateBrightness((r, g, b), brightness) r_value = 0 if r is None else int(r)
Do not set brightness for RGB if not passed
Danielhiversen_flux_led
train
py
84faef2c7a5e1196d79ad040886faace0d7787b5
diff --git a/src/stream/pipe.js b/src/stream/pipe.js index <HASH>..<HASH> 100644 --- a/src/stream/pipe.js +++ b/src/stream/pipe.js @@ -11,6 +11,28 @@ /*#endif*/ /** + * Creates a pipe sequence chain between an intermediate stream and a writable (flushable?) destination + * + * @param {Object} intermediate Must at least implements IReadableStream interface. + * If it implements the IFlushableStream interface, it is assumed that it retains data + * until it receives the Flush. Meaning, the read won't complete until the flush call. + * If it does not implement the IFlushableStream, the read may end before the whole sequence + * has finished. It means that the next write should trigger a new read and flush must be simulated at + * least to pass it to the + * @param destination + * @private + */ +/* +function _gpfStreamPipeToFlushableWrite (intermediate, destination) { + + var iReadableStream = _gpfStreamQueryReadable(intermediate), + iWritableStream = _gpfStreamQueryWritable(destination), + iFlushableOutStream = _gpfInterfaceQuery(_gpfIFlushableStream, destination); + +} +*/ + +/** * Pipe streams. * * @param {gpf.interfaces.IReadableStream} source Source stream
Requires more reflexion (#<I>)
ArnaudBuchholz_gpf-js
train
js
df5d2c9a63116e0cdaa439647a969c44c2e764db
diff --git a/builtin/providers/aws/config.go b/builtin/providers/aws/config.go index <HASH>..<HASH> 100644 --- a/builtin/providers/aws/config.go +++ b/builtin/providers/aws/config.go @@ -193,7 +193,10 @@ func (c *Config) Client() (interface{}, error) { dynamoSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.DynamoDBEndpoint)}) kinesisSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.KinesisEndpoint)}) + // These two services need to be set up early so we can check on AccountID + client.iamconn = iam.New(awsIamSess) client.stsconn = sts.New(sess) + err = c.ValidateCredentials(client.stsconn) if err != nil { errs = append(errs, err) @@ -233,7 +236,6 @@ func (c *Config) Client() (interface{}, error) { client.esconn = elasticsearch.New(sess) client.firehoseconn = firehose.New(sess) client.glacierconn = glacier.New(sess) - client.iamconn = iam.New(awsIamSess) client.kinesisconn = kinesis.New(kinesisSess) client.kmsconn = kms.New(sess) client.lambdaconn = lambda.New(sess)
provider/aws: pull iamconn setup earlier (#<I>) Fixes problem introduced in re-arrangement of config
hashicorp_terraform
train
go
76fd1896f815031e3b118bd0020f334453f792e0
diff --git a/src/js/amount.js b/src/js/amount.js index <HASH>..<HASH> 100644 --- a/src/js/amount.js +++ b/src/js/amount.js @@ -349,6 +349,13 @@ Amount.prototype.divide = function (d) { * @return {Amount} The resulting ratio. Unit will be the same as numerator. */ Amount.prototype.ratio_human = function (denominator) { + if ("number" === typeof denominator && parseInt(denominator) === denominator) { + // Special handling of integer arguments + denominator = Amount.from_json("" + denominator + ".0"); + } else { + denominator = Amount.from_json(denominator); + } + var numerator = this; denominator = Amount.from_json(denominator); @@ -581,6 +588,9 @@ Amount.prototype.parse_json = function (j) { this._issuer = new UInt160(); } } + else if ('number' === typeof j) { + this.parse_json(""+j); + } else if ('object' === typeof j && j instanceof Amount) { j.copyTo(this); }
JS: Amount - handle plain numbers as arguments to ratio_human and product_human.
ChainSQL_chainsql-lib
train
js
29a06dda7ef4143afa3a29470af2c5dee24fc43c
diff --git a/pyhamtools/lookuplib.py b/pyhamtools/lookuplib.py index <HASH>..<HASH> 100644 --- a/pyhamtools/lookuplib.py +++ b/pyhamtools/lookuplib.py @@ -801,7 +801,11 @@ class LookupLib(object): #if this fails again, raise error if root.error: - raise AttributeError(root.error.text) #most likely session key invalid + + if re.search('Not found', root.error.text, re.I): #No data available for callsign + raise KeyError(root.error.text) + else: + raise AttributeError(root.error.text) #most likely session key invalid else: raise AttributeError(root.error.text) #most likely session key missing
raising KeyError when Callsign not found and the session key has just expired
dh1tw_pyhamtools
train
py
1504f70af3bba481f6ea69f54a8450a5f208da50
diff --git a/test/batch-processor.test.js b/test/batch-processor.test.js index <HASH>..<HASH> 100644 --- a/test/batch-processor.test.js +++ b/test/batch-processor.test.js @@ -31,8 +31,8 @@ suite('batch/processor/Processor (instance methods)', function() { }); processor = new Processor({ -// databasePath: utils.databasePath, // we must reuse the existing connection! - database: database, + databasePath: utils.databasePath, + database: database, // we must reuse the existing connection! domain: 'test', }); console.log(processor.database.commandSync('table_list'));
Specify databasePath even if actually it is not used.
groonga_gcs
train
js
b1a15e8397655fa84a892c4c82f17c0f63dbae97
diff --git a/Kwc/Basic/Table/Component.php b/Kwc/Basic/Table/Component.php index <HASH>..<HASH> 100644 --- a/Kwc/Basic/Table/Component.php +++ b/Kwc/Basic/Table/Component.php @@ -119,4 +119,17 @@ class Kwc_Basic_Table_Component extends Kwc_Abstract_Composite_Component } return $ret; } + + public function hasContent() + { + $dataSelect = new Kwf_Model_Select(); + $dataSelect->whereEquals('visible', 1); + $dataSelect->order('pos', 'ASC'); + $rows = $this->_getRow()->getChildRows('tableData', $dataSelect); + if (count($rows)) { + return true; + } else { + return false; + } + } }
Implement hasContent in Basic_Table Component
koala-framework_koala-framework
train
php
e1479ec328115a63365a60542617c601f7251fc9
diff --git a/pycons3rt/bash.py b/pycons3rt/bash.py index <HASH>..<HASH> 100755 --- a/pycons3rt/bash.py +++ b/pycons3rt/bash.py @@ -555,7 +555,7 @@ def zip_dir(dir_path, zip_file): raise CommandError(msg) try: - with contextlib.closing(zipfile.ZipFile(zip_file, 'w')) as zip_w: + with contextlib.closing(zipfile.ZipFile(zip_file, 'w', allowZip64=True)) as zip_w: for root, dirs, files in os.walk(dir_path): for f in files: log.debug('Adding file to zip: %s', f)
Updated the bash.zip_dir method to set allowZip<I>=True, this allows zip files > 2GB
cons3rt_pycons3rt
train
py
0475e4fed259398b33212b471a15bc3a90e54451
diff --git a/app/helpers/t.js b/app/helpers/t.js index <HASH>..<HASH> 100644 --- a/app/helpers/t.js +++ b/app/helpers/t.js @@ -8,8 +8,13 @@ export default function tHelper() { var view = options.data.view; var container = view.container; var t = container.lookup('utils:t'); + var application = container.lookup('application:main'); - return new Stream(function() { + var stream = new Stream(function() { return t(path, args); }); + + application.localeStream.subscribe(stream.notify, stream); + + return stream; }
Re-add code that was prematurely removed
ember-furnace_ember-cli-furnace-i18n
train
js
9fd68468becb7a46a9ec032ba44df17d2d955c6f
diff --git a/src/adaptors/DOMStorageAdaptor.js b/src/adaptors/DOMStorageAdaptor.js index <HASH>..<HASH> 100644 --- a/src/adaptors/DOMStorageAdaptor.js +++ b/src/adaptors/DOMStorageAdaptor.js @@ -21,7 +21,7 @@ DOMStorageAdaptor.prototype = { this.storage = this.merge(window.localStorage, options.storage); this.table = this.merge('field', options.table); - if (!(this.storage instanceof window.Storage)) { + if (!window.Storage) { this.storage = (function () { // window.top.name ensures top level, and supports around 2Mb var data = window.top.name ? self.deserialize(window.top.name) : {};
fallback to window.name hack was failing in android <I>
brianleroux_lawnchair
train
js
9974634b5d240ee871f89689926aade82f1b6544
diff --git a/lib/assets/custom_action_template.rb b/lib/assets/custom_action_template.rb index <HASH>..<HASH> 100644 --- a/lib/assets/custom_action_template.rb +++ b/lib/assets/custom_action_template.rb @@ -44,6 +44,7 @@ module Fastlane description: "API Token for [[NAME_CLASS]]", # a short description of this parameter verify_block: proc do |value| raise "No API token for [[NAME_CLASS]] given, pass using `api_token: 'token'`".red unless (value and not value.empty?) + # raise "Couldn't find file at path '#{value}'".red unless File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :development, env_name: "FL_[[NAME_UP]]_DEVELOPMENT",
Added example file check to fastlane action template
fastlane_fastlane
train
rb
bcb5a04b1b17a2a7b6ad98047198e0d0788adccd
diff --git a/km3pipe/pumps/aanet.py b/km3pipe/pumps/aanet.py index <HASH>..<HASH> 100644 --- a/km3pipe/pumps/aanet.py +++ b/km3pipe/pumps/aanet.py @@ -48,14 +48,15 @@ class AanetPump(Pump): for filename in self.filenames: print("Reading from file: {0}".format(filename)) - self.event_file = EventFile(filename) - for event in self.event_file: + event_file = EventFile(filename) + for event in event_file: blob = {'Evt': event, 'RawHits': event.hits, 'MCHits': event.mc_hits, 'RecoTracks': event.trks, 'MCTracks': event.mc_trks} yield blob + del event_file def process(self, blob): return next(self.blobs)
Deletes the pointer to force memory free-up
tamasgal_km3pipe
train
py
98b53eec0cf57cb4aff4e2494046ddd234933f3f
diff --git a/lib/htmlbars/compiler/hydration.js b/lib/htmlbars/compiler/hydration.js index <HASH>..<HASH> 100644 --- a/lib/htmlbars/compiler/hydration.js +++ b/lib/htmlbars/compiler/hydration.js @@ -69,6 +69,7 @@ prototype.stackLiteral = function(literal) { prototype.helper = function(name, size, escaped, placeholderNum) { var prepared = prepareHelper(this.stack, size); prepared.options.push('escaped:'+escaped); + prepared.options.push('data:options.data'); this.pushMustacheInContent(string(name), prepared.args, prepared.options, placeholderNum); };
Pass `options.data` through TODO: write tests for this
glimmerjs_glimmer-vm
train
js
e116401cc430e2ceb363081b34d555f30505e60a
diff --git a/lib/util/check.js b/lib/util/check.js index <HASH>..<HASH> 100644 --- a/lib/util/check.js +++ b/lib/util/check.js @@ -318,7 +318,11 @@ function saveDrawCommandInfo (opts, uniforms, stringStore) { addUniforms(uniforms.static) addUniforms(uniforms.dynamic) - opts._hasCount = 'count' in opts.static || 'count' in opts.dynamic + opts._hasCount = ( + 'count' in opts.static || + 'count' in opts.dynamic || + 'elements' in opts.static || + 'elements' in opts.dynamic) } function checkDrawCommandState (
fix check on missing vertex count from element buffer
regl-project_regl
train
js
a1c22965ba99fe69a88989309203f741add6aee9
diff --git a/lib/ngannotate/processor.rb b/lib/ngannotate/processor.rb index <HASH>..<HASH> 100644 --- a/lib/ngannotate/processor.rb +++ b/lib/ngannotate/processor.rb @@ -7,11 +7,21 @@ module Ngannotate end def prepare + return if skip ngannotate_source = File.open(File.join(File.dirname(__FILE__), '../../vendor/ngannotate.js')).read @context = ExecJS.compile "window = {};" + ngannotate_source end + # + # Skip processing in environments where it does not make sense + # + def skip + ::Rails.env.development? || ::Rails.env.test? + end + def evaluate(context, locals) + return data if skip + opt = { add: true }.merge!(parse_opt) r = @context.call 'window.annotate', data, opt r['src']
ISSUE#3 Skip redundant ngannotate processing in development/test
kikonen_ngannotate-rails
train
rb
827667db7b3f83cd5d081d866f35f7bf79603cdf
diff --git a/lib/coapRouter.js b/lib/coapRouter.js index <HASH>..<HASH> 100644 --- a/lib/coapRouter.js +++ b/lib/coapRouter.js @@ -23,7 +23,7 @@ var coapRouter = { { fragments : [], tokens : [], - compileRegExp : function () { return new RegExp(this.fragments.join("\\/")); }, + compileRegExp : function () { return new RegExp(this.fragments.join("\\/") + "$"); }, regexp : '' } );
corrected regex pattern so that the path is an exact match or nothing
octoblu_meshblu
train
js
99675dc791941b0d9e4f8a81e2527bcaaee1d39b
diff --git a/modules/descendancy/module.php b/modules/descendancy/module.php index <HASH>..<HASH> 100644 --- a/modules/descendancy/module.php +++ b/modules/descendancy/module.php @@ -42,7 +42,7 @@ class descendancy_WT_Module extends WT_Module implements WT_Module_Sidebar { // Extend WT_Module public function getDescription() { - return i18n::translate('Adds a sidebar which allows for easy navigation of indiviuals in a descendants tree-view format.'); + return i18n::translate('Adds a sidebar which allows for easy navigation of individuals in a descendants tree-view format.'); } // Implement WT_Module_Sidebar
added "d" to indiviuals
fisharebest_webtrees
train
php
906916215196a39a1cde2fcd4789ce693223fcc9
diff --git a/src/ccpa/UserSignalMechanism.js b/src/ccpa/UserSignalMechanism.js index <HASH>..<HASH> 100644 --- a/src/ccpa/UserSignalMechanism.js +++ b/src/ccpa/UserSignalMechanism.js @@ -11,7 +11,7 @@ const USP_VALUES = { }; export const USP_VERSION = 1; -let EXPLICIT_NOTICE = USP_VALUES.no; +let EXPLICIT_NOTICE = USP_VALUES.yes; let OPT_OUT_SALE = USP_VALUES.no; let LSPA_SUPPORT = USP_VALUES.no;
ADEN-<I> Switch user explicit notice to Yes
Wikia_tracking-opt-in
train
js
8b5841587f06cc0e6b7e9031d01f13d646a83709
diff --git a/lib/range.js b/lib/range.js index <HASH>..<HASH> 100644 --- a/lib/range.js +++ b/lib/range.js @@ -3,8 +3,8 @@ exports.Range = Range; -exports.extendNative = function() { - global.Range = Range; +exports.extendNative = function(context) { + context.Range = Range; }; function Range(start, length) { diff --git a/lib/repr.js b/lib/repr.js index <HASH>..<HASH> 100644 --- a/lib/repr.js +++ b/lib/repr.js @@ -4,8 +4,8 @@ // readable string representations of values exports.repr = repr; -exports.extendNative = function() { - global.repr = repr; +exports.extendNative = function(context) { + context.repr = repr; }; function repr(x) { diff --git a/lib/set.js b/lib/set.js index <HASH>..<HASH> 100644 --- a/lib/set.js +++ b/lib/set.js @@ -3,8 +3,8 @@ exports.Set = Set; -exports.extendNative = function() { - global.Set = Set; +exports.extendNative = function(context) { + context.Set = Set; }; var ownProps = Object.getOwnPropertyNames;
accept a context in extendNative() methods
samsonjs_batteries
train
js,js,js
5dcefcfed04474650a6bedaaae4a7741e7fb60a3
diff --git a/src/config/unexpected-styles.test.js b/src/config/unexpected-styles.test.js index <HASH>..<HASH> 100644 --- a/src/config/unexpected-styles.test.js +++ b/src/config/unexpected-styles.test.js @@ -126,12 +126,14 @@ describe("Styled component plugin for unexpected", () => { "color: blue;", ), "to throw", - 'expected <div class="unexpected-stylestest__TestStyled-waex4f-0 grRYoI"></div>\n' + - "to have style rules satisfying to contain 'color: blue;'\n" + - " expected '.grRYoI {color: red; background-color: green;}' to contain 'color: blue;'\n" + - "\n" + - " .grRYoI {color: red; background-color: green;}\n" + - " ^^^^^^^ ^^^^^^^", + new RegExp( + 'expected <div class="unexpected-stylestest__TestStyled-\\w+-0 \\w+"></div>\n' + + "to have style rules satisfying to contain 'color: blue;'\n" + + " expected '\\.\\w+ \\{color: red; background-color: green;\\}' to contain 'color: blue;'\n" + + "\n" + + " \\.\\w+ \\{color: red; background-color: green;\\}\n" + + " \\^\\^\\^\\^\\^\\^\\^ \\^\\^\\^\\^\\^\\^\\^", + ), )); it("fails if no class name", () =>
Made styled-components diff test less breakable
Orckestra_orc-scripts
train
js
fa668425a385a6594f567e1416afe294bdb58927
diff --git a/staff/models.py b/staff/models.py index <HASH>..<HASH> 100644 --- a/staff/models.py +++ b/staff/models.py @@ -1,10 +1,12 @@ from django.db import models -from django.db.models import permalink from django.utils.translation import ugettext_lazy as _ from django.contrib.localflavor.us.models import PhoneNumberField from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.template.defaultfilters import slugify +from django.conf import settings + +DEFAULT_STORAGE = getattr(settings, "STAFF_PHOTO_STORAGE", settings.DEFAULT_FILE_STORAGE) class StaffMemberManager(models.Manager): @@ -36,7 +38,7 @@ class StaffMember(models.Model): bio = models.TextField(_('Biography'), blank=True) is_active = models.BooleanField(_('is a current employee'), default=True) phone = PhoneNumberField(_('Phone Number'), blank=True) - photo = models.FileField(_('Photo'), blank=True, upload_to='img/staff/%Y') + photo = models.FileField(_('Photo'), blank=True, upload_to='img/staff/%Y', storage=DEFAULT_STORAGE()) sites = models.ManyToManyField(Site) objects = StaffMemberManager()
Added a storage field option for photo storage. As well as a STAFF_PHOTO_STORAGE setting
callowayproject_django-staff
train
py
7ff3e9399f90e05c0d6c002a240d2b1761296d92
diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index <HASH>..<HASH> 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -1181,7 +1181,7 @@ class Executor { // First, look for `__typename`. if ($value !== null && - is_array($value) && + (is_array($value) || $value instanceof ArrayAccess) && isset($value['__typename']) && is_string($value['__typename']) ) {
Expand is_array check in defaultTypeResolver to allow for ArrayAccess… (#<I>) Expand is_array check in defaultTypeResolver to allow for ArrayAccess objects as well
webonyx_graphql-php
train
php
a8ea9445aae5822a988356633cba3e8d3ba7e319
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ requirements = [ # Protocol and data packages "pytmpdir >= 0.2.3", # A temporary directory, useful for extracting archives to "txhttputil >= 0.2.7", # Utility class for http requests - "vortexpy >= 1.0.1", # Data serialisation and transport layer, observable based + "vortexpy >= 1.0.2", # Data serialisation and transport layer, observable based # SOAP interface packages "SOAPpy-py3 >= 0.52.24", # See http://soappy.ooz.ie for tutorials
Updating PoF SQL sql now also updates data using that SQL OR<I>-<I>
Synerty_peek-plugin-base
train
py
ec6adca0f43cbbc798d88676e229a3b4cb7c0821
diff --git a/question/type/questiontype.php b/question/type/questiontype.php index <HASH>..<HASH> 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -523,13 +523,15 @@ class default_questiontype { $cm = get_coursemodule_from_instance('quiz', $cmoptions->id); if (!empty($cm->id)) { $context = get_context_instance(CONTEXT_MODULE, $cm->id); + } else if (!empty($cm->course)) { + $context = get_context_instance(CONTEXT_COURSE, $cm->course); } else { - $context = false; + $context = get_context_instance(CONTEXT_SYSTEM, SITEID); } // For editing teachers print a link to an editing popup window $editlink = ''; - if ($context && has_capability('mod/quiz:manage', $context)) { + if ($context && has_capability('moodle/question:manage', $context)) { $stredit = get_string('edit'); $linktext = '<img src="'.$CFG->pixpath.'/t/edit.gif" border="0" alt="'.$stredit.'" />'; $editlink = link_to_popup_window('/question/question.php?id='.$question->id, $stredit, $linktext, 450, 550, $stredit, '', true);
MDL-<I> Edit qestion link gone from question preview popup. It was checking the wrong capability.
moodle_moodle
train
php
64c7e405e87de0eda19d08cbca9b946cbcf5508a
diff --git a/lib/octocatalog-diff/catalog/computed.rb b/lib/octocatalog-diff/catalog/computed.rb index <HASH>..<HASH> 100644 --- a/lib/octocatalog-diff/catalog/computed.rb +++ b/lib/octocatalog-diff/catalog/computed.rb @@ -16,7 +16,7 @@ module OctocatalogDiff # Represents a Puppet catalog that is computed (via `puppet master --compile ...`) # By instantiating this class, the catalog is computed. class Computed - attr_reader :node, :error_message, :catalog, :catalog_json, :retries, :scriptrunner, :puppet_command_obj + attr_reader :node, :error_message, :catalog, :catalog_json, :retries # Constructor # @param :node [String] REQUIRED: Node name
Should no longer be needed with refactors
github_octocatalog-diff
train
rb
ca539fce03b668f1d7dc0cab63ffae7f98058e3a
diff --git a/qa/performance-tests-engine/src/main/java/org/camunda/bpm/qa/performance/engine/framework/report/HtmlReportBuilder.java b/qa/performance-tests-engine/src/main/java/org/camunda/bpm/qa/performance/engine/framework/report/HtmlReportBuilder.java index <HASH>..<HASH> 100644 --- a/qa/performance-tests-engine/src/main/java/org/camunda/bpm/qa/performance/engine/framework/report/HtmlReportBuilder.java +++ b/qa/performance-tests-engine/src/main/java/org/camunda/bpm/qa/performance/engine/framework/report/HtmlReportBuilder.java @@ -107,7 +107,7 @@ public class HtmlReportBuilder { .endElement(); } - if(jsonSourceFileName != null && jsonSourceFileName != null) { + if(jsonSourceFileName != null) { sourceRow.startElement(new HtmlElementWriter("span").textContent("&nbsp;|&nbsp;")).endElement(); }
chore(qa): Duplicate subexpressions in HtmlReportBuilder `jsonSourceFileName != null` is repeated
camunda_camunda-bpm-platform
train
java
c5618a14ea978a4fbd92dc1d1ba6c1689b0f7d13
diff --git a/ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/ViewInterfaces.java b/ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/ViewInterfaces.java index <HASH>..<HASH> 100644 --- a/ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/ViewInterfaces.java +++ b/ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/ViewInterfaces.java @@ -76,7 +76,8 @@ class ViewInterfaces { // & FR 5.4.2 if (name.equals(Serializable.class.getName()) || name.equals(Externalizable.class.getName()) || - name.startsWith("javax.ejb.")) { + name.startsWith("javax.ejb.") || + name.startsWith("groovy.lang.") { continue; } names.add(dotName);
[WFLY-<I>] fix groovy meta class interface Ignore the groovy meta class allowing to get the correct implemented interface
wildfly_wildfly
train
java
b45ace6e779ad0ecdc400d2ebb4c2a6285fe9973
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -42,7 +42,7 @@ var Ws = (function () { this.connectListeners = []; this.disconnectListeners = []; this.nativeMessageListeners = []; - this.messageListeners = {}; + this.messageListeners = {'*':[]}; if (!window["WebSocket"]) { return; } @@ -205,9 +205,6 @@ var Ws = (function () { this.messageListeners[event].push(cb); }; Ws.prototype.OnAll = function (cb) { - if (this.messageListeners['*'] == null || this.messageListeners['*'] == undefined) { - this.messageListeners['*'] = []; - } this.messageListeners['*'].push(cb); }; Ws.prototype.fireMessage = function (event, message) {
fix missing object key "*" for OnAll() at iris-ws.js
kataras_go-websocket
train
go
b3ef44d66a02690315097da99ea8a7ea92cd72d1
diff --git a/ford/sourceform.py b/ford/sourceform.py index <HASH>..<HASH> 100644 --- a/ford/sourceform.py +++ b/ford/sourceform.py @@ -51,7 +51,7 @@ ATTRIBSPLIT_RE = re.compile(",\s*(\w.*?)::\s*(.*)\s*") ATTRIBSPLIT2_RE = re.compile("\s*(::)?\s*(.*)\s*") ASSIGN_RE = re.compile("(\w+\s*(?:\([^=]*\)))\s*=(?!>)(?:\s*([^\s]+))?") POINT_RE = re.compile("(\w+\s*(?:\([^=>]*\)))\s*=>(?:\s*([^\s]+))?") -EXTENDS_RE = re.compile("extends\s*\(\s*([^()\s]+)\s*\)") +EXTENDS_RE = re.compile("extends\s*\(\s*([^()\s]+)\s*\)", re.IGNORECASE) DOUBLE_PREC_RE = re.compile("double\s+precision",re.IGNORECASE) QUOTES_RE = re.compile("\"([^\"]|\"\")*\"|'([^']|'')*'",re.IGNORECASE) PARA_CAPTURE_RE = re.compile("<p>.*?</p>",re.IGNORECASE|re.DOTALL)
Extends now recognised if capitalised
Fortran-FOSS-Programmers_ford
train
py
0568fb35a71e03e700260724e2880f537e7ce7f7
diff --git a/CHANGES.txt b/CHANGES.txt index <HASH>..<HASH> 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,3 +8,5 @@ v0.5dev, 2013-09-26 -- Adds published & updated dates, author information, and categories to feed output. Defaults feed type to Atom v1. v1.0, 2013-12-22 -- Creates full test suite. +v1.1, 2014-09-07 -- Adds support for Django 1.7 migrations and + Post.reading_time property. diff --git a/hermes/__init__.py b/hermes/__init__.py index <HASH>..<HASH> 100644 --- a/hermes/__init__.py +++ b/hermes/__init__.py @@ -1 +1 @@ -__version__ = '1.0' +__version__ = '1.1' diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name='django-hermes', - version='1.0', + version='1.1', author='Chris Pickett', author_email='chris.pickett@gmail.com', packages=find_packages(),
Bump to version <I>
bunchesofdonald_django-hermes
train
txt,py,py
15533697d9139a69791410608471921530a2a01b
diff --git a/lib/heroku/command/pg.rb b/lib/heroku/command/pg.rb index <HASH>..<HASH> 100644 --- a/lib/heroku/command/pg.rb +++ b/lib/heroku/command/pg.rb @@ -38,13 +38,7 @@ class Heroku::Command::Pg < Heroku::Command::Base name, url = hpg_resolve(db) display_db name, hpg_info(url) else - if hpg_databases_with_info.empty? - display("#{app} has no heroku-postgresql databases.") - else - hpg_databases_with_info.keys.sort.each do |name| - display_db name, hpg_databases_with_info[name] - end - end + index end end
defer to index in pg:info without argument to reduce duplication
heroku_legacy-cli
train
rb
c331d90815e0ce2876cee4d272798629928cc9ab
diff --git a/packages/node_modules/pouchdb-core/src/adapter.js b/packages/node_modules/pouchdb-core/src/adapter.js index <HASH>..<HASH> 100644 --- a/packages/node_modules/pouchdb-core/src/adapter.js +++ b/packages/node_modules/pouchdb-core/src/adapter.js @@ -177,7 +177,7 @@ function doNextCompaction(self) { function attachmentNameError(name) { if (name.charAt(0) === '_') { - return name + 'is not a valid attachment name, attachment ' + + return name + ' is not a valid attachment name, attachment ' + 'names cannot start with \'_\''; } return false;
(#<I>) - Add missing space to an error message.
pouchdb_pouchdb
train
js
5869bab296a5acedfb1ce68d56b7edca9da35660
diff --git a/katcp/test/test_server.py b/katcp/test/test_server.py index <HASH>..<HASH> 100644 --- a/katcp/test/test_server.py +++ b/katcp/test/test_server.py @@ -1049,10 +1049,15 @@ class TestDeviceServerClientIntegrated(unittest.TestCase, TestUtilMixin): self.client.test_sensor_list(byte_sensors) str_sensors = {("a.discrete", "A Discrete.", "", "discrete", "one", "two", "three"), - ("a.float", b"A Float.", "", "float", "-123.4", "123.4"), - ("an.int", b"An Integer.", "count", "integer", "-5", "5")} + ("a.float", "A Float.", "", "float", "-123.4", "123.4"), + ("an.int", "An Integer.", "count", "integer", "-5", "5")} self.client.test_sensor_list(str_sensors) + mix_sensors = {("a.discrete", "A Discrete.", "", "discrete", b"one", b"two", b"three"), + ("a.float", b"A Float.", "", b"float", "-123.4", "123.4"), + ("an.int", b"An Integer.", "count", "integer", "-5", b"5")} + self.client.test_sensor_list(mix_sensors) + def test_assert_request_succeeds(self): """Test exercises assert_request_succeeds"""
added mixed str and byte in string
ska-sa_katcp-python
train
py
3dc8e77e713fb144056c3b7e8a487b221fbb7693
diff --git a/cli/sawtooth_cli/rest_client.py b/cli/sawtooth_cli/rest_client.py index <HASH>..<HASH> 100644 --- a/cli/sawtooth_cli/rest_client.py +++ b/cli/sawtooth_cli/rest_client.py @@ -95,7 +95,8 @@ class RestClient(object): if code == 200: return json_result elif code == 404: - return None + raise CliException('There is no resource with the identifier "{}"'. + format(path.split('/')[-1])) else: raise CliException("({}): {}".format(code, json_result))
Remove stacktraces on <I> from sawtooth show command Previously, the Sawtooth CLI mishandled <I> errors when fetching resources, causing a stack trace to be be printed to the console when running a 'sawtooth show' command with a bad id. This replaces the stack trace with a more sensible error message.
hyperledger_sawtooth-core
train
py
f170bd43525743e2ac74941ac79210d82f22158e
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -14,7 +14,10 @@ module.exports = { this._super.included(app); - app.import(app.bowerDirectory + '/pikaday/pikaday.js'); - app.import(app.bowerDirectory + '/pikaday/css/pikaday.css'); + const options = app.options.emberPikaday || {}; + if (!options.excludePikadayAssets) { + app.import(app.bowerDirectory + '/pikaday/pikaday.js'); + app.import(app.bowerDirectory + '/pikaday/css/pikaday.css'); + } } };
Option to exclude pikaday assets from the build
adopted-ember-addons_ember-pikaday
train
js
d1f050b17922ee586521a4279c3da6caf5f230a1
diff --git a/pyforms/gui/Controls/ControlMdiArea.py b/pyforms/gui/Controls/ControlMdiArea.py index <HASH>..<HASH> 100644 --- a/pyforms/gui/Controls/ControlMdiArea.py +++ b/pyforms/gui/Controls/ControlMdiArea.py @@ -43,8 +43,12 @@ class ControlMdiArea(ControlBase, QMdiArea): :return: """ widget.close() + self += widget # little tweak to temporarily make this widget as the active subwindow self.removeSubWindow(widget.subwindow) del widget.subwindow + + logger.debug("Widget sub window removed. MDI area sub windows: %s", self.subWindowList()) + return self def __add__(self, widget):
Fixes remove widget (and sub window) from the mdi list
UmSenhorQualquer_pyforms
train
py
eb6ae348b50cef79aa903390d5f3147538a49588
diff --git a/lib/quickbooks/model/base_model.rb b/lib/quickbooks/model/base_model.rb index <HASH>..<HASH> 100644 --- a/lib/quickbooks/model/base_model.rb +++ b/lib/quickbooks/model/base_model.rb @@ -86,7 +86,8 @@ module Quickbooks references = args.empty? ? reference_attrs : args references.each do |attribute| - field_name = attribute.slice(0, attribute.rindex('_ref')) + last_index = attribute.rindex('_ref') + field_name = !last_index.nil? ? attribute.slice(0, last_index) : attribute method_name = "#{field_name}_id=".to_sym unless instance_methods(false).include?(method_name) method_definition = <<-METH
fix for when no _ref is found
ruckus_quickbooks-ruby
train
rb
8c5519756d0e0f090cc529811baf6ed7fecf42cb
diff --git a/python_utils/plot_utils.py b/python_utils/plot_utils.py index <HASH>..<HASH> 100644 --- a/python_utils/plot_utils.py +++ b/python_utils/plot_utils.py @@ -8,6 +8,7 @@ def my_savefig(filename, dir=''): if filename is not None: full_filename = os.path.join(dir, filename) pylab.savefig(full_filename) + pylab.close() def get_aspect_ratio(T_array): num_rows = len(T_array)
close after save, else memory error can occur after too many plots
probcomp_crosscat
train
py
9c1328442ce4a07a8ac8aa7211c389da68c6c5d1
diff --git a/ipyvolume/pylab.py b/ipyvolume/pylab.py index <HASH>..<HASH> 100644 --- a/ipyvolume/pylab.py +++ b/ipyvolume/pylab.py @@ -337,7 +337,7 @@ def plot(x, y, z, color=default_color, **kwargs): """ fig = gcf() _grow_limits(x, y, z) - scatter = ipv.Scatter(x=x, y=y, z=z, color=color, color_selected=color_selected, + scatter = ipv.Scatter(x=x, y=y, z=z, color=color, color_selected=None, size_selected=1, size=1, connected=True, visible_markers=False, visible_lines=True, **kwargs) fig.scatters = fig.scatters + [scatter]
fix: plot: default color_selected set to None
maartenbreddels_ipyvolume
train
py
9e2f3c628a05bfcb085a2fdd182a71062d237bfe
diff --git a/runtime.js b/runtime.js index <HASH>..<HASH> 100644 --- a/runtime.js +++ b/runtime.js @@ -292,7 +292,8 @@ next.done = false; return next; } - }; + } + next.value = undefined; next.done = true; return next; }; diff --git a/test/tests.es6.js b/test/tests.es6.js index <HASH>..<HASH> 100644 --- a/test/tests.es6.js +++ b/test/tests.es6.js @@ -882,6 +882,33 @@ describe("delegated yield", function() { check(gen(), [0, "one", "two", "three", 2, 3, 4, 5]); }); + + it("should evaluate to the return value of the delegate", function() { + function *inner() { + yield 1; + return 2; + } + + function *outer(delegate) { + return yield* delegate; + } + + check(outer(inner()), [1], 2); + + var arrayDelegate = [3, 4]; + if (!runningInTranslation) { + // Node v0.11 doesn't know how to turn arrays into iterators over + // their elements without a little help. + arrayDelegate = regeneratorRuntime.values(arrayDelegate); + } + check(outer(arrayDelegate), [3, 4], void 0); // See issue #143. + + check(outer({ + next: function() { + return { value: "oyez", done: true }; + } + }), [], "oyez"); + }); }); describe("function declaration hoisting", function() {
Fix final .value of iterators created by regenatorRuntime.values. Fixes #<I>.
facebook_regenerator
train
js,js
e1854e0b199fba352ddcaa58a3af168e8cc70e3a
diff --git a/activesupport/lib/active_support/ordered_hash.rb b/activesupport/lib/active_support/ordered_hash.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/ordered_hash.rb +++ b/activesupport/lib/active_support/ordered_hash.rb @@ -10,6 +10,16 @@ module ActiveSupport @keys = [] end + def self.[](*args) + ordered_hash = new + args.each_with_index { |val,ind| + # Only every second value is a key. + next if ind % 2 != 0 + ordered_hash[val] = args[ind + 1] + } + ordered_hash + end + def initialize_copy(other) super # make a deep copy of keys diff --git a/activesupport/test/ordered_hash_test.rb b/activesupport/test/ordered_hash_test.rb index <HASH>..<HASH> 100644 --- a/activesupport/test/ordered_hash_test.rb +++ b/activesupport/test/ordered_hash_test.rb @@ -162,4 +162,10 @@ class OrderedHashTest < Test::Unit::TestCase def test_inspect assert @ordered_hash.inspect.include?(@hash.inspect) end + + def test_alternate_initialization + alternate = ActiveSupport::OrderedHash[1,2,3,4] + assert_kind_of ActiveSupport::OrderedHash, alternate + assert_equal [1, 3], alternate.keys + end end
ActiveSupport::OrderedHash[1,2,3,4] creates an OrderedHash instead of a Hash. [#<I> state:committed]
rails_rails
train
rb,rb
0bbfbacc684e069e6c5d9f279d980cf6a5da53b5
diff --git a/src/Context/Traits/UserAwareContextTrait.php b/src/Context/Traits/UserAwareContextTrait.php index <HASH>..<HASH> 100644 --- a/src/Context/Traits/UserAwareContextTrait.php +++ b/src/Context/Traits/UserAwareContextTrait.php @@ -202,8 +202,7 @@ trait UserAwareContextTrait /** * Checks to see if the passed in parameter applies to a user or not. * - * @param string $user_parameter - * the parameter to be checked. + * @param string $user_parameter the parameter to be checked. * * @return boolean $retval True if the parameter does apply to a user. */
Ensure phpdoc is all on one line.
paulgibbs_behat-wordpress-extension
train
php
d58079cbfe57317311d0dbb307922825eace3e7c
diff --git a/neo4j/src/test/java/org/hibernate/ogm/datastore/neo4j/test/remote/RemoteAuthenticationFailureTest.java b/neo4j/src/test/java/org/hibernate/ogm/datastore/neo4j/test/remote/RemoteAuthenticationFailureTest.java index <HASH>..<HASH> 100644 --- a/neo4j/src/test/java/org/hibernate/ogm/datastore/neo4j/test/remote/RemoteAuthenticationFailureTest.java +++ b/neo4j/src/test/java/org/hibernate/ogm/datastore/neo4j/test/remote/RemoteAuthenticationFailureTest.java @@ -32,6 +32,9 @@ public class RemoteAuthenticationFailureTest { @Test public void testAuthenticationFailureAtStartUp() throws Exception { Properties properties = new Properties(); + // Set by Neo4jTestHelper + properties.setProperty( OgmProperties.HOST, System.getProperties().getProperty( OgmProperties.HOST ) ); + properties.setProperty( OgmProperties.PORT, System.getProperties().getProperty( OgmProperties.PORT ) ); properties.setProperty( OgmProperties.USERNAME, "completely wrong" ); properties.setProperty( OgmProperties.PASSWORD, "completely wrong" ); RemoteNeo4jDatastoreProvider remoteDatastoreProvider = new RemoteNeo4jDatastoreProvider();
OGM-<I> Make sure that RemoteAuthenticationFailureTest uses the right HOST
hibernate_hibernate-ogm
train
java
066cefda39e1263116388e296fc0a7a138c5bf02
diff --git a/lib/ey-deploy/deploy.rb b/lib/ey-deploy/deploy.rb index <HASH>..<HASH> 100644 --- a/lib/ey-deploy/deploy.rb +++ b/lib/ey-deploy/deploy.rb @@ -61,11 +61,7 @@ module EY # task def cleanup puts "~> cleaning up old releases" - releases = c.all_releases - 3.times {releases.pop} - releases.each do |rel| - sudo "rm -rf #{rel}" - end + sudo "ls #{c.release_dir} | head -n -3 | xargs -I{} rm -rf #{c.release_dir}/{}" end # task
Clean up old releases on each instance, not just based on the master's releases Change-Id: I4b6c<I>ab<I>afbaa8ef2b1d5a<I>f7ce<I> Reviewed-on: <URL>
engineyard_engineyard-serverside
train
rb
5b68e29154e4eb7043307598fa6913d796ed350b
diff --git a/tests/unit/test_resource_provider_register.py b/tests/unit/test_resource_provider_register.py index <HASH>..<HASH> 100644 --- a/tests/unit/test_resource_provider_register.py +++ b/tests/unit/test_resource_provider_register.py @@ -3,7 +3,8 @@ import functools import unittest.mock import pytest -from fang.errors import FangError, ProviderAlreadyRegisteredError +from fang.errors import ( + FangError, ProviderAlreadyRegisteredError, ProviderNotFoundError) # Class under test: from fang.resource_provider_register import ResourceProviderRegister @@ -461,3 +462,17 @@ class Test_ResourceProviderRegister_load: 'test.resource.name.2': 'new resource', 'test.resource.name.3': 'new resource', }, 'resource_providers should have been overriden with new resources' + +class Test_ResourceProviderRegister_resolve: + + def test__given_known_resource_name__should_resolve_provider( + self, mock_instance, resource_name, resource, resource_provider): + mock_instance.resource_providers = {resource_name: resource_provider} + + result = ResourceProviderRegister.resolve(mock_instance, resource_name) + + assert result == resource + + def test__given_unknown_resource_name__should_raise(self, mock_instance): + with pytest.raises(ProviderNotFoundError): + ResourceProviderRegister.resolve(mock_instance, 'unknown.resource')
Tests ResourceProviderRegister.resolve()
ncraike_fang
train
py
dcf996bbec74589d1f209ac98186ff01403ea1d4
diff --git a/src/Core.php b/src/Core.php index <HASH>..<HASH> 100644 --- a/src/Core.php +++ b/src/Core.php @@ -67,9 +67,6 @@ class Core implements iCore /** @var string View path loading mode */ public $render_mode = self::RENDER_STANDART; - /** @var string composer lock file name */ - public $composerLockFile = 'composer.lock'; - /** * Change current system working environment * @param string $environment Environment identifier @@ -509,13 +506,20 @@ class Core implements iCore /** * Load system from composer.json + * @param string $dependencyFilePath Path to dependencies file * @return $this Chaining */ - public function composer() + public function composer($dependencyFilePath = null) { $composerModules = array(); - \samsonphp\event\Event::fire('core.composer.create', array(& $composerModules, $this->system_path)); + \samsonphp\event\Event::fire( + 'core.composer.create', + array( + & $composerModules, + isset($dependencyFilePath) ? $dependencyFilePath : $this->system_path + ) + ); // Iterate requirements foreach ($composerModules as $requirement => $rating) {
Added dependenciesPath parameter to composer(), this will give ability to specify where to load from this file(should help with SamsonCMS automated modules testing) Removed composerLockFile variable
samsonos_php_core
train
php
c7a9f380f6ea40fe762491ac4ffd093fb13d0db1
diff --git a/lib/docusign_rest/client.rb b/lib/docusign_rest/client.rb index <HASH>..<HASH> 100644 --- a/lib/docusign_rest/client.rb +++ b/lib/docusign_rest/client.rb @@ -412,6 +412,7 @@ module DocusignRest tab_hash[:width] = tab[:width] if tab[:width] tab_hash[:height] = tab[:height] if tab[:width] tab_hash[:value] = tab[:value] if tab[:value] + tab_hash[:selected] = tab[:selected] if tab[:selected] tab_hash[:locked] = tab[:locked] || false diff --git a/test/docusign_rest/client_test.rb b/test/docusign_rest/client_test.rb index <HASH>..<HASH> 100644 --- a/test/docusign_rest/client_test.rb +++ b/test/docusign_rest/client_test.rb @@ -114,6 +114,7 @@ describe DocusignRest::Client do anchor_x_offset: '10', anchor_y_offset: '-5', label: 'another test', + selected: true, list_items: [ { selected: false, @@ -263,4 +264,4 @@ describe DocusignRest::Client do end end end -end \ No newline at end of file +end
added selected as an attribtue
jondkinney_docusign_rest
train
rb,rb
ec13d1c63e7a363bb99fa948eb97b01afc9a5c5c
diff --git a/category_encoders/binary.py b/category_encoders/binary.py index <HASH>..<HASH> 100644 --- a/category_encoders/binary.py +++ b/category_encoders/binary.py @@ -78,9 +78,9 @@ class BinaryEncoder(BaseEstimator, TransformerMixin): self.return_df = return_df self.handle_unknown = handle_unknown self.handle_missing = handle_missing - self.base_n_encoder = ce.BaseNEncoder(base=2, verbose=verbose, cols=cols, mapping=mapping, - drop_invariant=drop_invariant, return_df=return_df, - handle_unknown=handle_unknown, handle_missing=handle_missing) + self.base_n_encoder = ce.BaseNEncoder(base=2, verbose=self.verbose, cols=self.cols, mapping=self.mapping, + drop_invariant=self.drop_invariant, return_df=self.return_df, + handle_unknown=self.handle_unknown, handle_missing=self.handle_missing) def fit(self, X, y=None, **kwargs): """Fit encoder according to X and y.
pass instance variables to basen instantiation
scikit-learn-contrib_categorical-encoding
train
py
e168c6fca97d4811772b62845d13c8f54d3f0a3f
diff --git a/src/main/java/org/jooq/lambda/Seq.java b/src/main/java/org/jooq/lambda/Seq.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jooq/lambda/Seq.java +++ b/src/main/java/org/jooq/lambda/Seq.java @@ -711,28 +711,24 @@ public interface Seq<T> extends Stream<T> { class Duplicate implements Iterator<T> { @Override public boolean hasNext() { - synchronized (it) { - if (ahead[0] == null || ahead[0] == this) - return it.hasNext(); + if (ahead[0] == null || ahead[0] == this) + return it.hasNext(); - return !gap.isEmpty(); - } + return !gap.isEmpty(); } @Override public T next() { - synchronized (it) { - if (ahead[0] == null) - ahead[0] = this; - - if (ahead[0] == this) { - T value = it.next(); - gap.offer(value); - return value; - } + if (ahead[0] == null) + ahead[0] = this; - return gap.poll(); + if (ahead[0] == this) { + T value = it.next(); + gap.offer(value); + return value; } + + return gap.poll(); } }
[#<I>] Remove synchronization from duplicate() algorithm
jOOQ_jOOL
train
java
2bd8a730ae1986edcd19ee9ca686431cfe78bf2e
diff --git a/command.go b/command.go index <HASH>..<HASH> 100644 --- a/command.go +++ b/command.go @@ -655,13 +655,16 @@ func (c *Command) ExecuteC() (cmd *Command, err error) { } err = cmd.execute(flags) if err != nil { + // Always show help if requested, even if SilenceErrors is in + // effect + if err == flag.ErrHelp { + cmd.HelpFunc()(cmd, args) + return cmd, nil + } + // If root command has SilentErrors flagged, // all subcommands should respect it if !cmd.SilenceErrors && !c.SilenceErrors { - if err == flag.ErrHelp { - cmd.HelpFunc()(cmd, args) - return cmd, nil - } c.Println("Error:", err.Error()) }
always show help if requested, even if SilenceErrors is enabled
spf13_cobra
train
go
51fabedd4b5688f70a3eee1f5b9c142db942ed73
diff --git a/lib/travis/model/build/matrix/config.rb b/lib/travis/model/build/matrix/config.rb index <HASH>..<HASH> 100644 --- a/lib/travis/model/build/matrix/config.rb +++ b/lib/travis/model/build/matrix/config.rb @@ -11,10 +11,11 @@ class Build def keys @keys ||= Build::ENV_KEYS & config.keys.map(&:to_sym) & Build.matrix_lang_keys(config) - config.delete_if {|k,v| Build::ENV_KEYS.include?(k) && ! @keys.include?(k) } if Travis::Features.active?(:multi_os, build.request.repository) + config.delete_if {|k,v| Build::ENV_KEYS.include?(k) && !( @keys.include?(k) || k == :os) } @keys = [:os] | @keys else + config.delete_if {|k,v| Build::ENV_KEYS.include?(k) && ! @keys.include?(k) } @keys end end
Do not remove :os if multi-os feature is enabled This should let travis-web display the 'os' value in the matrix
travis-ci_travis-core
train
rb
7c49a19fd605f081fddc6d2fa2b76fbf50ad49ed
diff --git a/src/DataGrid.php b/src/DataGrid.php index <HASH>..<HASH> 100644 --- a/src/DataGrid.php +++ b/src/DataGrid.php @@ -2386,7 +2386,7 @@ class DataGrid extends Nette\Application\UI\Control /** - * @return InlineAdd + * @return InlineEdit */ public function addInlineAdd() { @@ -2401,7 +2401,7 @@ class DataGrid extends Nette\Application\UI\Control /** - * @return inlineAdd|null + * @return InlineEdit|null */ public function getInlineAdd() {
Fix annotation of addInlineAdd and getInlineAdd There's no InlineAdd class.
contributte_datagrid
train
php
2069a42ce24d3b09b9fdea88afa2dea322636032
diff --git a/src/main/java/water/parser/ParseDataset.java b/src/main/java/water/parser/ParseDataset.java index <HASH>..<HASH> 100644 --- a/src/main/java/water/parser/ParseDataset.java +++ b/src/main/java/water/parser/ParseDataset.java @@ -283,12 +283,13 @@ public final class ParseDataset extends Job { static final void onProgress(final Key chunk, final Key progress) { assert progress != null; + Value val = DKV.get(chunk); + if( val == null ) return; + final long len = val.length(); new TAtomic<Progress>() { @Override public Progress atomic(Progress old) { if( old == null ) return null; - Value val = DKV.get(chunk); - if( val == null ) return null; - old._value += val.length(); + old._value += len; return old; } }.fork(progress);
Do not load the chunk on the Progress key's home, just to get it's length
h2oai_h2o-2
train
java
96fb8908c6591fa0c4050fed31719d96b8168e5a
diff --git a/wagtailmenus/models/menus.py b/wagtailmenus/models/menus.py index <HASH>..<HASH> 100644 --- a/wagtailmenus/models/menus.py +++ b/wagtailmenus/models/menus.py @@ -97,8 +97,9 @@ class Menu(object): @property def pages_for_display(self): - raise NotImplementedError("Subclasses of `Menu` must define their own " - "'pages_for_display' method") + raise NotImplementedError( + "Subclasses of 'Menu' must define their own 'pages_for_display' " + "method") @cached_property def page_children_dict(self): @@ -257,6 +258,11 @@ class MenuWithMenuItems(ClusterableModel, Menu): def pages_for_display(self): return self.get_pages_for_display() + def get_menu_items_manager(self): + raise NotImplementedError( + "Subclasses of 'MenuWithMenuItems' must define their own " + "'get_menu_items_manager' method") + def add_menu_items_for_pages(self, pagequeryset=None, allow_subnav=True): """Add menu items to this menu, linking to each page in `pagequeryset` (which should be a PageQuerySet instance)"""
Because 'add_menu_items_for_pages' references 'get_menu_items_manager', that method should exist on the same class, but with a NotImplementedError notice
rkhleics_wagtailmenus
train
py
c4243e709a65e84795b380069b905606a12758d9
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -74,6 +74,7 @@ setup( 'zc.customdoctests>=1.0.1'], sqlalchemy=['sqlalchemy>=1.0.0'] ), + python_requires='>=2.7', install_requires=requirements, package_data={'': ['*.txt']}, classifiers=[
Add python_requires entry to setup.py This will allow us to drop support for python <I> in future version. People using python <I> and a recent version of `pip` will then simply get the old version. (Instead of the newest, which would likely fail)
crate_crate-python
train
py
ae9c275cc5a232ad51ac370f5abfb9964b38fbf7
diff --git a/rulesets.go b/rulesets.go index <HASH>..<HASH> 100644 --- a/rulesets.go +++ b/rulesets.go @@ -169,6 +169,7 @@ type RulesetRuleActionParameters struct { URI *RulesetRuleActionParametersURI `json:"uri,omitempty"` Headers map[string]RulesetRuleActionParametersHTTPHeader `json:"headers,omitempty"` Products []string `json:"products,omitempty"` + Phases []string `json:"phases,omitempty"` Overrides *RulesetRuleActionParametersOverrides `json:"overrides,omitempty"` MatchedData *RulesetRuleActionParametersMatchedData `json:"matched_data,omitempty"` Version string `json:"version,omitempty"`
rulesets: add support for ActionParameters.Phases
cloudflare_cloudflare-go
train
go
87e1ba1d1bba7b14f0d04b33c21b8d074e5d0a29
diff --git a/lessc.inc.php b/lessc.inc.php index <HASH>..<HASH> 100644 --- a/lessc.inc.php +++ b/lessc.inc.php @@ -57,9 +57,10 @@ class lessc{ unset( $this->registeredVars[$name] ); } - public function parse($buffer){ + public function parse($buffer, $presets = array()){ $options = array(); - + $this->setVariables($presets); + switch($this->formatterName){ case 'compressed': $options['compress'] = true;
Improved compatibility for Assetic LessphpFilter.
oyejorge_less.php
train
php
7fee9db7df7251876e09757246c2e82ea08b7840
diff --git a/angular-toggle-switch.js b/angular-toggle-switch.js index <HASH>..<HASH> 100644 --- a/angular-toggle-switch.js +++ b/angular-toggle-switch.js @@ -24,7 +24,7 @@ angular.module('toggle-switch', ['ng']).directive('toggleSwitch', function () { }); attrs.$observe('disabled', function(val) { - $scope.disabled = angular.isDefined(val) ? true : false + $scope.disabled = angular.isDefined(val) ? true : false; }); $scope.toggle = function toggle() {
chore: Add semicolon at end of line
cgarvis_angular-toggle-switch
train
js
b555950198f813dbd7370af967400a5c9e05a7a7
diff --git a/rb/spec/integration/selenium/webdriver/keyboard_spec.rb b/rb/spec/integration/selenium/webdriver/keyboard_spec.rb index <HASH>..<HASH> 100644 --- a/rb/spec/integration/selenium/webdriver/keyboard_spec.rb +++ b/rb/spec/integration/selenium/webdriver/keyboard_spec.rb @@ -28,7 +28,7 @@ module Selenium driver.keyboard.send_keys "ab" driver.keyboard.release :shift - event_input.value.should == "AB" + event_input.attribute(:value).should == "AB" keylogger.text.should == "focus keydown keydown keypress keyup keydown keypress keyup keyup" end
JariBakken: Missed one usage of Element#value in the specs. r<I>
SeleniumHQ_selenium
train
rb
00e8284dd9dbd0d6c61f336c9949b4493f4d02d8
diff --git a/lib/falkorlib/version.rb b/lib/falkorlib/version.rb index <HASH>..<HASH> 100644 --- a/lib/falkorlib/version.rb +++ b/lib/falkorlib/version.rb @@ -19,7 +19,7 @@ module FalkorLib #:nodoc: # MAJOR: Defines the major version # MINOR: Defines the minor version # PATCH: Defines the patch version - MAJOR, MINOR, PATCH = 0, 7, 0 + MAJOR, MINOR, PATCH = 0, 7, 1 module_function
bump to version '<I>'
Falkor_falkorlib
train
rb
821c59442c3081c15213ecfc6cf30ffe11bd3d7b
diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDescription.java b/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDescription.java index <HASH>..<HASH> 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDescription.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDescription.java @@ -8065,7 +8065,7 @@ public interface TypeDescription extends TypeDefinition, ByteCodeElement, TypeVa try { MethodDescription.InDefinedShape enclosingMethod = getEnclosingMethod(); return enclosingMethod != null && enclosingMethod.isGenerified(); - } catch (Throwable ignored) { // Avoid exception in case of an illegal generic declaration. + } catch (Throwable ignored) { // Avoid exception in case of an illegal declaration. return false; } }
Avoid exception in case of an illegal generic declaration.
raphw_byte-buddy
train
java
8a7e9bc99715875ef9550359857ed239ced34bf8
diff --git a/settings/blt.settings.php b/settings/blt.settings.php index <HASH>..<HASH> 100644 --- a/settings/blt.settings.php +++ b/settings/blt.settings.php @@ -66,7 +66,7 @@ if ($ip) { $repo_root = dirname(DRUPAL_ROOT); if (!isset($site_path)) { - $site_path = Drupal::service('site.path'); + $site_path = \Drupal::service('site.path'); } $site_dir = str_replace('sites/', '', $site_path); diff --git a/settings/misc.settings.php b/settings/misc.settings.php index <HASH>..<HASH> 100644 --- a/settings/misc.settings.php +++ b/settings/misc.settings.php @@ -32,7 +32,7 @@ $settings['hash_salt'] = file_get_contents(DRUPAL_ROOT . '/../salt.txt'); * custom code that changes the container, changing this identifier will also * allow the container to be invalidated as soon as code is deployed. */ -$settings['deployment_identifier'] = Drupal::VERSION; +$settings['deployment_identifier'] = \Drupal::VERSION; $deploy_id_file = DRUPAL_ROOT . '/../deployment_identifier'; if (file_exists($deploy_id_file)) { $settings['deployment_identifier'] = file_get_contents($deploy_id_file);
Standardize on \Drupal instead of Drupal. (#<I>)
acquia_blt
train
php,php
1792992208612c5f623a9a1d47d53f4248e741a3
diff --git a/src/com/google/javascript/jscomp/CompilationLevel.java b/src/com/google/javascript/jscomp/CompilationLevel.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/CompilationLevel.java +++ b/src/com/google/javascript/jscomp/CompilationLevel.java @@ -178,7 +178,7 @@ public enum CompilationLevel { options.setRemoveAbstractMethods(true); options.setReserveRawExports(true); options.setRenamingPolicy(VariableRenamingPolicy.ALL, PropertyRenamingPolicy.ALL_UNQUOTED); - options.setShadowVariables(true); + options.setShadowVariables(false); options.setRemoveUnusedPrototypeProperties(true); options.setRemoveUnusedPrototypePropertiesInExterns(false); options.setRemoveUnusedClassProperties(true);
Disable shadowVariables by default. The logic for this pass does not scale to larger projects and shows marginal benefit (customers have reported very little or no benefit). ------------- Created by MOE: <URL>
google_closure-compiler
train
java
a6a6c25a3855b45ad9991e30de32d623206bf7e8
diff --git a/lib/cucumber/rb_support/rb_world.rb b/lib/cucumber/rb_support/rb_world.rb index <HASH>..<HASH> 100644 --- a/lib/cucumber/rb_support/rb_world.rb +++ b/lib/cucumber/rb_support/rb_world.rb @@ -97,7 +97,7 @@ module Cucumber # Even though they won't be output until later, converting the messages to # strings right away will protect them from modifications to their original # objects in the mean time - messages.collect! { |message| message.to_s } + messages.collect! { |message| "#{message}" } @__cucumber_runtime.puts(*messages) end
Yet better bug fix. #to_s won't work because it will simply return the original string if called on a String object, thus not achieving the point of the bug fix, which is to obtain a new copy of the object.
cucumber_cucumber-ruby
train
rb
fea79b5b783b0f1f4b83fb8a06180dc63eebfab2
diff --git a/src/Leevel/Di/Container.php b/src/Leevel/Di/Container.php index <HASH>..<HASH> 100644 --- a/src/Leevel/Di/Container.php +++ b/src/Leevel/Di/Container.php @@ -869,21 +869,15 @@ class Container implements IContainer, ArrayAccess */ protected function parseClosureReflection(Closure $injection): array { - $reflection = new ReflectionFunction($injection); - - return $reflection->getParameters(); + return (new ReflectionFunction($injection))->getParameters(); } /** * 解析数组回调反射参数. - * - * @param array|callback $injection */ protected function parseMethodReflection(callable $injection): array { - $reflection = new ReflectionMethod($injection[0], $injection[1]); - - return $reflection->getParameters(); + return (new ReflectionMethod($injection[0], $injection[1]))->getParameters(); } /**
fix(di): fix for phpstan level 2
hunzhiwange_framework
train
php
ef101267613cc72f16d236e3205b6bad566e2d45
diff --git a/libraries/common/actions/app/handleLink.js b/libraries/common/actions/app/handleLink.js index <HASH>..<HASH> 100644 --- a/libraries/common/actions/app/handleLink.js +++ b/libraries/common/actions/app/handleLink.js @@ -7,7 +7,7 @@ import { /** * @param {Object} payload The link payload. - * @param {boolean} fromPushMessage Wether the function was called for a push message + * @param {boolean} allowExternalLinks Wether the function should open external links or should try to convert them to internal links * @return {Function} */ export default function handleLink(payload, allowExternalLinks = false) {
Update libraries/common/actions/app/handleLink.js
shopgate_pwa
train
js
99680e25795f1a2c7fa74c4a8943b83e38795fcc
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -110,7 +110,7 @@ DATASET_FILES = [ DATASET_EXTRAS = { # In alphabetical order 'aflw2k3d': ['scipy'], - 'c4': ['langdetect', 'nltk', 'tldextract'], + 'c4': ['apache_beam', 'langdetect', 'nltk', 'tldextract'], 'cats_vs_dogs': ['matplotlib'], 'colorectal_histology': ['Pillow'], 'eurosat': ['scikit-image',],
Add apache_beam as a dep for C4. PiperOrigin-RevId: <I>
tensorflow_datasets
train
py
b4ef444c169162fb6909e41a62311719714d8d88
diff --git a/lib/battle_boats/board.rb b/lib/battle_boats/board.rb index <HASH>..<HASH> 100644 --- a/lib/battle_boats/board.rb +++ b/lib/battle_boats/board.rb @@ -13,12 +13,13 @@ module BattleBoats def place_ships_randomly @fleet.ships.each do |ship| - orientation = ["horizontal", "vertical"].shuffle - if orientation == "horizontal" - until place_ship_horizontally(coordinate: get_random_coordinate, ship: ship) - end - else - until place_ship_vertically(coordinate: get_random_coordinate, ship: ship) + until ship_deployed?(ship) + coordinate = get_random_coordinate + orientation = [:horizontal, :vertical].sample + if orientation == :horizontal + place_ship_horizontally(coordinate: coordinate, ship: ship) + elsif orientation == :vertical + place_ship_vertically(coordinate: get_random_coordinate, ship: ship) end end end @@ -78,6 +79,10 @@ module BattleBoats coordinate.row.between?(0, 9) && coordinate.column.between?(0, 9) end + def ship_deployed?(ship) + play_area.flatten.map(&:occupant).include?(ship) + end + def occupy_cells(cells:, ship:) if cells_are_occupiable(cells: cells) cells.each do |cell|
add method to check if ship is in play area
Thomascountz_battle_boats
train
rb
0105ad99dc266e72ccb9bdc276aaedf3723c5db5
diff --git a/lib/endpoint-with-defaults.js b/lib/endpoint-with-defaults.js index <HASH>..<HASH> 100644 --- a/lib/endpoint-with-defaults.js +++ b/lib/endpoint-with-defaults.js @@ -1,6 +1,7 @@ module.exports = endpointWithDefaults const merge = require('deepmerge') +const isPlainObject = require('is-plain-object') const urlTemplate = require('url-template') const addQueryParameters = require('./add-query-parameters') @@ -23,7 +24,7 @@ function endpointWithDefaults (defaults, route, options) { }, {}) } - options = merge.all([defaults, options].filter(Boolean)) + options = merge.all([defaults, options].filter(Boolean), { isMergeableObject: isPlainObject }) // https://fetch.spec.whatwg.org/#methods let method = options.method.toUpperCase() @@ -75,9 +76,11 @@ function endpointWithDefaults (defaults, route, options) { } // Only return body/request keys if present - return Object.assign( + const funk = Object.assign( { method, url, headers }, typeof body !== 'undefined' ? { body } : null, options.request ? { request: options.request } : null ) + + return funk }
fix: only merge simple objects (e.g. keep options.request.agent instance intact)
octokit_endpoint.js
train
js
201c77cff5c2ef9217671b50917c3dd741a59bab
diff --git a/wampy/message_handler.py b/wampy/message_handler.py index <HASH>..<HASH> 100644 --- a/wampy/message_handler.py +++ b/wampy/message_handler.py @@ -38,9 +38,6 @@ class MessageHandler(object): self.messages = {} self._configure_messages() - def __call__(self, *args, **kwargs): - return self.handle_message(*args, **kwargs) - def _configure_messages(self): messages = self.messages for message in self.messages_to_handle: diff --git a/wampy/peers/clients.py b/wampy/peers/clients.py index <HASH>..<HASH> 100644 --- a/wampy/peers/clients.py +++ b/wampy/peers/clients.py @@ -100,7 +100,7 @@ class Client(object): def process_message(self, message): logger.info( "%s processing %s", self.name, MESSAGE_TYPE_MAP[message[0]]) - self.message_handler(message) + self.message_handler.handle_message(message) @property def call(self):
simplify handle message call and make more readable
noisyboiler_wampy
train
py,py
d7735a6361a84d9cc623aba46500a6a2aae94d2f
diff --git a/gromacs/fileformats/xvg.py b/gromacs/fileformats/xvg.py index <HASH>..<HASH> 100644 --- a/gromacs/fileformats/xvg.py +++ b/gromacs/fileformats/xvg.py @@ -20,7 +20,7 @@ data (typically: first column time, further coliumns scalar observables). Errors -====== +------ The :attr:`XVG.error` attribute contains the statistical error for each timeseries. It is computed from the standard deviation of the @@ -32,7 +32,7 @@ for the calculations of the correlation time are set with Plotting -======== +-------- The :meth:`XVG.plot` and :meth:`XVG.errorbar` methods are set up to produce graphs of multiple columns simultaneously. It is also possible @@ -60,7 +60,7 @@ For simple test data, both approaches give very similar output. .. SeeAlso:: :meth:`XVG.decimate` Example -======= +------- In this example we generate a noisy time series of a sine wave. We store the time, the value, and an error. (In a real example, the @@ -111,7 +111,7 @@ column 1) is fixed to "mean" but the errors (typically columns 2 and Classes -======= +------- .. autoclass:: XVG :members:
reST: fixed headings in XVG docs
Becksteinlab_GromacsWrapper
train
py
aa2c3a57ac2340c957b9e3a95f532ab6d3afbb4b
diff --git a/kaminari-activerecord/lib/kaminari/activerecord.rb b/kaminari-activerecord/lib/kaminari/activerecord.rb index <HASH>..<HASH> 100644 --- a/kaminari-activerecord/lib/kaminari/activerecord.rb +++ b/kaminari-activerecord/lib/kaminari/activerecord.rb @@ -1,8 +1,2 @@ require "kaminari/activerecord/version" require 'kaminari/activerecord/railtie' - -module Kaminari - module Activerecord - # Your code goes here... - end -end
:put_litter_in_its_place:
kaminari_kaminari
train
rb
a5bcbe1da7bc718d2a38b205e3267ec03c27ad45
diff --git a/rah_cache.php b/rah_cache.php index <HASH>..<HASH> 100644 --- a/rah_cache.php +++ b/rah_cache.php @@ -139,6 +139,8 @@ class rah_cache { return false; } + $f = $rah_cache['path'] . '/' . $f; + unlink($f . '.rah'); unlink($f . '.rah.gz'); } @@ -146,12 +148,11 @@ class rah_cache { return true; } - foreach(glob( $rah_cache['path'] . '/' . '*', GLOB_NOSORT) as $file) { + foreach(glob($rah_cache['path'].'/*', GLOB_NOSORT) as $file) { if(is_file($file) && strlen(basename($file)) == 32) { unlink($file); } } - } } ?> \ No newline at end of file
Tries to flush the wrong file.
gocom_rah_cache
train
php
9ecf289924ffcbc4999280039131f32b9a6bb60d
diff --git a/phonopy/structure/grid_points.py b/phonopy/structure/grid_points.py index <HASH>..<HASH> 100644 --- a/phonopy/structure/grid_points.py +++ b/phonopy/structure/grid_points.py @@ -399,6 +399,8 @@ class GridPoints: is_time_reversal=is_time_reversal, is_dense=True, ) + # uintp to int_ + grid_mapping_table = np.array(grid_mapping_table, dtype="int_") # Currently 'intc', but will be 'int_' in next major version. if int(__version__.split(".")[0]) < 3:
Cast grid_mapping_table from uintp to int_
atztogo_phonopy
train
py
6d81f730e7617f23ba30a74830c2e5e0d95888e9
diff --git a/unyt/tests/test_units.py b/unyt/tests/test_units.py index <HASH>..<HASH> 100644 --- a/unyt/tests/test_units.py +++ b/unyt/tests/test_units.py @@ -796,5 +796,9 @@ def test_percent(): def test_equal_has_same_hash(): a = Unit("m") b = Unit("m") + c = Unit("m*s/s") + assert a == b + assert b == c assert hash(a) == hash(b) + assert hash(b) == hash(c)
add test for un-simplified units?
yt-project_unyt
train
py
8ccc8cdc36cf21432e2ea0e520428faee486114b
diff --git a/reader.go b/reader.go index <HASH>..<HASH> 100644 --- a/reader.go +++ b/reader.go @@ -137,7 +137,11 @@ func (r *Reader) Next() (os.FileInfo, error) { r.queue.Dequeue() } - if drecord.IsDir() && drecord.fileID != "" { + if drecord.fileID == "" { + return r.Next() + } + + if drecord.IsDir() { r.queue.Enqueue(drecord) } else { drecord.image = r.image
Do not return empty named files or directories
hooklift_iso9660
train
go
42c1ce65e9507ef9267feadfa34da02e82409b13
diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactory.java index <HASH>..<HASH> 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactory.java @@ -97,6 +97,7 @@ public class NettyReactiveWebServerFactory extends AbstractReactiveWebServerFact if (getCompression() != null && getCompression().getEnabled()) { options.compression(getCompression().getMinResponseSize()); } + options.preferNative(false); applyCustomizers(options); }).build(); }
Disable Reactor Netty's use of kqueue/epoll There is a suspicion that the use of epoll is causing the intermittent failures being tracked by gh-<I>. This commit disables the use of epoll to see if it improves the situation. See gh-<I>
spring-projects_spring-boot
train
java
ba238b4ff66ea59e56bbd60d998c1df1d2ceb2aa
diff --git a/src/share/classes/com/sun/tools/apt/util/Bark.java b/src/share/classes/com/sun/tools/apt/util/Bark.java index <HASH>..<HASH> 100644 --- a/src/share/classes/com/sun/tools/apt/util/Bark.java +++ b/src/share/classes/com/sun/tools/apt/util/Bark.java @@ -87,7 +87,7 @@ public class Bark extends Log { context.put(barkKey, this); // register additional resource bundle for APT messages. - Messages aptMessages = new Messages(Messages.getDefaultBundle()); + Messages aptMessages = Messages.instance(context); aptMessages.add("com.sun.tools.apt.resources.apt"); aptDiags = new JCDiagnostic.Factory(aptMessages, "apt");
<I>: broken message file for annotation processing Summary: Regression in sqe test introduced in <I> Reviewed-by: jjg
wmdietl_jsr308-langtools
train
java
430ddddc97cf94d2b7e9d7ff1d6f5f707bbb22fc
diff --git a/src/primitives/IllustrationPrimitive/index.js b/src/primitives/IllustrationPrimitive/index.js index <HASH>..<HASH> 100644 --- a/src/primitives/IllustrationPrimitive/index.js +++ b/src/primitives/IllustrationPrimitive/index.js @@ -35,6 +35,7 @@ export const StyledImage = styled.img.attrs(({ theme, size, illustrationName }) max-width: 100%; background-color: ${({ theme }) => theme.orbit.backgroundIllustration}; margin-bottom: ${getSpacingToken}; + flex-shrink: 0; `; StyledImage.defaultProps = {
fix(IllustrationPrimitive): defaulting flex shrink to false (#<I>) There is a issue when Illustration has a parent with flex properties, causing it to shrink unnecessary. The issue was spotted on Firefox, but not on Chrome, so browsers seem to behave inconsistently when it comes to flex items with `max-width`.
kiwicom_orbit-components
train
js
4809b16f56b83739681c5b092329fef626cbc543
diff --git a/playem-youtube.js b/playem-youtube.js index <HASH>..<HASH> 100644 --- a/playem-youtube.js +++ b/playem-youtube.js @@ -51,10 +51,13 @@ function YoutubePlayer(){ Player.prototype.safeCall = function(fctName, param) { try { - this.element[fctName](param); + var args = Array.apply(null, arguments).slice(1), // exclude first arg (fctName) + fct = (this.element || {})[fctName]; + //console.log(fctName, args, this.element) + fct && fct.apply(this.element, args); } catch(e) { - console.error("YT safecall error", e.stack); + console.error("YT safecall error", e, e.stack); } } @@ -158,8 +161,7 @@ function YoutubePlayer(){ }; Player.prototype.setTrackPosition = function(pos) { - if (this.element && this.element.seekTo) - this.element.seekTo(pos, true); + this.safeCall("seekTo", pos, true); }; Player.prototype.setVolume = function(vol) {
using new safecall() implementation in setTrackPosition() // because it failed sometimes on safari
adrienjoly_playemjs
train
js
d47a2389a3b18b4be1da76a799203026117d0a52
diff --git a/lib/deferred.js b/lib/deferred.js index <HASH>..<HASH> 100644 --- a/lib/deferred.js +++ b/lib/deferred.js @@ -60,12 +60,16 @@ end = function (handler) { }; module.exports = deferred = function () { - var o = { pending: [] }; + var o = { pending: [] } + , promise = then.bind(o); + o.timeout = setTimeout(noop, Infinity); + promise.then = promise; + promise.end = end.bind(o); return { resolve: resolve.bind(o), - promise: { then: then.bind(o), end: end.bind(o) } + promise: promise }; };
deferred.promise is now 'then' function
medikoo_deferred
train
js
8f49c17813c2bf37b5b39ebd0ae7ba1de2c32e51
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import sys if not sys.version_info[0] == 3 and sys.version_info[1] < 5: sys.exit('Python < 3.5 is not supported') -version = '0.55' +version = '0.60' setup( name='steampy',
Update version to <I>, this breaks compatiblity, because method price_to_float is removed and replaced with parse_price
bukson_steampy
train
py
95b8dcc5411609afb7540df95958035bf4953fab
diff --git a/i18n/ro.js b/i18n/ro.js index <HASH>..<HASH> 100644 --- a/i18n/ro.js +++ b/i18n/ro.js @@ -42,7 +42,7 @@ export default { url: 'URL', bold: 'Bold', italic: 'Italic', - strikethrough: 'Strikethrough', + strikethrough: 'Tăiat', underline: 'Subliniat', unorderedList: 'Listă neordonată', orderedList: 'Listă ordonată',
Further i<I>n work
quasarframework_quasar
train
js
a49bf154ed142a5ea311104c1f2ea40ad12a7621
diff --git a/bundle/Controller/LayoutWizard.php b/bundle/Controller/LayoutWizard.php index <HASH>..<HASH> 100644 --- a/bundle/Controller/LayoutWizard.php +++ b/bundle/Controller/LayoutWizard.php @@ -57,9 +57,8 @@ final class LayoutWizard extends Controller $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { - $layout = $form->get('action')->getData() === LayoutWizardType::ACTION_TYPE_NEW_LAYOUT ? - $this->createNewLayout($form, $request) : + $this->createNewLayout($form, $request->getLocale()) : $this->copyLayout($form, $form->get('layout')->getData()); $wizardData = [ @@ -127,12 +126,12 @@ final class LayoutWizard extends Controller throw $exception; } - private function createNewLayout(FormInterface $form, Request $request): Layout + private function createNewLayout(FormInterface $form, string $locale): Layout { $createStruct = $this->layoutService->newLayoutCreateStruct( $this->layoutTypeRegistry->getLayoutType($form->get('layout_type')->getData()->getIdentifier()), $form->get('layout_name')->getData(), - $request->getLocale(), + $locale, ); $createStruct->description = $form->get('layout_description')->getData() ?? '';
Transfer locale when creating new layout in the wizard
netgen_NetgenAdminUIBundle
train
php
664d9935b15f26be84b471150561fe8efb85ed82
diff --git a/wisdom-api/src/main/java/org/wisdom/api/http/Results.java b/wisdom-api/src/main/java/org/wisdom/api/http/Results.java index <HASH>..<HASH> 100755 --- a/wisdom-api/src/main/java/org/wisdom/api/http/Results.java +++ b/wisdom-api/src/main/java/org/wisdom/api/http/Results.java @@ -106,6 +106,10 @@ public class Results { return status(Result.BAD_REQUEST).render(object); } + public static Result badRequest(String object) { + return status(Result.BAD_REQUEST).render(object).as(MimeTypes.TEXT); + } + public static Result noContent() { return status(Result.NO_CONTENT) .render(new NoHttpBody());
Ease the use of bad requests with a new method taking a String as parameter.
wisdom-framework_wisdom
train
java
c0456f5d99f0c62466e09cd7b64665ba8e3a8798
diff --git a/src/web-loaders.js b/src/web-loaders.js index <HASH>..<HASH> 100644 --- a/src/web-loaders.js +++ b/src/web-loaders.js @@ -5,7 +5,7 @@ var PrecompiledLoader = require('./precompiled-loader.js'); var WebLoader = Loader.extend({ init: function(baseURL, opts) { - this.baseURL = baseURL || ''; + this.baseURL = baseURL || '.'; // By default, the cache is turned off because there's no way // to "watch" templates over HTTP, so they are re-downloaded
Update web-loaders.js As declared in API docs (<URL>) baseURL is the URL to load templates from (must be the same domain), and it defaults to the current relative directory. But up to now it defaults to domain root. This is an update to ensure that it worked as expected.
mozilla_nunjucks
train
js
487d8df6b207f118cd8ab8f961ca9f6a62225ab1
diff --git a/integration-tests/lib/gem_installer.rb b/integration-tests/lib/gem_installer.rb index <HASH>..<HASH> 100644 --- a/integration-tests/lib/gem_installer.rb +++ b/integration-tests/lib/gem_installer.rb @@ -43,7 +43,20 @@ class GemInstaller puts "Must specify version of #{gem_name}" and return unless version puts "Installing #{gem_name} #{version}" installer = include_deps ? @installer : @no_deps_installer - installer.install( gem_name, version ) + + retry_count = 0 + begin + installer.install( gem_name, version ) + rescue Gem::RemoteFetcher::FetchError => e + retry_count += 1 + if retry_count > 5 + raise e + else + puts "Error fetching remote gem - sleeping and retrying" + sleep 1 + retry + end + end end
Be resilient to rubygems network errors during integs
torquebox_torquebox
train
rb
0ce09392926559936c42c9fbd99fe521d12a7ed6
diff --git a/lib/knapsack_pro/queue_allocator.rb b/lib/knapsack_pro/queue_allocator.rb index <HASH>..<HASH> 100644 --- a/lib/knapsack_pro/queue_allocator.rb +++ b/lib/knapsack_pro/queue_allocator.rb @@ -15,7 +15,9 @@ module KnapsackPro connection = KnapsackPro::Client::Connection.new(action) response = connection.call + # when attempt to connect to existing queue on API side failed because queue does not exist yet if can_initialize_queue && connection.success? && connection.api_code == KnapsackPro::Client::API::V1::Queues::CODE_ATTEMPT_CONNECT_TO_QUEUE_FAILED + # make attempt to initalize a new queue on API side action = build_action(can_initialize_queue, attempt_connect_to_queue: false) connection = KnapsackPro::Client::Connection.new(action) response = connection.call
add explanation why we do 2nd request
KnapsackPro_knapsack_pro-ruby
train
rb