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
75c964b4a54beb58281fe2190d2601f05254980f
diff --git a/src/Jobs/Contracts/Character/Contracts.php b/src/Jobs/Contracts/Character/Contracts.php index <HASH>..<HASH> 100644 --- a/src/Jobs/Contracts/Character/Contracts.php +++ b/src/Jobs/Contracts/Character/Contracts.php @@ -79,7 +79,7 @@ class Contracts extends AbstractAuthCharacterJob ]); if ($contracts->isCachedLoad() && - ContractDetail::where('character_id', $this->getCharacterId())->count() > 0) + CharacterContract::where('character_id', $this->getCharacterId())->count() > 0) return; collect($contracts)->each(function ($contract) {
fix(contracts): fix a typo in contract model call
eveseat_eveapi
train
php
d3e960134f97198f244873aa1ce66078947c3a89
diff --git a/cassandra/io/asyncorereactor.py b/cassandra/io/asyncorereactor.py index <HASH>..<HASH> 100644 --- a/cassandra/io/asyncorereactor.py +++ b/cassandra/io/asyncorereactor.py @@ -279,9 +279,6 @@ class AsyncoreLoop(object): if not self._thread: return - # The loop shouldn't be woken up from here onwards since it won't be running - self._loop_dispatcher._notified = True - log.debug("Waiting for event loop thread to join...") self._thread.join(timeout=1.0) if self._thread.is_alive(): @@ -293,10 +290,11 @@ class AsyncoreLoop(object): # Ensure all connections are closed and in-flight requests cancelled for conn in tuple(_dispatcher_map.values()): - conn.close() - # The event loop should be closed, so we call remaining asyncore.close - # callbacks from here + if conn is not self._loop_dispatcher: + conn.close() self._timers.service_timeouts() + # Once all the connections are closed, close the dispatcher + self._loop_dispatcher.close() log.debug("Dispatchers were closed")
Close dispatcher last when cleaning asyncore connections
datastax_python-driver
train
py
aef1acf84e0c74ac1ba01d822b8b444c4ac254cc
diff --git a/driver/src/test/java/org/neo4j/driver/v1/util/cc/ClusterRule.java b/driver/src/test/java/org/neo4j/driver/v1/util/cc/ClusterRule.java index <HASH>..<HASH> 100644 --- a/driver/src/test/java/org/neo4j/driver/v1/util/cc/ClusterRule.java +++ b/driver/src/test/java/org/neo4j/driver/v1/util/cc/ClusterRule.java @@ -40,7 +40,7 @@ public class ClusterRule extends ExternalResource // todo: should be possible to configure (dynamically add/remove) cores and read replicas private static final int CORE_COUNT = 3; - private static final int READ_REPLICA_COUNT = 1; + private static final int READ_REPLICA_COUNT = 2; public Cluster getCluster() {
Change the read-replica size to default to 2 again after the fix released in boltkit <I>
neo4j_neo4j-java-driver
train
java
91cd819554590865ae3bbf4a883b55c1475a5d32
diff --git a/lib/jsdom/level2/html.js b/lib/jsdom/level2/html.js index <HASH>..<HASH> 100644 --- a/lib/jsdom/level2/html.js +++ b/lib/jsdom/level2/html.js @@ -1295,11 +1295,8 @@ define('HTMLScriptElement', { return ret.join(""); }, set text(text) { - if (this.childNodes.length > 0) { - var l = this.childNodes.length, i; - for (i; i<l; i++) { - this.removeChild(this.childNodes[i]); - } + while (this.childNodes.length) { + this.removeChild(this.childNodes[0]); } this.appendChild(this._ownerDocument.createTextNode(text)); }
Fix for setting script element's text property.
jsdom_jsdom
train
js
a2ee780c7f02d9abe5dd80abf8404d3244aebd77
diff --git a/lib/rocket_pants/exceptions.rb b/lib/rocket_pants/exceptions.rb index <HASH>..<HASH> 100644 --- a/lib/rocket_pants/exceptions.rb +++ b/lib/rocket_pants/exceptions.rb @@ -106,6 +106,7 @@ module RocketPants register! :invalid_version, :http_status => :not_found register! :not_implemented, :http_status => :service_unavailable register! :not_found, :http_status => :not_found + register! :bad_request, :http_status => :bad_request end
Added :bad_request error. This is required for example when an API call is made and is missing required parameters...
Sutto_rocket_pants
train
rb
8f9e23b78d3f92742f45c03f6c2f6c33ce9868de
diff --git a/tchannel-core/src/main/java/com/uber/tchannel/handlers/RequestRouter.java b/tchannel-core/src/main/java/com/uber/tchannel/handlers/RequestRouter.java index <HASH>..<HASH> 100644 --- a/tchannel-core/src/main/java/com/uber/tchannel/handlers/RequestRouter.java +++ b/tchannel-core/src/main/java/com/uber/tchannel/handlers/RequestRouter.java @@ -251,14 +251,13 @@ public class RequestRouter extends SimpleChannelInboundHandler<Request> { private void doRequestEndProcessing() { if (span != null) { span.finish(); - TracingContext tracingContext = topChannel.getTracingContext(); - if (tracingContext.hasSpan()) { - tracingContext.popSpan(); // pop the span pushed by Tracing.startInboundSpan(...) - } } request.release(); } }, listeningExecutorService); // execute the callback asynchronously, not on the thread that resolves the future + if (span != null) { // if we pushed something on tracing context stack in Tracing.startInboundSpan(...) + topChannel.getTracingContext().popSpan(); // pop it + } return responseFuture; }
Fix trace context stack in async flow
uber_tchannel-java
train
java
0790a82825913cb077e3eb4f446023f46c3e931d
diff --git a/doc.go b/doc.go index <HASH>..<HASH> 100644 --- a/doc.go +++ b/doc.go @@ -135,6 +135,10 @@ providing a JSON API: w.Write(b) } +If you're writing a client that's supposed to mimic browser behavior, make sure to +send back the CSRF cookie (the default name is _gorilla_csrf, but this can be changed +with the CookieName Option) along with either the X-CSRF-Token header or the gorilla.csrf.Token form field. + In addition: getting CSRF protection right is important, so here's some background: * This library generates unique-per-request (masked) tokens as a mitigation
Update doc.go (#<I>)
gorilla_csrf
train
go
998db8ccbe83fd79774e0c9ce02b5926925a4a92
diff --git a/latlon_to_bng.py b/latlon_to_bng.py index <HASH>..<HASH> 100644 --- a/latlon_to_bng.py +++ b/latlon_to_bng.py @@ -4,7 +4,7 @@ Author: Hannah Fry http://www.hannahfry.co.uk/blog/2012/02/01/converting-latitude-and-longitude-to-british-national-grid """ from math import sqrt, pi, sin, cos, tan, atan2 -from numba import jit +from bng_to_latlon import jit # numba jit with fallback to dummy decorator if not installed @jit(nopython=True)
Import numba jit with fallback
fmalina_bng_latlon
train
py
4e6b09edd1d47b85085665fbf660bfc3cbe29f1f
diff --git a/salt/cloud/clouds/cloudstack.py b/salt/cloud/clouds/cloudstack.py index <HASH>..<HASH> 100644 --- a/salt/cloud/clouds/cloudstack.py +++ b/salt/cloud/clouds/cloudstack.py @@ -250,7 +250,7 @@ def create(vm_): { 'name': vm_['name'], 'profile': vm_['profile'], - 'provider': vm_['provider'], + 'provider': vm_['driver'], }, transport=__opts__['transport'] ) @@ -383,7 +383,7 @@ def create(vm_): { 'name': vm_['name'], 'profile': vm_['profile'], - 'provider': vm_['provider'], + 'provider': vm_['driver'], }, transport=__opts__['transport'] )
Fix CloudStack cloud for new 'driver' syntax
saltstack_salt
train
py
9cde54a08872489d12cbd8450457575e43fbe7c6
diff --git a/ipyrad/core/assembly.py b/ipyrad/core/assembly.py index <HASH>..<HASH> 100644 --- a/ipyrad/core/assembly.py +++ b/ipyrad/core/assembly.py @@ -1475,8 +1475,9 @@ def paramschecker(self, param, newvalue): elif param == 'barcodes_path': ## if a value was entered check that it exists if newvalue and not "Merged:" in newvalue: - fullbarpath = expander(newvalue) - + ## also allow for fuzzy match in names using glob + fullbarpath = glob.glob(expander(newvalue))[0] + ## raise error if file is not found if not os.path.exists(fullbarpath): raise IPyradWarningExit(""" Error: barcodes file not found. This must be an absolute path
allow for fuzzy match characters in barcode path
dereneaton_ipyrad
train
py
bedf37845ccd50c47ebbf8d7047a4fec401346d3
diff --git a/satpy/composites/config_loader.py b/satpy/composites/config_loader.py index <HASH>..<HASH> 100644 --- a/satpy/composites/config_loader.py +++ b/satpy/composites/config_loader.py @@ -21,7 +21,11 @@ import logging import warnings import yaml -from yaml import UnsafeLoader + +try: + from yaml import UnsafeLoader +except ImportError: + from yaml import Loader as UnsafeLoader from satpy import DatasetDict, DataQuery, DataID from satpy._config import (get_entry_points_config_dirs, config_search_paths,
Catch ImportError on UnsafeLoader
pytroll_satpy
train
py
a34e3c915fc4be39a7682c492f081b8b8b9633ba
diff --git a/andes/core/model.py b/andes/core/model.py index <HASH>..<HASH> 100644 --- a/andes/core/model.py +++ b/andes/core/model.py @@ -9,7 +9,6 @@ Base class for building ANDES models. # (at your option) any later version. # # File name: model.py -# Last modified: 8/16/20, 7:27 PM import logging import scipy as sp
Edits: removed file last-edit time as git tracks it.
cuihantao_andes
train
py
9c5a25b06069d721e452d8a023223757ce278e10
diff --git a/core/server/services/mega/template.js b/core/server/services/mega/template.js index <HASH>..<HASH> 100644 --- a/core/server/services/mega/template.js +++ b/core/server/services/mega/template.js @@ -954,7 +954,7 @@ ${ templateSettings.showBadge ? ` </tr> ${ templateSettings.showFeatureImage && post.feature_image ? ` <tr> - <td class="feature-image ${hasFeatureImageCaption ? 'feature-image-with-caption' : ''}"><img src="${post.feature_image}"${post.feature_image_width ? ` width="${post.feature_image_width}"` : ''} alt="${post.feature_image_alt}"></td> + <td class="feature-image ${hasFeatureImageCaption ? 'feature-image-with-caption' : ''}"><img src="${post.feature_image}"${post.feature_image_width ? ` width="${post.feature_image_width}"` : ''}${post.feature_image_alt ? ` alt="${post.feature_image_alt}"` : ''}></td> </tr> ` : ``} ${ hasFeatureImageCaption ? `
🐛 Fixed `alt="null"` for feature image in emails no issue - when no alt text was set for feature images we were incorrectly rendering `alt="null"` in emails
TryGhost_Ghost
train
js
5ef13fcb89f08b2763aed97fd92e59cbbb69f5b8
diff --git a/src/main/php/FunctionProxy.php b/src/main/php/FunctionProxy.php index <HASH>..<HASH> 100644 --- a/src/main/php/FunctionProxy.php +++ b/src/main/php/FunctionProxy.php @@ -95,9 +95,9 @@ abstract class FunctionProxy implements Proxy } /** - * handles actual method calls + * handles actual function calls * - * @param mixed[] $arguments list of given arguments for methods + * @param mixed[] $arguments list of given arguments for function * @return mixed */ protected function handleFunctionCall(array $arguments)
it's about functions, not methods
bovigo_callmap
train
php
b4f3e9029c34215f88a79d973a6ca24e7e0143bf
diff --git a/lib/less/parser.js b/lib/less/parser.js index <HASH>..<HASH> 100644 --- a/lib/less/parser.js +++ b/lib/less/parser.js @@ -370,7 +370,7 @@ less.parser = { if (key = $(/[a-z]+/g) || $(this.entities.string)) { if ((op = $(/[|~*$^]?=/g)) && (val = $(this.entities.string) || $(/[\w-]+/g))) { - attr = [key, op, val].join(''); + attr = [key, op, val.toCSS ? val.toCSS() : val].join(''); } else { attr = key } }
output strings in attribute selectors properly
less_less.js
train
js
cdebf5d266d9d3569abe165ee6b4b64628ce813c
diff --git a/compile.js b/compile.js index <HASH>..<HASH> 100644 --- a/compile.js +++ b/compile.js @@ -27,7 +27,7 @@ exports = module.exports = function compileFile(file, contents, traceurOverrides return { source: result, - errors: null, + error: null, sourcemap: sourceMap ? JSON.parse(sourceMap) : null }; };
Use `error` in both cases, instead of `errors` sometimes
thlorenz_es6ify
train
js
cb1a0baf661ab9a8a3b4a3d6db5465c4447f37fc
diff --git a/lib/ronin/ui/command_line/command.rb b/lib/ronin/ui/command_line/command.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/ui/command_line/command.rb +++ b/lib/ronin/ui/command_line/command.rb @@ -57,13 +57,19 @@ module Ronin exit end - desc "help", "displays the help for the command" + desc "help [TASK]", "displays the help for the command" # # Prints the help information for the command and exists. # - def help - self.class.help(shell, :short => true, :ident => 2, :namespace => false) + def help(task=nil) + self.class.help( + shell, + task, + :short => true, + :ident => 2, + :namespace => "ronin:#{self.name}" + ) end protected
Allow the help task to receive a method-name and specify the namespace to use.
ronin-ruby_ronin
train
rb
0c4e9ce59feeb243c5497311b3e85b755d293269
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -62,7 +62,7 @@ setup( description='Let the user secure his session for usage in public computers', author='James Pic', author_email='[email protected]', - url='https://github.com/yourlabs/django-session-expiry', + url='https://github.com/yourlabs/django-session-security', packages=find_packages(), include_package_data=True, zip_safe=False,
Fixed wrong url in setup.py
yourlabs_django-session-security
train
py
2b269cf611ec1428a42ee1d80e9b05f7cbbcc5f7
diff --git a/app/examples/custom/resize-table/index.js b/app/examples/custom/resize-table/index.js index <HASH>..<HASH> 100644 --- a/app/examples/custom/resize-table/index.js +++ b/app/examples/custom/resize-table/index.js @@ -21,7 +21,12 @@ vis.on('resize', () => { console.log(`resize event: ${vis.width}, ${vis.height}`); }); -window.setInterval(() => { - document.getElementById('containing-table').style.width = (500 + Math.floor(Math.random() * 500)) + 'px'; -}, 1000); +let callback = () => { + let table = document.getElementById('containing-table'); + if (table) { + table.style.width = (500 + Math.floor(Math.random() * 500)) + 'px'; + window.setTimeout(callback, 1000); + } +}; +callback();
Adding some logic to guard against leaving the resize-table example
Kitware_candela
train
js
33362a76a135589d8896d34b57d9f19e200f3c5e
diff --git a/redis/pool.go b/redis/pool.go index <HASH>..<HASH> 100644 --- a/redis/pool.go +++ b/redis/pool.go @@ -40,7 +40,7 @@ var errPoolClosed = errors.New("redigo: connection pool closed") // pool = &redis.Pool{ // MaxIdle: 3, // IdleTimeout: 240 * time.Second, -// Dial: func () (redis.Conn error) { +// Dial: func () (redis.Conn, error) { // c, err := redis.Dial("tcp", server) // if err != nil { // return nil, err
Fixed a small error in the pool creation example
gomodule_redigo
train
go
b16ce478b7233e636eb7666841c42b8d22887b07
diff --git a/test/lib/writable-stream.js b/test/lib/writable-stream.js index <HASH>..<HASH> 100644 --- a/test/lib/writable-stream.js +++ b/test/lib/writable-stream.js @@ -24,23 +24,33 @@ module.exports = function () { function MockWritableStream () { this.$store = ""; } + var proto = MockWritableStream.prototype; + proto.writeHead = function (status, /* msg, */ headers) { this.$status = status; this.$headers = headers; }; + proto.end = function (input) { - if (input) this.write(input); + if (input) { + this.write(input); + } this.$end = true; }; + proto.write = function (input) { - if (this.$end) throw new Error("Unable to write: closed."); + if (this.$end) { + throw new Error("Unable to write: closed."); + } + if (Buffer.isBuffer(input)) { this.$store += input.toString("utf8"); } else { this.$store += input; } }; - return new MockWritableStream; - } -} + + return new MockWritableStream(); + }; +};
Add semicolons and blocks to mock Writable Stream.
reid_onyx
train
js
dacf3f4ae8134230a9b9bf5ef8d297b87d21559e
diff --git a/DataHandling/DataHandling/DataHandling.py b/DataHandling/DataHandling/DataHandling.py index <HASH>..<HASH> 100644 --- a/DataHandling/DataHandling/DataHandling.py +++ b/DataHandling/DataHandling/DataHandling.py @@ -9,6 +9,22 @@ from mpl_toolkits.mplot3d.axes3d import Axes3D from matplotlib import rcParams import matplotlib.animation as _animation +def LoadData(Filepath): + """ + Parameters + ---------- + Filepath : string + filepath to the file containing the data used to initialise + and create an instance of the DataObject class + + Returns + ------- + Data : DataObject + An instance of the DataObject class contaning the data + that you requested to be loaded. + """ + return DataObject(Filepath) + class DataObject(): """ Creates an object containing data and all it's properties. @@ -55,10 +71,10 @@ class DataObject(): """ def __init__(self, filepath): """ - Parameters - ---------- - filepath : string - The filepath to the data file to initialise this object instance. + Parameters + ---------- + filepath : string + The filepath to the data file to initialise this object instance. Initialisation - assigns values to the following attributes: - filepath
added function called LoadData to load the data and create an instance of the dataobject class
AshleySetter_optoanalysis
train
py
9a974fa4796f12c82498ee707f2b328e96bcb560
diff --git a/lib/dynflow/action/flow_phase.rb b/lib/dynflow/action/flow_phase.rb index <HASH>..<HASH> 100644 --- a/lib/dynflow/action/flow_phase.rb +++ b/lib/dynflow/action/flow_phase.rb @@ -9,7 +9,7 @@ module Dynflow def initialize(attributes, world) super attributes, world - self.input = attributes[:input] + self.input = deserialize_references(attributes[:input]) self.output = attributes[:output] || {} end @@ -19,6 +19,23 @@ module Dynflow error: error end + def deserialize_references(value) + case value + when Hash + if value[:class] == "Dynflow::ExecutionPlan::OutputReference" + ExecutionPlan::OutputReference.new_from_hash(value) + else + value.reduce(HashWithIndifferentAccess.new) do |h, (key, val)| + h.update(key => deserialize_references(val)) + end + end + when Array + value.map { |val| deserialize_references(val) } + else + value + end + end + module ClassMethods def new_from_hash(hash, state, world) new(hash.merge(state: state), world)
tmp - Deserialize references: TODO: still missing tests
Dynflow_dynflow
train
rb
a09fc73810dc233e6a784d19000f32571a7eeaca
diff --git a/cmd/kube-controller-manager/app/core.go b/cmd/kube-controller-manager/app/core.go index <HASH>..<HASH> 100644 --- a/cmd/kube-controller-manager/app/core.go +++ b/cmd/kube-controller-manager/app/core.go @@ -115,7 +115,7 @@ func startNamespaceController(ctx ControllerContext) (bool, error) { return true, fmt.Errorf("failed to parse preferred server resources: %v", err) } discoverResourcesFn := namespaceKubeClient.Discovery().ServerPreferredNamespacedResources - if _, found := gvrs[extensions.SchemeGroupVersion.WithResource("thirdpartyresource")]; found { + if _, found := gvrs[extensions.SchemeGroupVersion.WithResource("thirdpartyresource")]; !found { // make discovery static snapshot, err := discoverResourcesFn() if err != nil {
make discovery static when extensions/thirdpartyresources is not enabled
kubernetes_kubernetes
train
go
1e73851b47ac2ab0301fbd3a02d741bf3d214bf4
diff --git a/pyecharts/charts/chart.py b/pyecharts/charts/chart.py index <HASH>..<HASH> 100644 --- a/pyecharts/charts/chart.py +++ b/pyecharts/charts/chart.py @@ -201,7 +201,7 @@ class Chart3D(Chart): def add( self, - name: str, + series_name: str, data: Sequence, opacity: Numeric = 1, shading: Optional[str] = None, @@ -233,7 +233,7 @@ class Chart3D(Chart): self.options.get("series").append( { "type": self._3d_chart_type, - "name": name, + "name": series_name, "data": data, "label": label_opts, "shading": shading,
Rename: name -> series_name
pyecharts_pyecharts
train
py
29e13014db6f489f00d44992bf6375e2342da410
diff --git a/lib/plugins/aws/deploy/lib/uploadArtifacts.js b/lib/plugins/aws/deploy/lib/uploadArtifacts.js index <HASH>..<HASH> 100644 --- a/lib/plugins/aws/deploy/lib/uploadArtifacts.js +++ b/lib/plugins/aws/deploy/lib/uploadArtifacts.js @@ -89,10 +89,10 @@ module.exports = { const functionArtifactFileName = this.provider.naming.getFunctionArtifactName(name); const functionObject = this.serverless.service.getFunction(name); functionObject.package = functionObject.package || {}; - const artifact = functionObject.package.artifact || + const artifactFilePath = functionObject.package.artifact || this.serverless.service.package.artifact; - if (!artifact || + if (!artifactFilePath || (this.serverless.service.artifact && !functionObject.package.artifact)) { if (this.serverless.service.package.individually || functionObject.package.individually) { const artifactFileName = functionArtifactFileName; @@ -101,7 +101,7 @@ module.exports = { return this.provider.naming.getServiceArtifactName(); } - return artifact; + return artifactFilePath; }) );
artifactFilePath makes more sense
serverless_serverless
train
js
2dfdaf6240be8ce3635437257a02356a9606b473
diff --git a/plugin/src/main/java/io/fabric8/maven/plugin/ResourceMojo.java b/plugin/src/main/java/io/fabric8/maven/plugin/ResourceMojo.java index <HASH>..<HASH> 100644 --- a/plugin/src/main/java/io/fabric8/maven/plugin/ResourceMojo.java +++ b/plugin/src/main/java/io/fabric8/maven/plugin/ResourceMojo.java @@ -487,7 +487,9 @@ public class ResourceMojo extends AbstractResourceMojo { // get a reference date private Date getBuildReferenceDate() throws MojoExecutionException { - if (goalFinder.runningWithGoal(project, session, "fabric8:build")) { + if (goalFinder.runningWithGoal(project, session, "fabric8:build") || + goalFinder.runningWithGoal(project, session, "fabric8:deploy") || + goalFinder.runningWithGoal(project, session, "fabric8:run")) { // we are running together with fabric8:build, but since fabric8:build is running later we // are creating the build date here which is reused by fabric8:build return new Date();
fixes #<I> so that we always regenerate the timestamp whenever we run `mvn fabric8:deploy` or `mvn fabric8:run`
fabric8io_fabric8-maven-plugin
train
java
74a7c5b732080e8827a22a19e42e0c2cfc778231
diff --git a/example_test.go b/example_test.go index <HASH>..<HASH> 100644 --- a/example_test.go +++ b/example_test.go @@ -10,7 +10,7 @@ import ( "github.com/go-humble/router" ) -func ExampleRoutes() { +func ExampleRouter_HandleFunc() { // Create a new Router object r := router.New() // Use HandleFunc to add routes.
Update example to be compatible with godoc
go-humble_router
train
go
7c03aef51f6f4ed8cfe848bd0f95c48f229830d5
diff --git a/internal/magic/magic.go b/internal/magic/magic.go index <HASH>..<HASH> 100644 --- a/internal/magic/magic.go +++ b/internal/magic/magic.go @@ -227,6 +227,7 @@ var VideoExtensions = map[string]bool{ "m1v": true, "m2v": true, "m4v": true, + "mkv": true, } // HasExtension returns whether the file extension of filename is among
internal/magic: add mkv as a known video extension Change-Id: Ifb<I>a<I>e7f1f6a9a<I>b9ffb<I>a<I>a<I>b1
perkeep_perkeep
train
go
534082e9c03b8c80754eff3d33a84b09a49b2e24
diff --git a/autobatch/autobatch.go b/autobatch/autobatch.go index <HASH>..<HASH> 100644 --- a/autobatch/autobatch.go +++ b/autobatch/autobatch.go @@ -36,6 +36,9 @@ func NewAutoBatching(d ds.Batching, size int) *Datastore { // Delete deletes a key/value func (d *Datastore) Delete(k ds.Key) error { d.buffer[k] = op{delete: true} + if len(d.buffer) > d.maxBufferEntries { + return d.Flush() + } return nil }
autobatch: don't forget to flush on delete
ipfs_go-datastore
train
go
1f721f2615f7a138379da2adc2e6b8ade81bc9e6
diff --git a/lib/clickfunnels_auth/version.rb b/lib/clickfunnels_auth/version.rb index <HASH>..<HASH> 100644 --- a/lib/clickfunnels_auth/version.rb +++ b/lib/clickfunnels_auth/version.rb @@ -1,3 +1,3 @@ module ClickfunnelsAuth - VERSION = "0.1.1" + VERSION = "0.1.2" end diff --git a/lib/omniauth/strategies/clickfunnels.rb b/lib/omniauth/strategies/clickfunnels.rb index <HASH>..<HASH> 100644 --- a/lib/omniauth/strategies/clickfunnels.rb +++ b/lib/omniauth/strategies/clickfunnels.rb @@ -20,7 +20,8 @@ module OmniAuth { :email => raw_info['email'], :admin => raw_info['admin'], - :member_level => raw_info['funnelflix_member_level'] + :member_level => raw_info['funnelflix_member_level'], + :accounts => raw_info['accounts'] } end
Added support for the users accounts that he/she has access to.
Etison_clickfunnels_auth
train
rb,rb
0be2f85ff694c088648184ed28dad90e48505d86
diff --git a/sniffy-core/src/main/java/io/sniffy/configuration/SniffyConfiguration.java b/sniffy-core/src/main/java/io/sniffy/configuration/SniffyConfiguration.java index <HASH>..<HASH> 100644 --- a/sniffy-core/src/main/java/io/sniffy/configuration/SniffyConfiguration.java +++ b/sniffy-core/src/main/java/io/sniffy/configuration/SniffyConfiguration.java @@ -60,7 +60,9 @@ public enum SniffyConfiguration { } public void setMonitorSocket(boolean monitorSocket) { - this.monitorSocket = monitorSocket; + if (!this.monitorSocket) { + this.monitorSocket = monitorSocket; + } } public boolean isFilterEnabled() {
Monitoring sockets requires all triggers to be enabled
sniffy_sniffy
train
java
3d777bb386fef50a077c1814bcb1a5f26ed1a964
diff --git a/pre_commit/color.py b/pre_commit/color.py index <HASH>..<HASH> 100644 --- a/pre_commit/color.py +++ b/pre_commit/color.py @@ -3,13 +3,13 @@ from __future__ import unicode_literals import os import sys -terminal_supports_colors = True +terminal_supports_color = True if os.name == 'nt': # pragma: no cover (windows) from pre_commit.color_windows import enable_virtual_terminal_processing try: enable_virtual_terminal_processing() except WindowsError: - terminal_supports_colors = False + terminal_supports_color = False RED = '\033[41m' GREEN = '\033[42m' @@ -30,7 +30,7 @@ def format_color(text, color, use_color_setting): color - The color start string use_color_setting - Whether or not to color """ - if not use_color_setting or not terminal_supports_colors: + if not use_color_setting: return text else: return '{}{}{}'.format(color, text, NORMAL) @@ -48,4 +48,7 @@ def use_color(setting): if setting not in COLOR_CHOICES: raise InvalidColorSetting(setting) - return setting == 'always' or (setting == 'auto' and sys.stdout.isatty()) + return ( + setting == 'always' or + (setting == 'auto' and sys.stdout.isatty() and terminal_supports_color) + )
Move logic to handle terminal not supporting colors to use_color
pre-commit_pre-commit
train
py
83d9ada5ea4c820ef7592862fd98d969d8e76b54
diff --git a/lib/flex/utils.rb b/lib/flex/utils.rb index <HASH>..<HASH> 100644 --- a/lib/flex/utils.rb +++ b/lib/flex/utils.rb @@ -22,7 +22,8 @@ module Flex end def erb_process(source) - ERB.new(File.read(source)).result + varname = "_flex_#{source.hash.to_s.tr('-', '_')}" + ERB.new(File.read(source), nil, nil, varname).result end def group_array_by(ary)
fix for jruby but triggered on Flex.reload! and ERB in template source
elastics_elastics
train
rb
3cf0ce251092727da8e680945c6aa99654b49156
diff --git a/src/dna-base-component.next.js b/src/dna-base-component.next.js index <HASH>..<HASH> 100644 --- a/src/dna-base-component.next.js +++ b/src/dna-base-component.next.js @@ -13,16 +13,6 @@ import { DNAAttributesComponent } from './dna-attributes-component.next.js'; */ export class DNABaseComponent extends DNAMixedComponent { /** - * Fires when an instance of the element is created. - */ - createdCallback() { - super.createdCallback(); - // Add scope style class - if (this.is) { - this.classList.add(this.is); - } - } - /** * A list of mixins. * @type {Array} */ diff --git a/src/dna-style-component.next.js b/src/dna-style-component.next.js index <HASH>..<HASH> 100644 --- a/src/dna-style-component.next.js +++ b/src/dna-style-component.next.js @@ -67,4 +67,14 @@ export class DNAStyleComponent extends DNAComponent { } return style; } + /** + * Fires when an instance of the element is created. + */ + createdCallback() { + super.createdCallback(); + // Add scope style class + if (this.is) { + this.classList.add(this.is); + } + } }
refactor: add css scoped class in `DNAStyleComponent` instaed of `DNABaseComponent`
chialab_dna
train
js,js
88130a5d7eec9e28c7e21a03e35170590e4bd0b6
diff --git a/airflow/www/app.py b/airflow/www/app.py index <HASH>..<HASH> 100644 --- a/airflow/www/app.py +++ b/airflow/www/app.py @@ -17,7 +17,7 @@ import six from flask import Flask from flask_admin import Admin, base -from flask_cache import Cache +from flask_caching import Cache from flask_wtf.csrf import CSRFProtect csrf = CSRFProtect() diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -208,7 +208,7 @@ def do_setup(): 'dill>=0.2.2, <0.3', 'flask>=0.11, <0.12', 'flask-admin==1.4.1', - 'flask-cache>=0.13.1, <0.14', + 'flask-caching>=1.3.3, <1.4.0', 'flask-login==0.2.11', 'flask-swagger==0.2.13', 'flask-wtf>=0.14, <0.15',
[AIRFLOW-<I>] Use flask-caching instead of flask-cache Flask-cache has been unmaintained for over three years, flask-caching is the community supported version. Closes #<I> from bolkedebruin/AIRFLOW-<I>
apache_airflow
train
py,py
db9e03c3dacbc154a4ae80d6525fe958518f2417
diff --git a/lib/airbrake/cli/project_factory.rb b/lib/airbrake/cli/project_factory.rb index <HASH>..<HASH> 100644 --- a/lib/airbrake/cli/project_factory.rb +++ b/lib/airbrake/cli/project_factory.rb @@ -2,15 +2,13 @@ require File.expand_path( "../project", __FILE__) # Responsible for creating projects when needed. # Creates them from XML received. class ProjectFactory + attr_reader :project, :projects + def initialize @project = Project.new @projects = [] end - def project - @project - end - def create_projects_from_xml(xml) xml.split("\n").each do |line| /<name[^>]*>(.*)<\/name>/ =~ line @@ -32,8 +30,4 @@ class ProjectFactory @project = Project.new end end - - def projects - @projects - end end
Use getters instead of handwriten methods
airbrake_airbrake
train
rb
a275016c81f2ac7796b829ac3197b29629e7a056
diff --git a/tests/modifiers/OrderModifierTest.php b/tests/modifiers/OrderModifierTest.php index <HASH>..<HASH> 100644 --- a/tests/modifiers/OrderModifierTest.php +++ b/tests/modifiers/OrderModifierTest.php @@ -57,7 +57,12 @@ class OrderModifierTest extends FunctionalTest // 408 from items + 10 from modifier + 25% from tax $this->assertEquals('522.5', $order->Total); - $this->assertEquals(array('10', '104.5'), $order->Modifiers()->column('Amount')); + $amounts = array(); + foreach ($order->Modifiers()->sort('Sort') as $modifier) { + $amounts[] = (string)$modifier->Amount; + } + + $this->assertEquals(array('10', '104.5'), $amounts); OrderModifierTest_TestModifier::$value = 42;
Attempt to fix the test that fails sometimes.
silvershop_silvershop-core
train
php
28a0e2621bbaeaee2c06d7acd9968846a04efc84
diff --git a/cmd/kube-apiserver/app/server.go b/cmd/kube-apiserver/app/server.go index <HASH>..<HASH> 100644 --- a/cmd/kube-apiserver/app/server.go +++ b/cmd/kube-apiserver/app/server.go @@ -536,7 +536,7 @@ func defaultOptions(s *options.ServerRunOptions) error { // This is the heuristics that from memory capacity is trying to infer // the maximum number of nodes in the cluster and set cache sizes based // on that value. - // From our documentation, we officially recomment 120GB machines for + // From our documentation, we officially recommend 120GB machines for // 2000 nodes, and we scale from that point. Thus we assume ~60MB of // capacity per node. // TODO: We may consider deciding that some percentage of memory will diff --git a/pkg/registry/cachesize/cachesize.go b/pkg/registry/cachesize/cachesize.go index <HASH>..<HASH> 100644 --- a/pkg/registry/cachesize/cachesize.go +++ b/pkg/registry/cachesize/cachesize.go @@ -73,7 +73,7 @@ func InitializeWatchCacheSizes(expectedRAMCapacityMB int) { // This is the heuristics that from memory capacity is trying to infer // the maximum number of nodes in the cluster and set cache sizes based // on that value. - // From our documentation, we officially recomment 120GB machines for + // From our documentation, we officially recommend 120GB machines for // 2000 nodes, and we scale from that point. Thus we assume ~60MB of // capacity per node. // TODO: Revisit this heuristics
Fix comment typo in kube-apiserver and cachesize
kubernetes_kubernetes
train
go,go
f5fad101931f8794959bd4361fe2730388d60866
diff --git a/vendor/src/github.com/golang/protobuf/proto/all_test.go b/vendor/src/github.com/golang/protobuf/proto/all_test.go index <HASH>..<HASH> 100644 --- a/vendor/src/github.com/golang/protobuf/proto/all_test.go +++ b/vendor/src/github.com/golang/protobuf/proto/all_test.go @@ -1281,7 +1281,9 @@ func TestEnum(t *testing.T) { // We don't care what the value actually is, just as long as it doesn't crash. func TestPrintingNilEnumFields(t *testing.T) { pb := new(GoEnum) - fmt.Sprintf("%+v", pb) + if fmt.Sprintf("%+v", pb) == "" { + t.Errorf("expected non-empty string") + } } // Verify that absent required fields cause Marshal/Unmarshal to return errors.
protobuf: workaround a go vet error vendor/src/github.com/golang/protobuf/proto/all_test.go:<I>: result of fmt.Sprintf call not used Do we really need to execute go vet for vendor? I don't find how to exclude them.
opencontainers_runc
train
go
daa2dfd2531294f827ba2e779ef8a76c5c6bf064
diff --git a/src/Reports/Report.php b/src/Reports/Report.php index <HASH>..<HASH> 100644 --- a/src/Reports/Report.php +++ b/src/Reports/Report.php @@ -296,7 +296,7 @@ class Report * @param $excepts * @return $this */ - private function except($excepts) + public function except($excepts) { $excepts = is_array($excepts) ? $excepts : func_get_args();
Changed visibility to public in Report Class except function.
Edujugon_laravel-google-ads
train
php
41cd37084134bc577346df129d49582546f2ebba
diff --git a/master/buildbot/test/unit/test_db_users.py b/master/buildbot/test/unit/test_db_users.py index <HASH>..<HASH> 100644 --- a/master/buildbot/test/unit/test_db_users.py +++ b/master/buildbot/test/unit/test_db_users.py @@ -429,6 +429,16 @@ class TestUsersConnectorComponent(connector_component.ConnectorComponentMixin, # the existing transaction) and executes a conflicting insert in that # connection. This will cause the insert in the db method to fail, and # the data in this insert (8.8.8.8) will appear below. + + if (self.db.pool.engine.dialect.name == 'sqlite' and + self.db.pool.engine.url.database not in [None, ':memory:']): + # It's not easy to work with file-based SQLite via multiple + # connections, because SQLAlchemy (in it's default configuration) + # locks file during working session. + # TODO: This probably can be supported. + raise unittest.SkipTest( + "It's hard to test race condition with not in-memory SQLite") + def race_thd(conn): conn = self.db.pool.engine.connect() conn.execute(self.db.model.users_info.insert(),
skip multiple connections to same DB when using file-based SQLite
buildbot_buildbot
train
py
5f7ddefdc80f23431a917e47e1953195ae9537e5
diff --git a/spec/support/factory_girl.rb b/spec/support/factory_girl.rb index <HASH>..<HASH> 100644 --- a/spec/support/factory_girl.rb +++ b/spec/support/factory_girl.rb @@ -1,6 +1,8 @@ require "factory_girl" RSpec.configure do |config| - config.include FactoryGirl::Syntax::Methods + FactoryGirl.factories.clear FactoryGirl.find_definitions + + config.include FactoryGirl::Syntax::Methods end \ No newline at end of file
Clear factories in spec_helper
cloudfoundry-attic_cfoundry
train
rb
97986a6842d1b154743c24f7c8e4fb84dd6f8595
diff --git a/autocomplete_utils.py b/autocomplete_utils.py index <HASH>..<HASH> 100644 --- a/autocomplete_utils.py +++ b/autocomplete_utils.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ## ## This file is part of Invenio. -## Copyright (C) 2013 CERN. +## Copyright (C) 2013, 2014 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as @@ -36,6 +36,20 @@ def kb_autocomplete(name, mapper=None): return inner +def kb_dynamic_autocomplete(name, mapper=None): + """Create an autocomplete function from dynamic knowledge base. + + :param name: Name of knowledge base + :param mapper: Function that will map an knowledge base entry to + autocomplete entry. + """ + def inner(dummy_form, dummy_field, term, limit=50): + from invenio.modules.knowledge.api import get_kbd_values + result = get_kbd_values(name, searchwith=term)[:limit] + return map(mapper, result) if mapper is not None else result + return inner + + def sherpa_romeo_publishers(dummy_form, dummy_field, term, limit=50): if term: sherpa_romeo = SherpaRomeoSearch()
deposit: addition of dynamic KB autocomplete func
inveniosoftware_invenio-deposit
train
py
09a84a9070660f10d9a13c08d17535373cfd10c5
diff --git a/osconf/__init__.py b/osconf/__init__.py index <HASH>..<HASH> 100644 --- a/osconf/__init__.py +++ b/osconf/__init__.py @@ -19,7 +19,7 @@ def config_from_environment(env_prefix, env_required=None, **kwargs): config[key] = env_eval(value) if env_required: for required in env_required: - if required not in config: + if required not in config or config[required] == '': raise RequiredException( 'You must pass %s or define env var %s%s' % ( required, prefix, required.upper()) @@ -28,4 +28,4 @@ def config_from_environment(env_prefix, env_required=None, **kwargs): class RequiredException(Exception): - pass \ No newline at end of file + pass
FIX raise required for empty environment variables
gisce_osconf
train
py
6885f29a922d9b0dbb1fb991998eed231a309ee7
diff --git a/lib/webidl2.js b/lib/webidl2.js index <HASH>..<HASH> 100644 --- a/lib/webidl2.js +++ b/lib/webidl2.js @@ -570,6 +570,8 @@ // noop, just parsing } else { + ret.idlType = return_type(); + all_ws(); ret.operation = operation_rest(); } return ret;
fix bug in serializer parsing
w3c_webidl2.js
train
js
dbd98f12ac2187473b6195439802dcecbdb9276a
diff --git a/lib/memcached.js b/lib/memcached.js index <HASH>..<HASH> 100644 --- a/lib/memcached.js +++ b/lib/memcached.js @@ -145,9 +145,11 @@ Client.config = { } , connectTimeout = function() { memcached.connectionIssue('Stream connect timeout', S); + Manager.remove(this); } , streamError = function() { memcached.connectionIssue('Stream error', S); + Manager.remove(this); }; // config the Stream
release connection on connect timeout and error
3rd-Eden_memcached
train
js
c69c5de45795efbf77f94d2ffac1c29c7eb0d089
diff --git a/acceptance/lib/puppet/acceptance/module_utils.rb b/acceptance/lib/puppet/acceptance/module_utils.rb index <HASH>..<HASH> 100644 --- a/acceptance/lib/puppet/acceptance/module_utils.rb +++ b/acceptance/lib/puppet/acceptance/module_utils.rb @@ -163,7 +163,7 @@ module Puppet listings = listings.reject { |l| l =~ /\.\.$/ } listings.each do |line| - assert_match /(drwxr-xr-x|[^d]rw-r--r--)[^\d]+\d+\s+#{owner}\s+#{group}/, line, + assert_match /(drwxr-xr-x|[^d]r--r--r--)[^\d]+\d+\s+#{owner}\s+#{group}/, line, "bad permissions for '#{line[/\S+$/]}' - expected 644/755, #{owner}, #{group}" end end
(#<I>) Change check for module installation Now that we are only stripping the dangerous bits from the file permissions (sticky, suid, sgid, and write) the test for correct module installation was incorrect.
puppetlabs_puppet
train
rb
88739879e8b8791657845cde286ae9e89eab7994
diff --git a/drivers/storage/efs/storage/efs_storage.go b/drivers/storage/efs/storage/efs_storage.go index <HASH>..<HASH> 100644 --- a/drivers/storage/efs/storage/efs_storage.go +++ b/drivers/storage/efs/storage/efs_storage.go @@ -1,6 +1,8 @@ package storage import ( + "crypto/md5" + "fmt" "strings" "time" @@ -226,8 +228,11 @@ func (d *driver) VolumeCreate( name string, opts *types.VolumeCreateOpts) (*types.Volume, error) { + // Token is limited to 64 ASCII characters so just create MD5 hash from full + // tag/name identifier + creationToken := fmt.Sprintf("%x", md5.Sum([]byte(d.getFullVolumeName(name)))) request := &awsefs.CreateFileSystemInput{ - CreationToken: aws.String(name), + CreationToken: aws.String(creationToken), PerformanceMode: aws.String(awsefs.PerformanceModeGeneralPurpose), } if opts.Type != nil && strings.ToLower(*opts.Type) == "maxio" {
EFS creation can fail if same volume name is used with different tag
thecodeteam_libstorage
train
go
ca74a27191b5290d1b8304b12b181db7a9ccf4aa
diff --git a/src/Coordinate.php b/src/Coordinate.php index <HASH>..<HASH> 100644 --- a/src/Coordinate.php +++ b/src/Coordinate.php @@ -124,6 +124,8 @@ class Coordinate implements GeometryInterface /** * Checks if this point intersects a given geometry. + * + * @throws InvalidGeometryException */ public function intersects(GeometryInterface $geometry): bool {
add @throws in docblock
mjaschen_phpgeo
train
php
0e2bf27cb6a4daab4c91f705f1ece9335bc00368
diff --git a/Auth/Yadis/HTTPFetcher.php b/Auth/Yadis/HTTPFetcher.php index <HASH>..<HASH> 100644 --- a/Auth/Yadis/HTTPFetcher.php +++ b/Auth/Yadis/HTTPFetcher.php @@ -85,7 +85,7 @@ class Auth_Yadis_HTTPFetcher { function _findRedirect($headers) { foreach ($headers as $line) { - if (strpos($line, "Location: ") === 0) { + if (stripos($line, "Location: ") === 0) { $parts = explode(" ", $line, 2); return $parts[1]; }
[project @ Fixed discovery failure due to case-sensitive comparison of 'Location:' header] If an HTTP redirect was issued during discovery with a 'Location:' header that doesn't exactly match case (such as 'location:' or 'LOCATION:'), discovery would fail. This is incorrect behavior per RFC <I>, Section <I>. This behavior is corrected by using a case insensitive compare when checking for HTTP redirects.
openid_php-openid
train
php
8a0fb408e79f3059c8138cd3f0c8f0db7eb3eb60
diff --git a/src/Illuminate/Foundation/Console/KeyGenerateCommand.php b/src/Illuminate/Foundation/Console/KeyGenerateCommand.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Foundation/Console/KeyGenerateCommand.php +++ b/src/Illuminate/Foundation/Console/KeyGenerateCommand.php @@ -62,7 +62,7 @@ class KeyGenerateCommand extends Command { */ protected function getRandomKey() { - return Illuminate\Support\Str::secureRandom(32); + return Illuminate\Support\Str::random(32); } }
Since this string is only generated once, we can use the conventional method
laravel_framework
train
php
2747c4a473f9e37dc452ecda98fa4d1fcb7e3790
diff --git a/app/App/UploadController.php b/app/App/UploadController.php index <HASH>..<HASH> 100644 --- a/app/App/UploadController.php +++ b/app/App/UploadController.php @@ -75,7 +75,7 @@ class UploadController }); return Respond::presenter($request) - ->call($this->viewer); + ->call([$this->viewer, 'withView']); } /**
example of passing a callable.
TuumPHP_Respond
train
php
0239ce4323518cb1b1c9e26ccd715a09432bf73e
diff --git a/taar/plugin.py b/taar/plugin.py index <HASH>..<HASH> 100644 --- a/taar/plugin.py +++ b/taar/plugin.py @@ -53,14 +53,21 @@ def configure_plugin(app): # noqa: C901 post_data = json.loads(json_data) promoted_guids = post_data.get("options", {}).get("promoted", []) + if promoted_guids: + # Promoted GUIDs need to be sorted. Any TAAR + # generated weights will always be between 0 and 1.0. + # Any integer weight that is passed in for a promoted + # GUID will be greater than any machine generated + # GUID. promoted_guids.sort(key=lambda x: x[1], reverse=True) promoted_guids = [x[0] for x in promoted_guids] except Exception as e: + jdata = {} + jdata["results"] = [] + jdata["error"] = "Invalid JSON in POST: {}".format(e) return app.response_class( - response=json.dumps({"error": "Invalid JSON in POST: {}".format(e)}), - status=400, - mimetype="application/json", + response=json.dumps(jdata, status=400, mimetype="application/json") ) # Coerce the uuid.UUID type into a string
Extended the HTTP <I> error in the case of a malformed JSON blob on POST so that the result data can still be processed with a valid 'results' key with an empty list of suggestions.
mozilla_taar
train
py
4dba4419d1359d782d4316fa3b8ed1dffdae8c04
diff --git a/Dailymotion.php b/Dailymotion.php index <HASH>..<HASH> 100644 --- a/Dailymotion.php +++ b/Dailymotion.php @@ -13,7 +13,7 @@ class Dailymotion * Current version number of this SDK. * @var string Version number */ - const VERSION = '1.6.4'; + const VERSION = '1.6.5'; /** * An authorization is requested to the end-user by redirecting it to an authorization page hosted
Bumped the revision version to <I>
dailymotion_dailymotion-sdk-php
train
php
6131d1fcbede2fa4d610d80febfac20de7693440
diff --git a/js/zb.js b/js/zb.js index <HASH>..<HASH> 100644 --- a/js/zb.js +++ b/js/zb.js @@ -365,7 +365,7 @@ module.exports = class zb extends Exchange { }; order = this.extend (order, params); let response = await this.privateGetGetOrder (order); - return this.parseOrder (response, undefined, true); + return this.parseOrder (response, undefined); } async fetchOrders (symbol = undefined, since = undefined, limit = 50, params = {}) { diff --git a/python/ccxt/zb.py b/python/ccxt/zb.py index <HASH>..<HASH> 100644 --- a/python/ccxt/zb.py +++ b/python/ccxt/zb.py @@ -369,7 +369,7 @@ class zb (Exchange): } order = self.extend(order, params) response = self.privateGetGetOrder(order) - return self.parse_order(response, None) + return self.parse_order(response, None, True) def fetch_orders(self, symbol=None, since=None, limit=50, params={}): if not symbol:
restored zb.py, removed excess argument in fetchOrder in zb.js fix #<I>
ccxt_ccxt
train
js,py
e24970b1c9269d43c5fd5ae1e1876b3996e613e3
diff --git a/src/frontend/org/voltdb/SnapshotSaveAPI.java b/src/frontend/org/voltdb/SnapshotSaveAPI.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/SnapshotSaveAPI.java +++ b/src/frontend/org/voltdb/SnapshotSaveAPI.java @@ -651,11 +651,16 @@ public class SnapshotSaveAPI */ for (int ii = 0; ii < numLocalSites && !partitionedSnapshotTasks.isEmpty(); ii++) { SnapshotSiteProcessor.m_taskListsForSites.get(ii).addAll(partitionedSnapshotTasks); + if (!format.isTableBased()) { + SnapshotSiteProcessor.m_taskListsForSites.get(ii).addAll(replicatedSnapshotTasks); + } } - int siteIndex = 0; - for (SnapshotTableTask t : replicatedSnapshotTasks) { - SnapshotSiteProcessor.m_taskListsForSites.get(siteIndex++ % numLocalSites).offer(t); + if (format.isTableBased()) { + int siteIndex = 0; + for (SnapshotTableTask t : replicatedSnapshotTasks) { + SnapshotSiteProcessor.m_taskListsForSites.get(siteIndex++ % numLocalSites).offer(t); + } } if (!aborted) { logSnapshotStartToZK( txnId, context, file_nonce);
Send replicated table in each site for non-table based snapshots.
VoltDB_voltdb
train
java
33d88b623077936c54b5f0d5a66def4443941819
diff --git a/rest_framework_mongoengine/fields.py b/rest_framework_mongoengine/fields.py index <HASH>..<HASH> 100644 --- a/rest_framework_mongoengine/fields.py +++ b/rest_framework_mongoengine/fields.py @@ -445,6 +445,8 @@ class GeoPointField(MongoValidatingField, serializers.Field): self.fail('not_a_list', input_value=repr(value)) if len(value) != 2: self.fail('not_2d', input_value=repr(value)) + if value == [None, None]: + return value try: return [float(value[0]), float(value[1])] except ValueError:
Gracefully handle [null, null] for GeoPointField value In case you need to set coordinates to null this would be useful
umutbozkurt_django-rest-framework-mongoengine
train
py
7d4a9ec688968530dc412af304f049ce4674a46e
diff --git a/src/doc/conf.py b/src/doc/conf.py index <HASH>..<HASH> 100644 --- a/src/doc/conf.py +++ b/src/doc/conf.py @@ -29,7 +29,7 @@ release = "2.0 beta" extensions = ["sphinx.ext.autodoc", "sphinx.ext.intersphinx", "sphinx.ext.napoleon"] # intersphinx_mapping = {"python": ("http://docs.python.org/3", None)} -intersphinx_mapping = {"python": (".", "python3_intersphinx.inv")} +intersphinx_mapping = {"python": ("http://docs.python.org/3", "python3_intersphinx.inv")} # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the
Corrected intersphinx mapping
sffjunkie_astral
train
py
e57564c9570dde29bdc78d59b45f8fca336bb23d
diff --git a/middleman-core/lib/middleman-core/preview_server.rb b/middleman-core/lib/middleman-core/preview_server.rb index <HASH>..<HASH> 100644 --- a/middleman-core/lib/middleman-core/preview_server.rb +++ b/middleman-core/lib/middleman-core/preview_server.rb @@ -3,7 +3,6 @@ require "webrick" module Middleman module PreviewServer - DEFAULT_HOST = '0.0.0.0' DEFAULT_PORT = 4567 class << self @@ -14,7 +13,7 @@ module Middleman # @return [void] def start(opts={}) @options = opts - @host = @options[:host] || DEFAULT_HOST + @host = @options[:host] || Socket.gethostname @port = @options[:port] || DEFAULT_PORT mount_instance
Using 'Socket.gethostname' to get default hostname As suggested by @bhollis in <URL>
middleman_middleman
train
rb
8ee4bbb8ebe5158190950a9c73ccaca337400fc7
diff --git a/tests/integration/minion/test_pillar.py b/tests/integration/minion/test_pillar.py index <HASH>..<HASH> 100644 --- a/tests/integration/minion/test_pillar.py +++ b/tests/integration/minion/test_pillar.py @@ -48,6 +48,7 @@ DEFAULT_OPTS = { 'decrypt_pillar_renderers': ['gpg'], } ADDITIONAL_OPTS = ( + 'conf_file', 'file_roots', 'state_top', 'renderer',
Add "conf_file" to ADDITIONAL_OPTS for pillar integration tests
saltstack_salt
train
py
ce9214ca51a1b569c0a71f6811b6622771f9c60d
diff --git a/src/File/Filesystem.php b/src/File/Filesystem.php index <HASH>..<HASH> 100644 --- a/src/File/Filesystem.php +++ b/src/File/Filesystem.php @@ -55,7 +55,7 @@ class Filesystem extends BaseFilesystem ->notName('.DS_Store'); collect($ignore)->each(function ($pattern) use ($finder) { - $finder->notPath('#^' . str_replace('\*', '[^/]+', preg_quote(trim($pattern, '/'))) . '#'); + $finder->notPath('#^' . str_replace('\*', '[^/]+', preg_quote(trim($pattern, '/'))) . '($|/)#'); }); return $finder;
Fix getFinder method in Filesystem to prevent unintentional ending wildcard
tightenco_jigsaw
train
php
fdc61b4e876468ebeb65bf94bdac267b068a2a40
diff --git a/spec/status_spec.rb b/spec/status_spec.rb index <HASH>..<HASH> 100644 --- a/spec/status_spec.rb +++ b/spec/status_spec.rb @@ -64,17 +64,6 @@ describe AwesomeBot do # end # end - context "given a header with special encoding" do - link = 'http://okeowoaderemi.com/site/assets/files/1103/zf2-flowchart.jpg' - r = AwesomeBot::check link - s = r.status[0] - value = s['headers']['strict-transport-security'] - expected = '“max-age=31536000″' - it "is encoded using utf8" do - expect(value).to eql(expected) - end - end - context "given an incomplete redirect" do link = 'https://godoc.org/github.com/ipfs/go-libp2p-crypto' r = AwesomeBot::check link
Remove test for broken Strict-Transport-Security header This test no longer works because the URL no longer returns that header: curl -I '<URL>. Since this test was testing a particular website's broken HTTP response, and other websites are unlikely to be broken in the same way, I've just removed it. The header is invalid for two reasons: - Fancy quote marks are not valid syntax for this header - This header should not be set on HTTP websites anyway (browsers will ignore it) See <URL>
dkhamsing_awesome_bot
train
rb
a323c6daf7ef27903d3176d2a34abea50363c7d4
diff --git a/src/ol-ext/interactions/measure.js b/src/ol-ext/interactions/measure.js index <HASH>..<HASH> 100644 --- a/src/ol-ext/interactions/measure.js +++ b/src/ol-ext/interactions/measure.js @@ -122,7 +122,8 @@ ngeo.interaction.Measure = function(opt_options) { * @type {ol.interaction.Draw|ngeo.interaction.DrawAzimut} * @private */ - this.drawInteraction_ = this.getDrawInteraction(style, this.overlay_); + this.drawInteraction_ = this.getDrawInteraction(options.sketchStyle, + this.overlay_); goog.events.listen(this, ol.Object.getChangeEventType(ol.interaction.InteractionProperty.ACTIVE),
Sketch style was not correctly taken into account
camptocamp_ngeo
train
js
22766937993b02864b12d2bb2f33ac6f2c8095e9
diff --git a/course/importstudents.php b/course/importstudents.php index <HASH>..<HASH> 100644 --- a/course/importstudents.php +++ b/course/importstudents.php @@ -100,6 +100,9 @@ unset($searchcourses[$tmp->id]); } } + if (array_key_exists($course->id,$searchcourses)) { + unset($searchcourses[$course->id]); + } $numcourses = count($searchcourses); }
Better attempt at fixing <I>
moodle_moodle
train
php
8e968deda9f7a8a6dbb25a12f7ac208cee594ca3
diff --git a/js/poloniex.js b/js/poloniex.js index <HASH>..<HASH> 100644 --- a/js/poloniex.js +++ b/js/poloniex.js @@ -574,7 +574,7 @@ module.exports = class poloniex extends Exchange { result.push (trades[j]); } } else { - let [ baseId, quoteId ] = id.split ('_'); + let [ quoteId, baseId ] = id.split ('_'); let base = this.commonCurrencyCode (baseId); let quote = this.commonCurrencyCode (quoteId); let symbol = base + '/' + quote;
fix: Poloniex markets inconsistency Poloniex define markets' IDs this way: QUOTE_BASE
ccxt_ccxt
train
js
5673310634062ca90440b9e81b3fd6380187b044
diff --git a/test/functional/base.rb b/test/functional/base.rb index <HASH>..<HASH> 100644 --- a/test/functional/base.rb +++ b/test/functional/base.rb @@ -110,8 +110,7 @@ module FunctionalBase end def wait - Thread.pass - sleep 0.001 + sleep 0.007 end def assert_engine_clean (wfid=nil, opts={}) diff --git a/test/functional/ft_1_process_status.rb b/test/functional/ft_1_process_status.rb index <HASH>..<HASH> 100644 --- a/test/functional/ft_1_process_status.rb +++ b/test/functional/ft_1_process_status.rb @@ -84,7 +84,8 @@ class FtProcessStatusTest < Test::Unit::TestCase # # tinkering with trees ... - e = ps.expressions.last + e = ps.expressions.find { |e| e.fei.expid == '0_0_1' } + e.tree = [ 'participant', { 'ref' => :bravo }, [] ] assert_equal(
test/ft_1 picking the right expression
jmettraux_ruote
train
rb,rb
3b24c2c4d954c7b71bb6281599669244582b5095
diff --git a/numeric.ly.js b/numeric.ly.js index <HASH>..<HASH> 100644 --- a/numeric.ly.js +++ b/numeric.ly.js @@ -37,7 +37,7 @@ var numeric = { gcd: function(num1, num2){ var result; if(num1 > num2){ - for(i = 0 ; i <= num2 ; i++){ + for(var i = 0 ; i <= num2 ; i++){ if(num2%i === 0){ if(num1%i === 0){ result = i; @@ -46,16 +46,16 @@ var numeric = { } return result; }else if(num2 > num1){ - for(i = 0 ; i <= num2 ; i++){ + for(var i = 0 ; i <= num2 ; i++){ if(num1%i === 0){ if(num2%i === 0){ - var result = i; + result = i; } } } return result; }else{ - var result = num1*num2/num1; + result = num1*num2/num1; return result; } }, @@ -265,8 +265,8 @@ var numeric = { }else if(val == 2){ return true; }else if(val != null){ - start = 2; - result = true; + var start = 2; + var result = true; while(start < val){ if(val % start === 0){ result = false;
Fewer Globals Var declarations to prevent internal variables from leaking out of their functions
numbers_numbers.js
train
js
88e2521ae5e9995073fa71090588cfde9249ce75
diff --git a/src/main/java/org/jfrog/hudson/generic/GenericArtifactsDeployer.java b/src/main/java/org/jfrog/hudson/generic/GenericArtifactsDeployer.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jfrog/hudson/generic/GenericArtifactsDeployer.java +++ b/src/main/java/org/jfrog/hudson/generic/GenericArtifactsDeployer.java @@ -188,7 +188,9 @@ public class GenericArtifactsDeployer { SpecsHelper specsHelper = new SpecsHelper(log); try { return specsHelper.uploadArtifactsBySpec(spec, workspace, buildProperties, client); - } catch (NoSuchAlgorithmException e) { + } catch (InterruptedException e) { + throw e; + } catch (Exception e) { throw new RuntimeException("Failed uploading artifacts by spec", e); } finally { client.close();
HAP-<I> - Parallel deployment of Artifacts when using FileSpecs
jenkinsci_artifactory-plugin
train
java
57ccd29449c84e07c0c03c790830ceecc0dfdec1
diff --git a/dusty/config.py b/dusty/config.py index <HASH>..<HASH> 100644 --- a/dusty/config.py +++ b/dusty/config.py @@ -4,8 +4,8 @@ as the location of the Dusty specifications on disk.""" from __future__ import absolute_import -import logging import os +import logging import pwd import subprocess import yaml @@ -109,6 +109,10 @@ def check_and_load_ssh_auth(): SSH_AUTH_SOCK environment variable to the current environment. This allows git clones to behave the same for the daemon as they do for the user """ + if os.getenv('SSH_AUTH_SOCK'): + logging.info('SSH_AUTH_SOCK already set') + return _set_ssh_auth_sock(os.getenv('SSH_AUTH_SOCK')) + mac_username = get_config_value(constants.CONFIG_MAC_USERNAME_KEY) if not mac_username: logging.info("Can't setup ssh authorization; no mac_username specified")
Allow getting SSH_AUTH_SOCK from environment
gamechanger_dusty
train
py
964575c9006db58560b82fa808e96ef5bfd46951
diff --git a/modules/activiti-explorer/src/main/java/org/activiti/explorer/ui/management/deployment/DeploymentUploadReceiver.java b/modules/activiti-explorer/src/main/java/org/activiti/explorer/ui/management/deployment/DeploymentUploadReceiver.java index <HASH>..<HASH> 100644 --- a/modules/activiti-explorer/src/main/java/org/activiti/explorer/ui/management/deployment/DeploymentUploadReceiver.java +++ b/modules/activiti-explorer/src/main/java/org/activiti/explorer/ui/management/deployment/DeploymentUploadReceiver.java @@ -98,6 +98,7 @@ public class DeploymentUploadReceiver implements Receiver, FinishedListener { } catch (ActivitiException e) { String errorMsg = e.getMessage().replace(System.getProperty("line.separator"), "<br/>"); notificationManager.showErrorNotification(Messages.DEPLOYMENT_UPLOAD_FAILED, errorMsg); + throw e; } } finally { if (outputStream != null) {
【Activiti Explorer】Improvement of exception propagation
Activiti_Activiti
train
java
62c8bcbbb600cbe26e3e12ed95207ffe63c40fc8
diff --git a/tests/integration/api_container_test.py b/tests/integration/api_container_test.py index <HASH>..<HASH> 100644 --- a/tests/integration/api_container_test.py +++ b/tests/integration/api_container_test.py @@ -1251,7 +1251,7 @@ class AttachContainerTest(BaseAPIIntegrationTest): output = self.client.attach(container, stream=False, logs=True) assert output == 'hello\n'.encode(encoding='ascii') - @pytest.mark.timeout(5) + @pytest.mark.timeout(10) @pytest.mark.skipif(os.environ.get('DOCKER_HOST', '').startswith('ssh://'), reason='No cancellable streams over SSH') def test_attach_stream_and_cancel(self):
Increase timeout on test with long sleeps
docker_docker-py
train
py
a24bedf575911c040521499e280cfcea686c1eb6
diff --git a/src/scripts/cysignals-CSI-helper.py b/src/scripts/cysignals-CSI-helper.py index <HASH>..<HASH> 100644 --- a/src/scripts/cysignals-CSI-helper.py +++ b/src/scripts/cysignals-CSI-helper.py @@ -25,11 +25,10 @@ import gdb from Cython.Debugger import libpython, libcython from Cython.Debugger.libcython import cy, CythonCommand -try: - if not color: - libcython.pygments = None # disable escape-sequence coloring -except (NameError, AttributeError): - pass + +if not color: # noqa + # disable escape-sequence coloring + libcython.pygments = None def cython_debug_files():
Access libcython.pygments without try/except
sagemath_cysignals
train
py
b8d165b356afabe10efd2f1dfa06e04a784cb192
diff --git a/XBRL-Instance.php b/XBRL-Instance.php index <HASH>..<HASH> 100644 --- a/XBRL-Instance.php +++ b/XBRL-Instance.php @@ -6589,7 +6589,10 @@ class ContextsFilter { $filtered = array_filter( $this->contexts, function( $context ) { // The context may be invalid in which case exclude - return ! isset( $context['entity']['segment']['explicitMember'] ) || count( $context['entity']['segment']['explicitMember'] ) == 0; + return ( ! isset( $context['entity']['segment']['explicitMember'] ) || count( $context['entity']['segment']['explicitMember'] ) == 0 ) && + ( ! isset( $context['entity']['scenario']['explicitMember'] ) || count( $context['entity']['scenario']['explicitMember'] ) == 0 ) && + ( ! isset( $context['segment']['explicitMember'] ) || count( $context['segment']['explicitMember'] ) == 0 ) && + ( ! isset( $context['scenario']['explicitMember'] ) || count( $context['scenario']['explicitMember'] ) == 0 ); } ); return new ContextsFilter( $this->instance, $filtered );
Updated ContextsFilter::NoSegmentContexts() to review all segment and all scenario positions
bseddon_XBRL
train
php
a44efd7a48a34d39bd95c122d6ab8f704b4cafe0
diff --git a/bigtable-dataflow-parent/bigtable-hbase-dataflow/src/main/java/com/google/cloud/bigtable/dataflow/CloudBigtableIO.java b/bigtable-dataflow-parent/bigtable-hbase-dataflow/src/main/java/com/google/cloud/bigtable/dataflow/CloudBigtableIO.java index <HASH>..<HASH> 100644 --- a/bigtable-dataflow-parent/bigtable-hbase-dataflow/src/main/java/com/google/cloud/bigtable/dataflow/CloudBigtableIO.java +++ b/bigtable-dataflow-parent/bigtable-hbase-dataflow/src/main/java/com/google/cloud/bigtable/dataflow/CloudBigtableIO.java @@ -500,7 +500,8 @@ public class CloudBigtableIO { byte[] startKey, byte[] stopKey) throws IOException { Preconditions.checkState(desiredBundleSizeBytes > 0); int splitCount = (int) Math.ceil((double) (regionSize) / (double) (desiredBundleSizeBytes)); - if (splitCount < 2 || stopKey.length == 0) { + + if (splitCount < 2 || stopKey.length == 0 || Bytes.compareTo(startKey,stopKey) >= 0) { return Collections.singletonList(createSourceWithKeys(startKey, stopKey, regionSize)); } else { if (stopKey.length > 0) {
Fixing a potential mismatch between hbase and BT lexicographical ordering. (#<I>) This might fix #<I>.
googleapis_cloud-bigtable-client
train
java
939c89571a03001bfdb57dddd97b0bc37f8dbe2c
diff --git a/src/ngTouch.js b/src/ngTouch.js index <HASH>..<HASH> 100644 --- a/src/ngTouch.js +++ b/src/ngTouch.js @@ -52,4 +52,29 @@ angular.module("ngTouch", []) }] } +}) +.directive("ngTap", function () { + return { + controller: ["$scope", "$element", function ($scope, $element) { + + var moved = false; + $element.bind("touchstart", onTouchStart); + function onTouchStart(event) { + $element.bind("touchmove", onTouchMove); + $element.bind("touchend", onTouchEnd); + } + function onTouchMove(event) { + moved = true; + } + function onTouchEnd(event) { + $element.unbind("touchmove", onTouchMove); + $element.unbind("touchend", onTouchEnd); + if (!moved) { + var method = $element.attr("ng-tap"); + $scope.$apply(method); + } + } + + }] + } });
ngTap directive It works only if you don't move your finger.
nglar_ngTouch
train
js
bfaa917a966fab1e2c92e70617320957a8d8b43b
diff --git a/pkg/opts/envfile.go b/pkg/opts/envfile.go index <HASH>..<HASH> 100644 --- a/pkg/opts/envfile.go +++ b/pkg/opts/envfile.go @@ -15,6 +15,8 @@ func ParseEnvFile(filename string) ([]string, error) { if err != nil { return []string{}, err } + defer fh.Close() + var ( lines []string = []string{} line, chunk []byte
pkg/opts: Close the file handle Docker-DCO-<I>-
moby_moby
train
go
1a8f13062877cb80428e15867de4395f6e7f3ad9
diff --git a/lib/comfortable_mexican_sofa/fixture.rb b/lib/comfortable_mexican_sofa/fixture.rb index <HASH>..<HASH> 100644 --- a/lib/comfortable_mexican_sofa/fixture.rb +++ b/lib/comfortable_mexican_sofa/fixture.rb @@ -49,10 +49,10 @@ module ComfortableMexicanSofa::Fixture def import! ComfortableMexicanSofa::Fixture::Category::Importer.new(from, to, force_import).import! - ComfortableMexicanSofa::Fixture::File::Importer.new( from, to, force_import).import! ComfortableMexicanSofa::Fixture::Layout::Importer.new( from, to, force_import).import! ComfortableMexicanSofa::Fixture::Page::Importer.new( from, to, force_import).import! ComfortableMexicanSofa::Fixture::Snippet::Importer.new( from, to, force_import).import! + ComfortableMexicanSofa::Fixture::File::Importer.new( from, to, force_import).import! end end
change the priority of the file fixture importer
comfy_comfortable-mexican-sofa
train
rb
3cffcfc77c4d80bda3ab20ea2710c7a36ae9f73d
diff --git a/src/mediaelement.js b/src/mediaelement.js index <HASH>..<HASH> 100644 --- a/src/mediaelement.js +++ b/src/mediaelement.js @@ -527,10 +527,6 @@ height="' + height + '"></embed>'; this.pluginApi.pauseMedia(); this.paused = true; } - , stop: function () { - this.pluginApi.stopMedia(); - this.paused = true; - } // custom methods since not all JavaScript implementations support get/set , setSrc: function (url) {
- remove stop() method since it doesn't exist in HTML5.
mediaelement_mediaelement
train
js
6ae7cba1c0486d046f3f59bb2b591d7a3b03411f
diff --git a/lzmadec.go b/lzmadec.go index <HASH>..<HASH> 100644 --- a/lzmadec.go +++ b/lzmadec.go @@ -202,9 +202,18 @@ func newArchive(path string, password *string) (*Archive, error) { } params := []string{"l", "-slt", "-sccUTF-8"} - if password != nil { - params = append(params, fmt.Sprintf("-p%s", *password)) + var tmpPassword *string + if password == nil || *password == "" { + // 7z interactively asks for a password when an archive is encrypted + // and no password has been supplied. But it has no problems when + // a password has been supplied and the archive is not encrypted. + // So if no password has been provided, use a non-sensical one to + // prevent 7z from blocking on encrypted archives and instead fail + *tmpPassword = " " + } else { + tmpPassword = password } + params = append(params, fmt.Sprintf("-p%s", *tmpPassword)) params = append(params, path) cmd := exec.Command("7z", params...) out, err := cmd.CombinedOutput() @@ -218,7 +227,7 @@ func newArchive(path string, password *string) (*Archive, error) { return &Archive{ Path: path, Entries: entries, - password: password, + password: tmpPassword, }, nil }
Fail instead on block on encrypted archives without password
kjk_lzmadec
train
go
0573c0abf4e1b106db42296680d5942c2c01095a
diff --git a/backtrader/feeds/csvgeneric.py b/backtrader/feeds/csvgeneric.py index <HASH>..<HASH> 100644 --- a/backtrader/feeds/csvgeneric.py +++ b/backtrader/feeds/csvgeneric.py @@ -87,10 +87,10 @@ class GenericCSVData(feed.CSVDataBase): def start(self): super(GenericCSVData, self).start() + self._dtstr = False if isinstance(self.p.dtformat, string_types): self._dtstr = True elif isinstance(self.p.dtformat, integer_types): - self._dtstr = False idt = int(self.p.dtformat) if idt == 1: self._dtconvert = lambda x: datetime.utcfromtimestamp(int(x))
Ensure a callable is taken in genericcsv
backtrader_backtrader
train
py
95c8d98e8bf4a029820bd40a2c84671ef1534ad8
diff --git a/lib/tangle/directed/acyclic/partial_order.rb b/lib/tangle/directed/acyclic/partial_order.rb index <HASH>..<HASH> 100644 --- a/lib/tangle/directed/acyclic/partial_order.rb +++ b/lib/tangle/directed/acyclic/partial_order.rb @@ -26,7 +26,7 @@ module Tangle end def <=>(other) - raise RuntimeError unless graph == other.graph + raise GraphError unless graph == other.graph return 0 if vertex == other.vertex return -1 if graph.successor?(vertex, other.vertex) 1
Raise proper error in PartialOrder Raise a `GraphError` when comparing `PartialOrder`s for different graphs, instead of a generic `RuntimeError`.
notCalle_ruby-tangle
train
rb
a03ec008e026c6ded28bbf727d2803eedaf2b785
diff --git a/lib/kpeg/compiled_parser.rb b/lib/kpeg/compiled_parser.rb index <HASH>..<HASH> 100644 --- a/lib/kpeg/compiled_parser.rb +++ b/lib/kpeg/compiled_parser.rb @@ -167,8 +167,14 @@ module KPeg end end - def parse - _root ? true : false + def parse(rule=nil) + if !rule + _root ? true : false + else + # This is not shared with code_generator.rb so this can be standalone + method = rule.gsub("-","_hyphen_") + __send__("_#{method}") ? true : false + end end class LeftRecursive diff --git a/lib/kpeg/format_parser.rb b/lib/kpeg/format_parser.rb index <HASH>..<HASH> 100644 --- a/lib/kpeg/format_parser.rb +++ b/lib/kpeg/format_parser.rb @@ -188,8 +188,14 @@ class KPeg::FormatParser end end - def parse - _root ? true : false + def parse(rule=nil) + if !rule + _root ? true : false + else + # This is not shared with code_generator.rb so this can be standalone + method = rule.gsub("-","_hyphen_") + __send__("_#{method}") ? true : false + end end class LeftRecursive
Add ability to parse from any rule
evanphx_kpeg
train
rb,rb
52ec69cbd20fc14bfc92e1d02f9b935b530c1c95
diff --git a/src/Analyser/Header/Useragent/Device/Mobile.php b/src/Analyser/Header/Useragent/Device/Mobile.php index <HASH>..<HASH> 100644 --- a/src/Analyser/Header/Useragent/Device/Mobile.php +++ b/src/Analyser/Header/Useragent/Device/Mobile.php @@ -633,7 +633,7 @@ trait Mobile array_push($candidates, $match[1]); } - if (preg_match('/\ ([^\s\)]+)\)?$/u', $ua, $match)) { + if (preg_match('/\ ([^\s\)\/]+)[^\s]*$/u', $ua, $match)) { array_push($candidates, $match[1]); }
When trying to detect generic model markers, chop off everything after the slash
WhichBrowser_Parser-PHP
train
php
3657e96df273041c9f7f001ba6fb5dde2b2cb1e2
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -162,7 +162,7 @@ TuyaCloud.prototype.request = async function (options) { debug(apiResult.body); if (data.success === false) { - throw new TuyaCloudRequestError({code: data.errorCode, message: data.errorMsg}) + throw new TuyaCloudRequestError({code: data.errorCode, message: data.errorMsg}); } return data.result;
Formatting: fix lack of semicolon
TuyaAPI_cloud
train
js
c10054844c98091ca7c3aaf85a8bf19cf85e4998
diff --git a/src/processor/global-intents/market.js b/src/processor/global-intents/market.js index <HASH>..<HASH> 100644 --- a/src/processor/global-intents/market.js +++ b/src/processor/global-intents/market.js @@ -177,7 +177,7 @@ module.exports = function({orders, userIntents, usersById, gameTime, roomObjects } if (intent.newPrice > order.price) { - + order._skip = true; var fee = Math.ceil((intent.newPrice - order.price) * order.remainingAmount * C.MARKET_FEE); if (user.money < fee) { @@ -263,7 +263,7 @@ module.exports = function({orders, userIntents, usersById, gameTime, roomObjects iUserIntents.intents.deal.forEach(intent => { intent.user = iUserIntents.user; - if (!ordersById[intent.orderId]) { + if (!ordersById[intent.orderId] || ordersById[intent.orderId]._skip) { return; } if (intent.amount <= 0) {
🚑 cancel deal on order at the same tick when its price is changed DEV-<I>
screeps_engine
train
js
0e15aeffd1b3f21da49a4ac2c0218168877317da
diff --git a/src/module-elasticsuite-core/Search/Request/Query/MoreLikeThis.php b/src/module-elasticsuite-core/Search/Request/Query/MoreLikeThis.php index <HASH>..<HASH> 100644 --- a/src/module-elasticsuite-core/Search/Request/Query/MoreLikeThis.php +++ b/src/module-elasticsuite-core/Search/Request/Query/MoreLikeThis.php @@ -235,7 +235,7 @@ class MoreLikeThis implements QueryInterface */ public function getMaxDocFreq() { - return $this->minDocFreq; + return $this->maxDocFreq; } /**
Fix typo in the more like this query model.
Smile-SA_elasticsuite
train
php
3de9a41f5ccfa2d1bc687ebe18e4631a41e4829a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -168,6 +168,12 @@ AnsiColor.prototype.bg = function() { return ansi; } +//AnsiColor.prototype.__defineGetter__('bg', function() { + //var ansi = new AnsiColor(this.v, this.k, this); + //ansi.t = definition.bg.colors; + //return ansi; +//}); + /** * Write a writable stream. *
Test bg property getter.
tmpfs_ttycolor
train
js
0174c8fe58805bc99ee940f7f9cdcd9f2dff8036
diff --git a/salt/modules/jboss7.py b/salt/modules/jboss7.py index <HASH>..<HASH> 100644 --- a/salt/modules/jboss7.py +++ b/salt/modules/jboss7.py @@ -2,6 +2,8 @@ ''' Module for managing JBoss AS 7 through the CLI interface. +.. versionadded:: 2015.5.0 + In order to run each function, jboss_config dictionary with the following properties must be passed: * cli_path: the path to jboss-cli script, for example: '/opt/jboss/jboss-7.0/bin/jboss-cli.sh' * controller: the ip addres and port of controller, for example: 10.11.12.13:9999 diff --git a/salt/states/jboss7.py b/salt/states/jboss7.py index <HASH>..<HASH> 100644 --- a/salt/states/jboss7.py +++ b/salt/states/jboss7.py @@ -2,6 +2,8 @@ ''' Manage JBoss 7 Application Server via CLI interface +.. versionadded:: 2015.5.0 + This state uses jboss-cli.sh script from JBoss installation and parses its output to determine execution result. In order to run each state, jboss_config dictionary with the following properties must be passed:
Add versionadded for jboss module/state
saltstack_salt
train
py,py
9628774ccdb127ad1d7972848284a3ea3c268a3d
diff --git a/lib/lovely_rufus/hangout_wrapper.rb b/lib/lovely_rufus/hangout_wrapper.rb index <HASH>..<HASH> 100644 --- a/lib/lovely_rufus/hangout_wrapper.rb +++ b/lib/lovely_rufus/hangout_wrapper.rb @@ -16,8 +16,8 @@ module LovelyRufus private def hangout_between?(line_a, line_b) - line_a, line_b = line_a.chomp, line_b.chomp - line_a[/\p{space}/] and line_a.rindex(/\p{space}/) >= line_b.size + last_space = line_a.chomp.rindex(/\p{space}/) + last_space and last_space >= line_b.chomp.size end def hangout_line
refactor HangoutWrapper#hangout_between? a bit
chastell_lovely_rufus
train
rb
f43037acfccc8b5c288a703ccd2679111e934c6d
diff --git a/themes/colors/header.php b/themes/colors/header.php index <HASH>..<HASH> 100644 --- a/themes/colors/header.php +++ b/themes/colors/header.php @@ -88,10 +88,10 @@ if ($SEARCH_SPIDER) { unset($menu_items, $menu); echo '</ul><div>'; -} + // Regular headers -if ($view!='simple' && !$SEARCH_SPIDER) { // Use "simple" headers for popup windows +} elseif ($view!='simple') { // Use "simple" headers for popup windows echo // Top row left '<div id="header">',
Minor syntax correction to <I>
fisharebest_webtrees
train
php
fee9dfa9b83008d9d4660cce3bd73f325b71b5d2
diff --git a/lib/active_record/connection_adapters/oracle_enhanced/schema_dumper.rb b/lib/active_record/connection_adapters/oracle_enhanced/schema_dumper.rb index <HASH>..<HASH> 100644 --- a/lib/active_record/connection_adapters/oracle_enhanced/schema_dumper.rb +++ b/lib/active_record/connection_adapters/oracle_enhanced/schema_dumper.rb @@ -173,7 +173,7 @@ module ActiveRecord #:nodoc: else tbl.print ", id: false" end - tbl.print ", force: true" + tbl.print ", force: :cascade" tbl.puts " do |t|" # then dump all non-primary key columns
New db/schema.rb files will be created with force: :cascade instead of force: true. Refer <URL>
rsim_oracle-enhanced
train
rb
cc122226f5ee01933c16655863cef861313d7d5f
diff --git a/nni/tools/nnictl/ts_management.py b/nni/tools/nnictl/ts_management.py index <HASH>..<HASH> 100644 --- a/nni/tools/nnictl/ts_management.py +++ b/nni/tools/nnictl/ts_management.py @@ -9,7 +9,7 @@ _builtin_training_services = [ 'remote', 'openpai', 'pai', 'aml', - 'dlc' + 'dlc', 'kubeflow', 'frameworkcontroller', 'adl',
fix: Missing comma (#<I>)
Microsoft_nni
train
py
bcdedc4187ba3dfadff0ba8ebcbfac92680e0738
diff --git a/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/config/annotation/web/configurers/OAuth2AuthorizationServerConfigurer.java b/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/config/annotation/web/configurers/OAuth2AuthorizationServerConfigurer.java index <HASH>..<HASH> 100644 --- a/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/config/annotation/web/configurers/OAuth2AuthorizationServerConfigurer.java +++ b/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/config/annotation/web/configurers/OAuth2AuthorizationServerConfigurer.java @@ -190,6 +190,11 @@ public final class OAuth2AuthorizationServerConfigurer extends return this; } + public OAuth2AuthorizationServerConfigurer authorizationCodeServices(AuthorizationCodeServices authorizationCodeServices) { + this.authorizationCodeServices = authorizationCodeServices; + return this; + } + @Override public void init(HttpSecurity http) throws Exception { registerDefaultAuthenticationEntryPoint(http);
Add support for authorization code services in @Configuration
spring-projects_spring-security-oauth
train
java
04bdabde4af97a0c707a6004bb53d8b4e6aa9c43
diff --git a/aws/resource_aws_spot_datafeed_subscription_test.go b/aws/resource_aws_spot_datafeed_subscription_test.go index <HASH>..<HASH> 100644 --- a/aws/resource_aws_spot_datafeed_subscription_test.go +++ b/aws/resource_aws_spot_datafeed_subscription_test.go @@ -33,6 +33,7 @@ func testAccAWSSpotDatafeedSubscription_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSpotDatafeedSubscription(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotDatafeedSubscriptionDestroy, Steps: []resource.TestStep{ @@ -82,6 +83,7 @@ func testAccAWSSpotDatafeedSubscription_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSpotDatafeedSubscription(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotDatafeedSubscriptionDestroy, Steps: []resource.TestStep{
tests/r/spot_datafeed_subscription: Add ErrorCheck
terraform-providers_terraform-provider-aws
train
go
bc84896509cb2568432b9ee053bf2963cdb60c44
diff --git a/system-test/storage.js b/system-test/storage.js index <HASH>..<HASH> 100644 --- a/system-test/storage.js +++ b/system-test/storage.js @@ -1530,7 +1530,6 @@ describe('storage', function() { var file = bucket.file('hi.jpg'); file.download(function(err) { assert.strictEqual(err.code, 404); - assert(err.message.indexOf('Not Found') > -1); done(); }); }); @@ -1541,7 +1540,6 @@ describe('storage', function() { }; var expectedContents = fs.readFileSync(FILES.html.path, 'utf-8'); - ``; bucket.upload(FILES.html.path, options, function(err, file) { assert.ifError(err);
Fix stale test. (#<I>)
googleapis_nodejs-storage
train
js
9bcf6325d5c77c4cd41cba189bcec072ffcad0f0
diff --git a/packages/ember-views/lib/views/view.js b/packages/ember-views/lib/views/view.js index <HASH>..<HASH> 100644 --- a/packages/ember-views/lib/views/view.js +++ b/packages/ember-views/lib/views/view.js @@ -1206,7 +1206,6 @@ Ember.View = Ember.Object.extend(Ember.Evented, @param {Function} fn the function that inserts the element into the DOM */ _insertElementLater: function(fn) { - Ember.deprecate('_insertElementLater should not be used for child views', !this._parentView); this._lastInsert = Ember.guidFor(fn); Ember.run.schedule('render', this, this.invokeForState, 'insertElement', fn); },
committed too early, this is still used by rerender
emberjs_ember.js
train
js
3813e588aa44bdf8813c3f2f57a49525316613a7
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -114,7 +114,7 @@ extrasReqs['sftp'] = [ 'paramiko', ] extrasReqs['mount'] = [ - 'fusepy>=2.0.4', + 'fusepy>=2.0.4,<3.0', ] init = os.path.join(os.path.dirname(__file__), 'girder', '__init__.py')
Pin fusepy to < <I> to prevent deadlocks in tests
girder_girder
train
py
0e26bd042c1aee1eb237c9787899fb0337988740
diff --git a/src/Charcoal/Admin/Widget/FormWidget.php b/src/Charcoal/Admin/Widget/FormWidget.php index <HASH>..<HASH> 100644 --- a/src/Charcoal/Admin/Widget/FormWidget.php +++ b/src/Charcoal/Admin/Widget/FormWidget.php @@ -15,6 +15,9 @@ use Psr\Http\Message\RequestInterface; // From 'charcoal-factory' use Charcoal\Factory\FactoryInterface; +// From 'charcoal-translator' +use Charcoal\Translator\Translation; + /// From 'charcoal-ui' use Charcoal\Ui\Form\FormInterface; use Charcoal\Ui\Form\FormTrait; @@ -454,6 +457,7 @@ class FormWidget extends AdminWidget implements */ public function formProperties() { + $sidebars = $this->sidebars; if (!is_array($sidebars)) { yield null; @@ -605,6 +609,17 @@ class FormWidget extends AdminWidget implements } /** + * @param string|Translation $label The submit label for the form. + * @return self + */ + public function setSubmitLabel($label) + { + $this->submitLabel = $this->translator()->translate($label); + + return $this; + } + + /** * Retrieve the default label for the form submission button. * * @return \Charcoal\Translator\Translation|null
Add the possibility to define the submit button label of a form widget
locomotivemtl_charcoal-admin
train
php
98c04616a66dd4fcc7404010af12c44da205e7ff
diff --git a/sh.py b/sh.py index <HASH>..<HASH> 100644 --- a/sh.py +++ b/sh.py @@ -793,7 +793,11 @@ class OProc(object): persist=True, pipe=STDOUT): self.call_args = call_args - if self.call_args["piped"] == "direct": self.call_args["tty_out"] = False + + # I had issues with getting 'Input/Output error reading stdin' from dd, + # until I set _tty_out=False + if self.call_args["piped"] == "direct": + self.call_args["tty_out"] = False self._single_tty = self.call_args["tty_in"] and self.call_args["tty_out"]
Added a comment explaining tty_out change (I had issues with getting 'Input/Output error reading stdin' from dd, until I set _tty_out=False)
amoffat_sh
train
py