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
c4fc75443d57ac973b05de5fd12e5ee63ace59ea
diff --git a/go/vt/vtgate/engine/online_ddl.go b/go/vt/vtgate/engine/online_ddl.go index <HASH>..<HASH> 100644 --- a/go/vt/vtgate/engine/online_ddl.go +++ b/go/vt/vtgate/engine/online_ddl.go @@ -21,6 +21,7 @@ import ( "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/vt/proto/query" + querypb "vitess.io/vitess/go/vt/proto/query" vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" "vitess.io/vitess/go/vt/schema" "vitess.io/vitess/go/vt/sqlparser" @@ -81,6 +82,17 @@ func (v *OnlineDDL) Execute(vcursor VCursor, bindVars map[string]*query.BindVari } result = &sqltypes.Result{ + Fields: []*querypb.Field{ + { + Name: "uuid", + Type: sqltypes.VarChar, + }, + }, + Rows: [][]sqltypes.Value{ + { + sqltypes.NewVarBinary(change.UUID), + }, + }, RowsAffected: 1, } return result, err
reporting back UUID in response to ALTER TABLE statement
vitessio_vitess
train
go
b1c9b0c7218784377cb9393d0d2c625132d9b5b4
diff --git a/drongo/request.py b/drongo/request.py index <HASH>..<HASH> 100644 --- a/drongo/request.py +++ b/drongo/request.py @@ -39,7 +39,7 @@ class Request(object): @property def method(self): - return self.env['REQUEST_METHOD'] + return self.env['REQUEST_METHOD'].upper() @property def path(self):
Always returning upper case for REQUEST_METHOD.
drongo-framework_drongo
train
py
8ef241ebe990edfa68681c76f828e4056d01090c
diff --git a/wafer/menu.py b/wafer/menu.py index <HASH>..<HASH> 100644 --- a/wafer/menu.py +++ b/wafer/menu.py @@ -104,7 +104,7 @@ class Menu(object): menu_items = self.items if menu is not None: matches = [item for item in menu_items - if "items" in item and item["menu"] == menu] + if "items" in item and item.get("menu") == menu] if len(matches) != 1: raise MenuError("Unable to find sub-menu %r." % (menu,)) menu_items = matches[0]["items"]
Not every menu has a menu key
CTPUG_wafer
train
py
26d0b58d58a03e2da1f2c43a70add5e1cc3e6db9
diff --git a/api/src/main/java/io/neba/api/spi/AnnotatedFieldMapper.java b/api/src/main/java/io/neba/api/spi/AnnotatedFieldMapper.java index <HASH>..<HASH> 100644 --- a/api/src/main/java/io/neba/api/spi/AnnotatedFieldMapper.java +++ b/api/src/main/java/io/neba/api/spi/AnnotatedFieldMapper.java @@ -36,9 +36,8 @@ import java.util.Map; * with a type <em>assignable to</em> {@link java.util.Collection}, e.g. List&lt;Resource&gt; or Set&lt;String&gt;. * </p> * <pre> - * &#64;Service - * &#64;Component(immediate = true) - * public class MyFieldMapper&lt;Collection, MyAnnotation&gt; { + * &#64;Component(service = { AnnotatedFieldMapper.class }) + * public class MyFieldMapper implements AnnotatedFieldMapper&lt;Collection, MyAnnotation&gt; { * public Class&lt;? extends Collection&gt; getFieldType() { * return Collection.class; * }
Corrected and updated javadoc with regard to current DS annotations
unic_neba
train
java
2bcfaae515eb751e020e2f4ea10963a6a72ac1b0
diff --git a/lib/capybara/spec/session/javascript.rb b/lib/capybara/spec/session/javascript.rb index <HASH>..<HASH> 100644 --- a/lib/capybara/spec/session/javascript.rb +++ b/lib/capybara/spec/session/javascript.rb @@ -109,11 +109,11 @@ shared_examples_for "session with javascript support" do end end - describe '#click' do + describe '#click_link_or_button' do it "should wait for asynchronous load" do @session.visit('/with_js') @session.click_link('Click me') - @session.click('Has been clicked') + @session.click_link_or_button('Has been clicked') end end
#click has been renamed #click_link_or_button
teamcapybara_capybara
train
rb
c1133e7aa616ec5beb27279bb311aaf2082142fc
diff --git a/files/chef-server-cookbooks/chef-server/recipes/erchef.rb b/files/chef-server-cookbooks/chef-server/recipes/erchef.rb index <HASH>..<HASH> 100644 --- a/files/chef-server-cookbooks/chef-server/recipes/erchef.rb +++ b/files/chef-server-cookbooks/chef-server/recipes/erchef.rb @@ -57,7 +57,7 @@ runit_service "erchef" do end if node['chef_server']['bootstrap']['enable'] - execute "/opt/chef-server/bin/chef-server-ctl erchef start" do + execute "/opt/chef-server/bin/chef-server-ctl start erchef" do retries 20 end end
course of is it: start erchef not and erchef start
chef_chef
train
rb
64dfb17693f73f56bef0b48ba303e2b601a6c7d3
diff --git a/keymap/vim.js b/keymap/vim.js index <HASH>..<HASH> 100644 --- a/keymap/vim.js +++ b/keymap/vim.js @@ -2416,11 +2416,14 @@ var charCoords = cm.charCoords(new Pos(lineNum, 0), 'local'); var height = cm.getScrollInfo().clientHeight; var y = charCoords.top; - var lineHeight = charCoords.bottom - y; switch (actionArgs.position) { - case 'center': y = y - (height / 2) + lineHeight; + case 'center': y = charCoords.bottom - height / 2; break; - case 'bottom': y = y - height + lineHeight; + case 'bottom': + var lineLastCharPos = new Pos(lineNum, cm.getLine(lineNum).length - 1); + var lineLastCharCoords = cm.charCoords(lineLastCharPos, 'local'); + var lineHeight = lineLastCharCoords.bottom - y; + y = y - height + lineHeight break; } cm.scrollTo(null, y);
[vim bindings] Fix zb and z- scrolling with wrapped lines
codemirror_CodeMirror
train
js
d4026fe9ba701e0bf203549d222684c9008154ff
diff --git a/functional_tests/test_curve_curve.py b/functional_tests/test_curve_curve.py index <HASH>..<HASH> 100644 --- a/functional_tests/test_curve_curve.py +++ b/functional_tests/test_curve_curve.py @@ -52,6 +52,12 @@ CURVE5 = bezier.Curve(np.array([ [0.5, -0.25], [1.0, 0.75], ])) +# g6 = sympy.Matrix([[]]) +CURVE6 = bezier.Curve(np.array([ + [0.0, 1.0], + [0.5, 0.0], + [1.0, 1.0], +])) class Config(object): # pylint: disable=too-few-public-methods @@ -188,6 +194,21 @@ def test_curves1_and_5(): curve_curve_check(CURVE1, CURVE5, s_vals, t_vals, points) [email protected] +def test_curves1_and_6(): + # NOTE: This clearly indicates there is a problem with + # duplicates of intersections. + s_vals = np.array([0.5, 0.5, 0.5, 0.5]) + t_vals = np.array([0.5, 0.5, 0.5, 0.5]) + points = np.array([ + [0.5, 0.5], + [0.5, 0.5], + [0.5, 0.5], + [0.5, 0.5], + ]) + curve_curve_check(CURVE1, CURVE6, s_vals, t_vals, points) + + def main(): Config.AS_SCRIPT = True for func in Config.MARKED:
Adding curve-curve tangency to functional tests.
dhermes_bezier
train
py
68ef58fb2b44d32e1658f6b58f5a8ccf8f595e49
diff --git a/angr/storage/paged_memory.py b/angr/storage/paged_memory.py index <HASH>..<HASH> 100644 --- a/angr/storage/paged_memory.py +++ b/angr/storage/paged_memory.py @@ -483,13 +483,12 @@ class SimPagedMemory: pass elif isinstance(self._memory_backer, cle.Clemory): # find permission backer associated with the address - # fall back to read-write if we can't find any... - flags = Page.PROT_READ | Page.PROT_WRITE + # fall back to default (read-write-maybe-exec) if can't find any for start, end in self._permission_map: if start <= new_page_addr < end: flags = self._permission_map[(start, end)] + new_page.permissions = claripy.BVV(flags, 3) break - new_page.permissions = claripy.BVV(flags, 3) # for each clemory backer which intersects with the page, apply its relevant data for backer_addr, backer in self._memory_backer.backers(new_page_addr):
Fix sources of truth for page permissions - fix a rex testcase
angr_angr
train
py
339834a15ee73188017099d4dd4cd6c527d115b4
diff --git a/numdifftools/limits.py b/numdifftools/limits.py index <HASH>..<HASH> 100644 --- a/numdifftools/limits.py +++ b/numdifftools/limits.py @@ -334,7 +334,8 @@ class Limit(object): # class Residue(Limit): # '''function [res,errest] = residueEst(fun,z0,varargin) -# residueEst: residue of fun at z0 with an error estimate, 1st or 2nd order pole +# residueEst: residue of fun at z0 with an error estimate, +# 1st or 2nd order pole # usage: [res,errest] = residueEst(fun,z0) # usage: [res,errest] = residueEst(fun,z0,prop1,val1,prop2,val2,...) #
Making a new release in order to upload to pypi
pbrod_numdifftools
train
py
743d78716454253a129eeb34846ff7bd9d3d7558
diff --git a/lib/webrat/core/configuration.rb b/lib/webrat/core/configuration.rb index <HASH>..<HASH> 100755 --- a/lib/webrat/core/configuration.rb +++ b/lib/webrat/core/configuration.rb @@ -70,12 +70,12 @@ module Webrat # Allows setting of webrat's mode, valid modes are: # :rails, :selenium, :rack, :sinatra, :mechanize, :merb def mode=(mode) - @mode = mode + @mode = mode.to_sym # This is a temporary hack to support backwards compatibility # with Merb 1.0.8 until it's updated to use the new Webrat.configure # syntax - if @mode.to_s == "merb" + if @mode == :merb require("webrat/merb_session") else require("webrat/#{mode}")
Ensure setting mode as a string works too
brynary_webrat
train
rb
8450f9d13cab5dc5bcd8855fcd205843d3406c7b
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -13,6 +13,9 @@ var path = require('path'); var PluginError = gutil.PluginError; var Stream = require('stream'); +// Consts +var PLUGIN_NAME = 'gulp-license-finder'; + function licenseFinder(filename, options) { if (typeof filename === 'object') { @@ -28,18 +31,16 @@ function licenseFinder(filename, options) { var stream = new Stream(); - var buffer = new Buffer(0); - nlf.find(options, function (err, data) { - if (err) { - // do something gulpy + throw new gutil.PluginError(PLUGIN_NAME, err, {showStack: true}); } var formatter = options.csv ? nlf.csvFormatter : nlf.standardFormatter; + formatter.render(data, function (err, output) { if (err) { - // do something gulpy + throw new gutil.PluginError(PLUGIN_NAME, err, {showStack: true}); } var file = new File({
Throw PluginError when exceptions happen
iandotkelly_gulp-license-finder
train
js
6454e45bf8cb4fe98366f5e588fb5e6c9c349f3e
diff --git a/databaseManager.js b/databaseManager.js index <HASH>..<HASH> 100644 --- a/databaseManager.js +++ b/databaseManager.js @@ -21,8 +21,8 @@ // - It trusts the trade data provider to send // enough data: if the tradeFetcher doesn't // keep up with the trades coming in, this -// manager doesn't know that the data is -// corrupted. +// manager cannot tell that the data is +// corrupted. And thus assumes it is not. // - The 1m candles are an internal datastructure // (referred to as fake candles), when clients // request candle data we convert the 1m diff --git a/exchanges/bitstamp.js b/exchanges/bitstamp.js index <HASH>..<HASH> 100644 --- a/exchanges/bitstamp.js +++ b/exchanges/bitstamp.js @@ -115,9 +115,8 @@ Trader.prototype.cancelOrder = function(order, callback) { // TODO: finish properly Trader.prototype.getTrades = function(since, callback, descending) { var process = function(err, result) { - // this.retry() if(err) - throw 'need to implement retry'; + return this.retry(this.bitstamp.transactions, process); callback(null, result.reverse()); };
implemented retry at bitstamp transactions
askmike_gekko
train
js,js
b8149a94f710dac0464f6f8de384e58bf91e64bb
diff --git a/lib/adapters/jugglingdb.js b/lib/adapters/jugglingdb.js index <HASH>..<HASH> 100644 --- a/lib/adapters/jugglingdb.js +++ b/lib/adapters/jugglingdb.js @@ -42,13 +42,19 @@ module.exports = function (jugglingdb) { function getFields(model, exclude, fieldsets) { var paths = module.exports.getPaths(model); var exclude_plus = exclude.concat([getPKName(model), 'id']); - var fields = paths.map(function (path) { - var fieldName = path._typeName + 'Field'; - if (fieldName in Fields) - return [path._path, new Fields[fieldName](path)]; - }).compact(); + var fields = paths + .filter(function (path) { + path._fieldName = path._typeName + 'Field'; + return path._fieldName in Fields; + }) + .map(function (path) { + return [path._path, new Fields[path._fieldName](path)]; + }) + .compact() + .object() + .omit(exclude_plus) + .valueOf(); - fields = fields.object().omit(exclude_plus).valueOf(); fieldsets.push({fields: Object.keys(fields)}); return fields; }
Refactor to pure functional -> increase coverage
node4good_formage
train
js
31167b4044de0511fdff726956edc2ffce0545ef
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -8,6 +8,7 @@ var moduleName = (function () { var i = 0; var name; var isExternal; + var obj = {}; while (i++ < length) { if ((/^--+(\w+)/i).test(args[i])){ @@ -20,7 +21,10 @@ var moduleName = (function () { } } - return { name,isExternal }; + obj.name = name; + obj.isExternal = isExternal; + + return obj; })();
udpate gulp file
qor_qor
train
js
b2254882ff292704771418432c029edd6de94993
diff --git a/bcbio/distributed/messaging.py b/bcbio/distributed/messaging.py index <HASH>..<HASH> 100644 --- a/bcbio/distributed/messaging.py +++ b/bcbio/distributed/messaging.py @@ -44,7 +44,6 @@ def parallel_runner(parallel, dirs, config, config_file=None): jobr = ipython.find_job_resources([fn], parallel, items, sysinfo, config, parallel.get("multiplier", 1), max_multicore=int(sysinfo["cores"])) - print jobr items = [ipython.add_cores_to_config(x, jobr.cores_per_job) for x in items] if joblib is None: raise ImportError("Need joblib for multiprocessing parallelization")
Better approach to avoiding overscheduling on multicore machines. Avoid limiting on cluster submissions due to per-machine core limits
bcbio_bcbio-nextgen
train
py
7a13f2da24bbb162633d9c88fc993756f82ae82a
diff --git a/js/bithumb.js b/js/bithumb.js index <HASH>..<HASH> 100644 --- a/js/bithumb.js +++ b/js/bithumb.js @@ -237,7 +237,7 @@ module.exports = class bithumb extends Exchange { let signature = this.hmac (this.encode (auth), this.encode (this.secret), 'sha512'); headers = { 'Api-Key': this.apiKey, - 'Api-Sign': this.stringToBase64 (this.encode (signature)), + 'Api-Sign': this.decode (this.stringToBase64 (this.encode (signature))), 'Api-Nonce': nonce, }; }
minor bithumb encoding issue in Python
ccxt_ccxt
train
js
67e3daa07b47c2bcb31a2db6770d1c9f622aaaec
diff --git a/Kwc/Directories/Item/Directory/Admin.php b/Kwc/Directories/Item/Directory/Admin.php index <HASH>..<HASH> 100644 --- a/Kwc/Directories/Item/Directory/Admin.php +++ b/Kwc/Directories/Item/Directory/Admin.php @@ -25,7 +25,7 @@ class Kwc_Directories_Item_Directory_Admin extends Kwc_Admin protected function _getPluginParentComponents() { - return array(); + return array($this->_class); } public final function getPluginAdmins()
ItemDirectory: Plugins are added automatically
koala-framework_koala-framework
train
php
87583809bcda6087f939e2d910825ae71352ea1e
diff --git a/rootpy/core.py b/rootpy/core.py index <HASH>..<HASH> 100644 --- a/rootpy/core.py +++ b/rootpy/core.py @@ -3,6 +3,7 @@ """ This module contains base classes defining core functionality """ +import os import ROOT import re import uuid @@ -10,6 +11,9 @@ import inspect from . import rootpy_globals +CONVERT_SNAKE_CASE = os.getenv('NO_ROOTPY_SNAKE_CASE', False) == False + + class RequireFile(object): def __init__(self): @@ -33,14 +37,6 @@ class RequireFile(object): return g -def wrap_call(cls, method, *args, **kwargs): - """ - Will provide more detailed info in the case that - a method call on a ROOT object raises a TypeError - """ - pass - - class _repr_mixin: def __str__(self): @@ -87,6 +83,8 @@ def snake_case_methods(cls, debug=False): A class decorator adding snake_case methods that alias capitalized ROOT methods """ + if not CONVERT_SNAKE_CASE: + return cls # Fix both the class and its corresponding ROOT base class #TODO use the class property on Object root_base = cls.__bases__[-1]
ability to switch off snake_case alias
rootpy_rootpy
train
py
edd634defdb32cc7e32698668239513c1f399921
diff --git a/openag/models.py b/openag/models.py index <HASH>..<HASH> 100644 --- a/openag/models.py +++ b/openag/models.py @@ -55,6 +55,8 @@ recipe. """ Recipe = Schema({ + "name": Any(str, unicode), + "description": Any(str, unicode), Required("format"): Any(str, unicode), Required("operations"): object }, extra=REMOVE_EXTRA)
Added optional name and description fields to recipes
OpenAgInitiative_openag_python
train
py
2c1bf8eab0408975d07feade1cac9ddf5f048074
diff --git a/lib/readthis/cache.rb b/lib/readthis/cache.rb index <HASH>..<HASH> 100644 --- a/lib/readthis/cache.rb +++ b/lib/readthis/cache.rb @@ -340,7 +340,7 @@ module Readthis name = "cache_#{operation}.active_support" payload = { key: key } - self.class.notifications.instrument(name, key) { yield(payload) } + self.class.notifications.instrument(name, payload) { yield(payload) } end def invoke(operation, key, &block)
ActiveSupport expects a hash as a payload
sorentwo_readthis
train
rb
6dfa25a732dae375b0b73600e173025ed73fb19d
diff --git a/src/Ssh/Sftp.php b/src/Ssh/Sftp.php index <HASH>..<HASH> 100644 --- a/src/Ssh/Sftp.php +++ b/src/Ssh/Sftp.php @@ -184,7 +184,7 @@ class Sftp extends Subsystem */ public function send($local, $distant) { - $this->write($distant, file_get_contents($local)); + return $this->write($distant, file_get_contents($local)); } /**
Fixed the return value in the send method.
Herzult_php-ssh
train
php
04ba9182cda51b79630aab2918bbc6bba2d99c23
diff --git a/lib/chef/digester.rb b/lib/chef/digester.rb index <HASH>..<HASH> 100644 --- a/lib/chef/digester.rb +++ b/lib/chef/digester.rb @@ -19,6 +19,7 @@ # require 'openssl' +require 'singleton' class Chef class Digester
Fix Digester to require its dependencies Without thus using rspec gets you: ``` uninitialized constant Chef::Digester::Singleton ```
chef_chef
train
rb
962fe3383616dc0cf756c1a0e8bfda853855d46c
diff --git a/lib/webmock.rb b/lib/webmock.rb index <HASH>..<HASH> 100644 --- a/lib/webmock.rb +++ b/lib/webmock.rb @@ -2,7 +2,7 @@ require 'singleton' require 'addressable/uri' require 'addressable/template' -require 'crack' +require 'crack/xml' require 'webmock/deprecation' require 'webmock/version' diff --git a/spec/unit/webmock_spec.rb b/spec/unit/webmock_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/webmock_spec.rb +++ b/spec/unit/webmock_spec.rb @@ -4,4 +4,8 @@ describe "WebMock version" do it "should report version" do expect(WebMock.version).to eq(WebMock::VERSION) end + + it "should not require safe_yaml" do + expect(defined?SafeYAML).to eq(nil) + end end
require only the necessary parts of crack to avoid pulling in safe_yaml
bblimke_webmock
train
rb,rb
a5176def3d9067e1aa3bfe8457f888ed45f422c9
diff --git a/activerecord/lib/active_record/store.rb b/activerecord/lib/active_record/store.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/store.rb +++ b/activerecord/lib/active_record/store.rb @@ -15,9 +15,9 @@ module ActiveRecord # You can set custom coder to encode/decode your serialized attributes to/from different formats. # JSON, YAML, Marshal are supported out of the box. Generally it can be any wrapper that provides +load+ and +dump+. # - # With PostgreSQL, the +store+ feature is not supported for field types such as Hstore - # or JSON because it would add an extra layer of serialization and this is not needed. - # Rely on +store_accessor+ instead. + # NOTE - If you are using special PostgreSQL columns like +hstore+ or +json+ there is no need for + # the serialization provieded by +store+. You can simply use +store_accessor+ instead to generate + # the accessor methods. # # Examples: #
refine usage docs of `store` in combination with `hstore` and `json`. refs #<I> #<I>
rails_rails
train
rb
3a8afc9a16e006eb38a6d4ba5392a29c5b6a4456
diff --git a/applications/jupyter-extension/nteract_on_jupyter/app/contents/file.js b/applications/jupyter-extension/nteract_on_jupyter/app/contents/file.js index <HASH>..<HASH> 100644 --- a/applications/jupyter-extension/nteract_on_jupyter/app/contents/file.js +++ b/applications/jupyter-extension/nteract_on_jupyter/app/contents/file.js @@ -58,12 +58,6 @@ export class TextFile extends React.PureComponent< this.props.handleChange(source); } componentDidMount() { - let oldEnv = window.MonacoEnvironment; - window.MonacoEnvironment = { - getWorkerUrl: function(moduleId, label) { - return window.assetURL + oldEnv.getWorkerUrl(moduleId, label); - } - }; import(/* webpackChunkName: "monaco-editor" */ "@nteract/monaco-editor").then( module => { this.setState({ Editor: module.default });
delete unused MonacoEnvironment (#<I>)
nteract_nteract
train
js
4dcb63053288d87a477fbe9fff8803a7c39ad5ec
diff --git a/python/tensorflow/ner/create_models.py b/python/tensorflow/ner/create_models.py index <HASH>..<HASH> 100644 --- a/python/tensorflow/ner/create_models.py +++ b/python/tensorflow/ner/create_models.py @@ -9,7 +9,7 @@ def create_graph(output_path, number_of_tags, embeddings_dimension, number_of_ch if sys.version_info[0] != 3 or sys.version_info[1] >= 7: raise Exception('Python 3.7 or above not supported by TensorFlow') if tf.__version__ != '1.15.0': - raise Exception('Spark NLP is compiled with TensorFlow 1.15.0. Please use such version.') + raise Exception(f'Spark NLP is compiled with TensorFlow 1.15.0. Please use such version and not {tf.__version__}.') tf.reset_default_graph() name_prefix = 'blstm' model_name = name_prefix+'_{}_{}_{}_{}'.format(number_of_tags, embeddings_dimension, lstm_size, number_of_chars)
Message specific for tensorflow exception
JohnSnowLabs_spark-nlp
train
py
8257ac25e88507d9ef7640c1fe0bfe74c1370ad3
diff --git a/cli/src/main/java/hudson/cli/CLI.java b/cli/src/main/java/hudson/cli/CLI.java index <HASH>..<HASH> 100644 --- a/cli/src/main/java/hudson/cli/CLI.java +++ b/cli/src/main/java/hudson/cli/CLI.java @@ -38,6 +38,8 @@ import hudson.remoting.SocketOutputStream; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; @@ -177,6 +179,21 @@ public class CLI { return channel; } + /** + * Attempts to lift the security restriction on the underlying channel. + * This requires the administer privilege on the server. + * + * @throws SecurityException + * If we fail to upgrade the connection. + */ + public void upgrade() { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + if (execute(Arrays.asList("groovy", "="), + new ByteArrayInputStream("hudson.remoting.Channel.current().setRestricted(false)".getBytes()), + out,out)!=0) + throw new SecurityException(out.toString()); // failed to upgrade + } + public static void main(final String[] _args) throws Exception { System.exit(_main(_args)); }
Added a mechanism to upgrade the channel to unrestricted one for programmatic clients.
jenkinsci_jenkins
train
java
2a377034c2c165ef407620cb7eb78a1af6a43097
diff --git a/state/backups/archive/workspace.go b/state/backups/archive/workspace.go index <HASH>..<HASH> 100644 --- a/state/backups/archive/workspace.go +++ b/state/backups/archive/workspace.go @@ -29,9 +29,8 @@ func newWorkspace(filename string) (*Workspace, error) { return nil, errors.Annotate(err, "while creating workspace dir") } - ar := NewArchive(filename, dirName) ws := Workspace{ - Archive: ar, + Archive: NewArchive(filename, dirName), rootDir: dirName, } return &ws, nil
Inline the NewArchive call.
juju_juju
train
go
db6348eaf3c8e622efafd21bc32c36455f8b7973
diff --git a/pyes/utils/__init__.py b/pyes/utils/__init__.py index <HASH>..<HASH> 100644 --- a/pyes/utils/__init__.py +++ b/pyes/utils/__init__.py @@ -24,7 +24,7 @@ def make_id(value): :return: a string """ if isinstance(value, six.string_types): - value=value.encode("utf8", errors="ignore") + value=value.encode("utf8", "ignore") from hashlib import md5 val = uuid.UUID(bytes=md5(value).digest(), version=4)
Backwards compatibility for python < 3 Python <I> doesn't support keyword arguments for str.encode. Positional arguments work for both Python 2 and 3. Missed one.
aparo_pyes
train
py
89b2a9a0aa14647110a175e96aec9109babf9afa
diff --git a/lib/plugins/filter/before_post_render/titlecase.js b/lib/plugins/filter/before_post_render/titlecase.js index <HASH>..<HASH> 100644 --- a/lib/plugins/filter/before_post_render/titlecase.js +++ b/lib/plugins/filter/before_post_render/titlecase.js @@ -1,10 +1,11 @@ 'use strict'; -const titlecase = require('titlecase'); +let titlecase; function titlecaseFilter(data) { if (!this.config.titlecase || !data.title) return; + if (!titlecase) titlecase = require('titlecase'); data.title = titlecase(data.title); }
perf(titlecase): lazy require (#<I>)
hexojs_hexo
train
js
6a9526505cb9b7e980f35fc4e2b8ddf042c790ec
diff --git a/config/module.config.php b/config/module.config.php index <HASH>..<HASH> 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -45,10 +45,6 @@ return [ ], ], 'service_manager' => [ - 'invokables' => [ - 'UthandoFileManager\Service\ImageUploader' => 'UthandoFileManager\Service\ImageUploader', - 'UthandoFileManager\Service\Uploader' => 'UthandoFileManager\Service\Uploader', - ], 'factories' => [ 'UthandoFileManager\Options\FileManager' => 'UthandoFileManager\Service\Factory\FileManagerOptions', ], @@ -59,6 +55,12 @@ return [ 'UthandoFileManagerImage' => 'UthandoFileManager\Model\Image', ], ], + 'uthando_services' => [ + 'invokables' => [ + 'UthandoFileManagerImage' => 'UthandoFileManager\Service\ImageUploader', + ' UthandoFileManagerUploader' => 'UthandoFileManager\Service\Uploader', + ] + ], 'validators' => [ 'invokables' => [ 'fileisimage' => 'UthandoFileManager\Validator\IsImage',
fixed exception when calling the ajax form
uthando-cms_uthando-file-manager
train
php
88ee7fd61d67d5f2d0eca26178ac359166ee4d01
diff --git a/src/abcWalletTxLib-TRD.js b/src/abcWalletTxLib-TRD.js index <HASH>..<HASH> 100644 --- a/src/abcWalletTxLib-TRD.js +++ b/src/abcWalletTxLib-TRD.js @@ -57,7 +57,7 @@ class WalletLocalData { // Map of gap limit addresses this.gapLimitAddresses = [] - // Array of ABCTransaction objects sorted by date + // Array of ABCTransaction objects sorted by date from newest to oldest this.transactionsArray = [] // Array of txids to fetch @@ -329,7 +329,7 @@ class ABCTxLibTRD { } sortTxByDate(a, b) { - return a.date - b.date + return b.date - a.date } addTransaction (abcTransaction) {
Sort arrayTransactions by newest to oldest
EdgeApp_edge-currency-ethereum
train
js
3e9b943f0bdb82a694c64354aa00a62ce69403d5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -50,6 +50,7 @@ EXTRA_DEPENDENCIES = { 'pep8', 'pylint', 'isort', + 'wheel', 'bumpversion'], }
Add wheel as a dev dependency.
kdeldycke_chessboard
train
py
66477625f6be20d482b03456b449e99376382e3b
diff --git a/src/test/java/io/nats/client/ConnectionImplTest.java b/src/test/java/io/nats/client/ConnectionImplTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/io/nats/client/ConnectionImplTest.java +++ b/src/test/java/io/nats/client/ConnectionImplTest.java @@ -94,7 +94,7 @@ import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockingDetails; import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
Updated Mockito import location
nats-io_java-nats
train
java
eb3e19a7e5ef3862bb9aea3de7050a54883fcaaf
diff --git a/lib/spanx/notifier/campfire.rb b/lib/spanx/notifier/campfire.rb index <HASH>..<HASH> 100644 --- a/lib/spanx/notifier/campfire.rb +++ b/lib/spanx/notifier/campfire.rb @@ -8,8 +8,8 @@ module Spanx attr_accessor :enabled, :account, :room_id, :token def initialize(config) - @enabled = config[:enabled] - return unless enabled + @enabled = config[:config][:enabled] + return unless @enabled _init(config[:campfire][:account], config[:campfire][:room_id], config[:campfire][:token]) end diff --git a/spec/spanx/whitelist_spec.rb b/spec/spanx/whitelist_spec.rb index <HASH>..<HASH> 100644 --- a/spec/spanx/whitelist_spec.rb +++ b/spec/spanx/whitelist_spec.rb @@ -55,5 +55,12 @@ describe Spanx::Whitelist do end end + context "users/me matches" do + let(:log) { %Q{66.249.73.24 - - [18/Oct/2012:03:25:33 -0700] GET /users/me HTTP/1.1 "200" 3943 "-" "-" "Mozilla/5.0 } } + it "excludes users/me" do + whitelist.match?(log).should be_true + end + end + end end
Fixing a bug with enabled.
wanelo_spanx
train
rb,rb
0e8ce0dd731e34f52a497fe94c766b1a7ea68361
diff --git a/lib/onebox/engine/whitelisted_generic_onebox.rb b/lib/onebox/engine/whitelisted_generic_onebox.rb index <HASH>..<HASH> 100644 --- a/lib/onebox/engine/whitelisted_generic_onebox.rb +++ b/lib/onebox/engine/whitelisted_generic_onebox.rb @@ -36,6 +36,7 @@ module Onebox cnet.com cnn.com collegehumor.com + consider.it coursera.org codepen.io cracked.com
Adding consider.it to onebox whitelist Full thread at <URL>
discourse_onebox
train
rb
b531af4eaf9ce0b7ee88cc2712b63d290d16d628
diff --git a/lib/watch/js.js b/lib/watch/js.js index <HASH>..<HASH> 100644 --- a/lib/watch/js.js +++ b/lib/watch/js.js @@ -13,6 +13,8 @@ const fs = require('fs') let scripts = [] +const srcCache = {} + module.exports = function() { chrome.on('Debugger.scriptParsed', scriptParsed) scripts = session.get('scripts') || [] @@ -51,10 +53,15 @@ function scriptParsed(script) { function inject(script, content, file) { log.debug(file, 'changed, compiling...') + const src = content.code || content + if (srcCache[script.scriptId] === src) + return refresh(file) + save(script) + srcCache[script.scriptId] = src return chrome.send('Debugger.setScriptSource', { scriptId: script.scriptId, - scriptSource: jail(content.code || content) + scriptSource: jail(src) }).then(result => { if (result.callFrames && result.callFrames.length === 0 && result.stackChanged === false) log.debug('Injected', script.path)
don't inject if nothing changed (causes chrome tab crash)
porsager_wright
train
js
11b2220696db691cdb0a5ca4962f8d0bc9320075
diff --git a/cmd/erasure-object.go b/cmd/erasure-object.go index <HASH>..<HASH> 100644 --- a/cmd/erasure-object.go +++ b/cmd/erasure-object.go @@ -328,7 +328,9 @@ func (er erasureObjects) getObjectWithFileInfo(ctx context.Context, bucket, obje } if scan != madmin.HealUnknownScan { healOnce.Do(func() { - go healObject(bucket, object, fi.VersionID, scan) + if _, healing := er.getOnlineDisksWithHealing(); !healing { + go healObject(bucket, object, fi.VersionID, scan) + } }) } } @@ -438,7 +440,9 @@ func (er erasureObjects) getObjectFileInfo(ctx context.Context, bucket, object s // if missing metadata can be reconstructed, attempt to reconstruct. if missingBlocks > 0 && missingBlocks < readQuorum { - go healObject(bucket, object, fi.VersionID, madmin.HealNormalScan) + if _, healing := er.getOnlineDisksWithHealing(); !healing { + go healObject(bucket, object, fi.VersionID, madmin.HealNormalScan) + } } return fi, metaArr, onlineDisks, nil
Don't autoheal if disks are healing (#<I>) Don't spawn automatic healing ops if a disk is healing.
minio_minio
train
go
1d8f1311fc825e338290107135ca274d91d4665b
diff --git a/datajoint/relational_operand.py b/datajoint/relational_operand.py index <HASH>..<HASH> 100644 --- a/datajoint/relational_operand.py +++ b/datajoint/relational_operand.py @@ -63,9 +63,8 @@ class AndList(Sequence): # mappings are turned into ANDed equality conditions if isinstance(arg, Mapping): - condition = ['`%s`=%s' % - (k, repr(v) if not - isinstance(v, (datetime.date, datetime.datetime, datetime.time)) else repr(str(v))) + condition = ['`%s`=%r' % + (k, v if not isinstance(v, (datetime.date, datetime.datetime, datetime.time)) else str(v)) for k, v in arg.items() if k in self.heading] elif isinstance(arg, np.void): # element of a record array
syntax improvement suggested by eywalker
datajoint_datajoint-python
train
py
9d301f7cae9ef20aaf0c4f081ca181539d9a6624
diff --git a/discord/state.py b/discord/state.py index <HASH>..<HASH> 100644 --- a/discord/state.py +++ b/discord/state.py @@ -325,7 +325,7 @@ class ConnectionState: for guild_data in data['guilds']: guild = self._add_guild_from_data(guild_data) if (not self.is_bot and not guild.unavailable) or guild.large: - guilds.append(guild) + guilds.append((guild, guild.unavailable)) for relationship in data.get('relationships', []): try:
Store guild, unavailable tuple in ready as well This should fix userbots. Fixes: <I>cd ("don't drop guild_available/join before ready")
Rapptz_discord.py
train
py
cdb8d6e761d39790655064895e35611a40dfe813
diff --git a/library/networks/ffnnalfa.js b/library/networks/ffnnalfa.js index <HASH>..<HASH> 100644 --- a/library/networks/ffnnalfa.js +++ b/library/networks/ffnnalfa.js @@ -22,10 +22,10 @@ let NetworkAlpha = function(configuration) { synapseGenerator: Synapse }; - if (!this.checkConfiguration(this.configuration)) { + if (!this.checkConfiguration()) { throw "Invalid FFNNALFA Engine Configuration"; } - this.configuration = this.transformConfiguration(this.configuration); + this.configuration = this.transformConfiguration(); this.dataRepository = this.configuration.dataRepository; @@ -34,12 +34,12 @@ let NetworkAlpha = function(configuration) { } NetworkAlpha.prototype = { - checkConfiguration: function(configuration) { + checkConfiguration: function() { return true; }, - transformConfiguration: function(configuration) { - return configuration; + transformConfiguration: function() { + return this.configuration; }, set neurons(value) {
Updated configuration verification skeleton of the FFNNALFA network.
antoniodeluca_dn2a.js
train
js
dee50e66629bfd6cca1106cb395e838ff1286a27
diff --git a/easyaudit/middleware/easyaudit.py b/easyaudit/middleware/easyaudit.py index <HASH>..<HASH> 100644 --- a/easyaudit/middleware/easyaudit.py +++ b/easyaudit/middleware/easyaudit.py @@ -32,3 +32,17 @@ class EasyAuditMiddleware(MiddlewareMixin): def process_request(self, request): _thread_locals.request = request return None + + def process_response(self, request, response): + try: + del _thread_locals.request + except AttributeError: + pass + return response + + def process_exception(self, request, exception): + try: + del _thread_locals.request + except AttributeError: + pass + return None
Clear out _thread_locals.request It's important to clear out _thread_locals.request (which easy_audit sets in `process_request`) after the request has been handled, or else the stale request will keep hanging around. See <URL>
soynatan_django-easy-audit
train
py
314173afdd3638963393b45cf6d18f77aa1eb074
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setup( license='MIT', packages=find_packages(exclude=('example', 'tests')), install_requires=[ - 'Django>=1.4.2,<1.4.99,>=1.7,<1.8.99', + 'Django>=1.4.2,<1.8.99,!=1.5,!=1.6', 'django_otp>=0.2.0,<0.2.99', 'qrcode>=4.0.0,<4.99', ],
Fixed issue with pip unable to install package
Bouke_django-two-factor-auth
train
py
9b5f0fac81367b9a1b4d09b87b9a8bd0fc92635a
diff --git a/commands.go b/commands.go index <HASH>..<HASH> 100644 --- a/commands.go +++ b/commands.go @@ -374,6 +374,8 @@ func (srv *Server) CmdImport(stdin io.ReadCloser, stdout io.Writer, args ...stri } if u.Scheme == "" { u.Scheme = "http" + u.Host = src + u.Path = "" } fmt.Fprintf(stdout, "Downloading from %s\n", u.String()) // Download with curl (pretty progress bar)
Fix 'docker import' to accept urls without explicit http:// scheme
moby_moby
train
go
c4e0560d684536fde331b32977ecbbe1af0b03ee
diff --git a/httpcache4j-api/src/test/java/org/codehaus/httpcache4j/HeadersTest.java b/httpcache4j-api/src/test/java/org/codehaus/httpcache4j/HeadersTest.java index <HASH>..<HASH> 100644 --- a/httpcache4j-api/src/test/java/org/codehaus/httpcache4j/HeadersTest.java +++ b/httpcache4j-api/src/test/java/org/codehaus/httpcache4j/HeadersTest.java @@ -50,6 +50,14 @@ public class HeadersTest { } @Test + public void testParseDateHeader() { + String value = "Fri, 20 Feb 2009 12:26:45 GMT"; + DateTime dateTime = HeaderUtils.fromHttpDate(new Header(HeaderConstants.DATE, value)); + assertNotNull(dateTime); + assertEquals(value, HeaderUtils.toHttpDate(HeaderConstants.DATE, dateTime).getValue()); + } + + @Test public void testParseDirectives() { Header header = new Header(HeaderConstants.CACHE_CONTROL, "private, max-age=60"); assertNotNull(header.getDirectives());
- Added a reverse test for parsing a date to date time. git-svn-id: file:///home/projects/httpcache4j/tmp/scm-svn-tmp/trunk@<I> aeef7db8-<I>a-<I>-b<I>-bac<I>ff<I>f6
httpcache4j_httpcache4j
train
java
59cd79b9847554de707292fa98636e2333e3ee34
diff --git a/django_sorting/templatetags/sorting_tags.py b/django_sorting/templatetags/sorting_tags.py index <HASH>..<HASH> 100644 --- a/django_sorting/templatetags/sorting_tags.py +++ b/django_sorting/templatetags/sorting_tags.py @@ -149,7 +149,7 @@ class SortedDataNode(template.Node): queryset = self.queryset_var.resolve(context) ordering = context['request'].field - if len(ordering) > 1: + if ordering: try: if self.need_python_sorting(queryset, ordering): # Fallback on pure Python sorting (much slower on large data) @@ -158,6 +158,9 @@ class SortedDataNode(template.Node): # extract this information if we want to sort on simple object # attributes (non-model fields) if ordering[0] == '-': + if len(ordering) == 1: + raise template.TemplateSyntaxError + reverse = True name = ordering[1:] else:
Allow to sort on field with only one character in its name
webstack_webstack-django-sorting
train
py
39692817385dcdce475652eb5766d944ec5ccd7e
diff --git a/src/watoki/tempan/Renderer.php b/src/watoki/tempan/Renderer.php index <HASH>..<HASH> 100644 --- a/src/watoki/tempan/Renderer.php +++ b/src/watoki/tempan/Renderer.php @@ -3,6 +3,8 @@ namespace watoki\tempan; class Renderer { + static $CLASS = __CLASS__; + /** * @var HtmlParser */
added $CLASS property to Renderer
watoki_tempan
train
php
43174b700abaf8486a44d838c4b82cef9ee88afc
diff --git a/sixpack/models.py b/sixpack/models.py index <HASH>..<HASH> 100644 --- a/sixpack/models.py +++ b/sixpack/models.py @@ -462,7 +462,7 @@ class Alternative(object): 'name': self.name, 'data': data, 'control': self.is_control(), - 'conversion_rate': self.conversion_rate(), + 'conversion_rate': float('%.2f' % (self.conversion_rate() * 100)), 'z_score': self.z_score() }
better response for conversion rate in json endpoint
sixpack_sixpack
train
py
5d8c2b559f54e852e90b9e8a5dfc34db38a603f2
diff --git a/spec/parse_spec.rb b/spec/parse_spec.rb index <HASH>..<HASH> 100644 --- a/spec/parse_spec.rb +++ b/spec/parse_spec.rb @@ -663,6 +663,13 @@ describe "Delorean" do end + xit "should parse cross list comprehension" do + engine.parse defn("A:", + " b = [a+c for c in [4,5] for a in [1,2,3]]", + ) + + end + it "should accept list comprehension variable override" do engine.parse defn("A:", " b = [b+1 for b in [1,2,3]]",
added pending spec test for nested list comprehension
arman000_delorean_lang
train
rb
9b1c5e56440408430db647c7cbf61c819cd8e6da
diff --git a/src/main/java/io/github/bonigarcia/seljup/handler/DockerDriverHandler.java b/src/main/java/io/github/bonigarcia/seljup/handler/DockerDriverHandler.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/github/bonigarcia/seljup/handler/DockerDriverHandler.java +++ b/src/main/java/io/github/bonigarcia/seljup/handler/DockerDriverHandler.java @@ -1098,8 +1098,8 @@ public class DockerDriverHandler { if (fileString.contains(":")) { // Windows fileString = toLowerCase(fileString.charAt(0)) + fileString.substring(1); - fileString = fileString.replaceAll("\\\\", "/"); - fileString = fileString.replaceAll(":", ""); + fileString = fileString.replace("\\\\", "/"); + fileString = fileString.replace(":", ""); fileString = "/" + fileString; } log.trace("The path of file {} in Docker format is {}", file,
Smell-fix: use replace() instead of replaceAll()
bonigarcia_selenium-jupiter
train
java
57a1f5e5000a14b37dc1048ebaa2b28b72ade51a
diff --git a/cmd/influxd/server_integration_test.go b/cmd/influxd/server_integration_test.go index <HASH>..<HASH> 100644 --- a/cmd/influxd/server_integration_test.go +++ b/cmd/influxd/server_integration_test.go @@ -255,7 +255,6 @@ var mergeMany = func(t *testing.T, node *Node, database, retention string) { for j := 1; j < 5+i%3; j++ { data := fmt.Sprintf(`{"database": "%s", "retentionPolicy": "%s", "points": [{"name": "cpu", "timestamp": "%s", "tags": {"host": "server_%d"}, "fields": {"value": 22}}]}`, database, retention, time.Unix(int64(j), int64(0)).Format(time.RFC3339), i) - fmt.Println(data) write(t, node, data) }
Remove debug fmt.Println from tests
influxdata_influxdb
train
go
a3ee876119e62f41c9b1cadb1cd1cd28f4de94f6
diff --git a/src/js/components/layouts/HtmlView.js b/src/js/components/layouts/HtmlView.js index <HASH>..<HASH> 100644 --- a/src/js/components/layouts/HtmlView.js +++ b/src/js/components/layouts/HtmlView.js @@ -35,7 +35,7 @@ class HtmlView extends React.Component { return ( <div className="fill scroll"> {this.props.ready ? - <div className="container"> + <div className={this.props.storeDesc.hideHeader ? "" : "container"}> <div dangerouslySetInnerHTML={this.createMarkup()}> </div> </div> :
temporary removed classname:container for HtmlView when hideHeader property in true.
getblank_blank-web-app
train
js
78085fab1fba273ed8048c385a8927f2a6535bdc
diff --git a/spacy/cli/download.py b/spacy/cli/download.py index <HASH>..<HASH> 100644 --- a/spacy/cli/download.py +++ b/spacy/cli/download.py @@ -35,7 +35,7 @@ def download_cli( def download(model: str, direct: bool = False, *pip_args) -> None: - if not is_package("spacy") and "--no-deps" not in pip_args: + if not (is_package("spacy") or is_package("spacy-nightly")) and "--no-deps" not in pip_args: msg.warn( "Skipping pipeline package dependencies and setting `--no-deps`. " "You don't seem to have the spaCy package itself installed "
Check for spacy-nightly package in download (#<I>) Also check for spacy-nightly in download so that `--no-deps` isn't set for normal nightly installs.
explosion_spaCy
train
py
4e79908f688e8618f72643a117dc59c4d64cedd8
diff --git a/tests/test_var_builtin.py b/tests/test_var_builtin.py index <HASH>..<HASH> 100644 --- a/tests/test_var_builtin.py +++ b/tests/test_var_builtin.py @@ -18,13 +18,6 @@ class TestVAR(unittest.TestCase): def tearDown(self): pass - def test_simulate(self): - var = VAR(2) - var.coef = np.array([[0.2, 0.1, 0.4, -0.1], [0.3, -0.2, 0.1, 0]]) - l = 1000 - x = var.simulate(l) - self.assertEqual(x.shape, (1, 2, l)) - def test_fit(self): var0 = VAR(2) var0.coef = np.array([[0.2, 0.1, 0.4, -0.1], [0.3, -0.2, 0.1, 0]])
Removed simulation test from higher level VAR testing
scot-dev_scot
train
py
2769d7cf9c909692050eb18f337734b452b82735
diff --git a/helper/schema/field_writer_map.go b/helper/schema/field_writer_map.go index <HASH>..<HASH> 100644 --- a/helper/schema/field_writer_map.go +++ b/helper/schema/field_writer_map.go @@ -294,14 +294,18 @@ func (w *MapFieldWriter) setSet( k := strings.Join(addr, ".") - if value != nil { - for code, elem := range value.(*Set).m { - codeStr := strconv.FormatInt(int64(code), 10) - if err := w.set(append(addrCopy, codeStr), elem); err != nil { - return err - } + if value == nil { + w.result[k+".#"] = "0" + return nil + } + + for code, elem := range value.(*Set).m { + codeStr := strconv.FormatInt(int64(code), 10) + if err := w.set(append(addrCopy, codeStr), elem); err != nil { + return err } - w.result[k+".#"] = strconv.Itoa(value.(*Set).Len()) } + + w.result[k+".#"] = strconv.Itoa(value.(*Set).Len()) return nil }
Fixes #<I>: Ensuring set count (.#) is written to the state
hashicorp_terraform
train
go
31da6ce7c51da8700b49484998c7eb53704d9b9e
diff --git a/src/svg.connectable.js b/src/svg.connectable.js index <HASH>..<HASH> 100644 --- a/src/svg.connectable.js +++ b/src/svg.connectable.js @@ -92,10 +92,10 @@ var sPos = con.source.bbox(); var tPos = con.target.bbox(); - var x1 = sPos.x + sPos.width / 2; - var y1 = sPos.y + sPos.height / 2; - var x2 = tPos.x + tPos.width / 2; - var y2 = tPos.y + tPos.height / 2; + var x1 = sPos.x2 + sPos.width / 2; + var y1 = sPos.y2 + sPos.height / 2; + var x2 = tPos.x2 + tPos.width / 2; + var y2 = tPos.y2 + tPos.height / 2; return { x1: x1,
Trying with x2 and y2 instead
jillix_svg.connectable.js
train
js
e6766e53b71de16a4c21d2435d5ed6c883bcf569
diff --git a/synphot/spectrum.py b/synphot/spectrum.py index <HASH>..<HASH> 100644 --- a/synphot/spectrum.py +++ b/synphot/spectrum.py @@ -741,7 +741,7 @@ class BaseSpectrum(object): Parameters ---------- wavelengths : array-like, `~astropy.units.quantity.Quantity`, or `None` - Wavelength values for integration. + Wavelength values for sampling. If not a Quantity, assumed to be in Angstrom. If `None`, `waveset` is used.
DOC: Fix plot docstring [docs only]
spacetelescope_synphot_refactor
train
py
ffbea543a6e259b575c68bf52f61d42fc6f9991d
diff --git a/spec/lib/pad_spec.rb b/spec/lib/pad_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/pad_spec.rb +++ b/spec/lib/pad_spec.rb @@ -7,7 +7,7 @@ describe Pad do let(:builder) { double 'builder' } let(:default_builder) { Pad.config.builder} - [:model, :model, :value_object].each do |method| + [:model, :entity, :value_object].each do |method| describe method do context 'with default builder' do it { should delegate(method).with(options).to(default_builder).with_block }
Added entity specs (typo as model was listed twice)
dwhelan_pad
train
rb
e911e2d904641f8149443879ef0d71ef9825e9b5
diff --git a/lib/faraday/request/oauth.rb b/lib/faraday/request/oauth.rb index <HASH>..<HASH> 100644 --- a/lib/faraday/request/oauth.rb +++ b/lib/faraday/request/oauth.rb @@ -6,8 +6,12 @@ module Faraday def call(env) params = env[:body] || {} - - signature_params = params.reject{ |k,v| v.respond_to?(:content_type) } + + con = false + env[:request_headers].each do |k,v| + con = true if v.to_s.downcase == "application/x-www-form-urlencoded" + end + signature_params = con ? params.reject{ |k,v| v.respond_to?(:content_type) } : {} header = SimpleOAuth::Header.new(env[:method], env[:url], signature_params, @options)
Fixed an issue where OAuth was not encoding the entire body on non application/x-www-form-urlencoded POST requests.
lostisland_faraday_middleware
train
rb
f8cb67862771a51ea4153a7f4b88636713d51d6b
diff --git a/src/Moxl/Xec/Payload/Message.php b/src/Moxl/Xec/Payload/Message.php index <HASH>..<HASH> 100644 --- a/src/Moxl/Xec/Payload/Message.php +++ b/src/Moxl/Xec/Payload/Message.php @@ -47,17 +47,15 @@ class Message extends Payload } $m = new \Modl\Message; - $promise = $m->set($stanza, $parent); + $m->set($stanza, $parent); - $promise->done(function() use ($m) { - if(!preg_match('#^\?OTR#', $m->body)) { - $md = new \Modl\MessageDAO; - $md->set($m); + if(!preg_match('#^\?OTR#', $m->body)) { + $md = new \Modl\MessageDAO; + $md->set($m); - $this->pack($m); - $this->deliver(); - } - }); + $this->pack($m); + $this->deliver(); + } } } }
Remove checkPicture to prevent synchronisation issues
movim_moxl
train
php
663313f62d93395adc78c78fdf93bf97a0a485ca
diff --git a/executionserver/executionserver.methods.js b/executionserver/executionserver.methods.js index <HASH>..<HASH> 100644 --- a/executionserver/executionserver.methods.js +++ b/executionserver/executionserver.methods.js @@ -36,8 +36,8 @@ module.exports = function (conf) { }); handler.Joijobstatus = Joi.object().keys({ - status: Joi.string().required(), - jobid: Joi.string().valid('CREATE', 'DOWNLOADING', 'RUN', 'FAIL', 'KILL', 'UPLOADING', 'EXIT', 'DONE'), + status: Joi.string().valid('CREATE', 'DOWNLOADING', 'RUN', 'FAIL', 'KILL', 'UPLOADING', 'EXIT', 'DONE'), + jobid: Joi.number().optional(), error: Joi.optional(), downloadstatus: Joi.object().optional(), uploadstatus: Joi.object().optional()
BUG: Job status validation on execution server
juanprietob_clusterpost
train
js
8dd3460a47702baecc338e942472a0528abe6a6c
diff --git a/src/Window.js b/src/Window.js index <HASH>..<HASH> 100644 --- a/src/Window.js +++ b/src/Window.js @@ -419,13 +419,16 @@ OO.ui.Window.prototype.close = function ( data ) { } // Close the window - this.opened.resolve(); // This.closing needs to exist before we emit the closing event so that handlers can call // window.close() and trigger the safety check above this.closing = $.Deferred(); this.frame.$content.find( ':focus' ).blur(); this.emit( 'closing', data ); this.getTeardownProcess( data ).execute().done( OO.ui.bind( function () { + // To do something different with #opened, resolve/reject #opened in the teardown process + if ( !this.opened.isResolved() && !this.opened.isRejected() ) { + this.opened.resolve(); + } this.emit( 'close', data ); this.$element.hide(); this.visible = false;
Resolve the opened promise after teardown Allow a window's teardown process to resolve/reject the opened promise if desired, making it possible to extend the behavior of window without wrapping the close method. Change-Id: I<I>a5bf7e7a<I>a<I>a<I>fd<I>cdd<I>b5
wikimedia_oojs-ui
train
js
0309a79b913d5d6f4f957e11e65c6d814371e915
diff --git a/tests/unit/test_manager.py b/tests/unit/test_manager.py index <HASH>..<HASH> 100644 --- a/tests/unit/test_manager.py +++ b/tests/unit/test_manager.py @@ -374,7 +374,6 @@ class TestTendrilManager(unittest.TestCase): self.assertEqual(result, None) self.assertFalse(tm._local_addr_event.wait.called) - self.assertFalse(tm._local_addr_event.is_set.called) def test_get_local_addr_notset(self): tm = ManagerForTest()
We're not using is_set() anymore.
klmitch_tendril
train
py
f9a8a2f5cc19ea88294a5ade19ec92bc3336baf0
diff --git a/Tests/DependencyInjection/FabienCrassatCurriculumVitaeExtensionTest.php b/Tests/DependencyInjection/FabienCrassatCurriculumVitaeExtensionTest.php index <HASH>..<HASH> 100644 --- a/Tests/DependencyInjection/FabienCrassatCurriculumVitaeExtensionTest.php +++ b/Tests/DependencyInjection/FabienCrassatCurriculumVitaeExtensionTest.php @@ -11,8 +11,8 @@ namespace FabienCrassat\CurriculumVitaeBundle\Tests\DependencyInjection; -use FabienCrassat\CurriculumVitaeBundle\DependencyInjection\FabienCrassatCurriculumVitaeExtension; -use Symfony\Component\DependencyInjection\ContainerBuilder; +use FabienCrassat\CurriculumVitaeBundle\DependencyInjection\FabienCrassatCurriculumVitaeExtension; +use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Yaml\Parser; /**
Scrutinizer Auto-Fixes This patch was automatically generated as part of the following inspection: <URL>
fabiencrassat_CurriculumVitaeBundle
train
php
b9570486a2494bd517bb1381056b5b1c41e9e38c
diff --git a/pyperclip/__init__.py b/pyperclip/__init__.py index <HASH>..<HASH> 100644 --- a/pyperclip/__init__.py +++ b/pyperclip/__init__.py @@ -23,7 +23,7 @@ Otherwise on Linux, you will need the gtk or PyQt5/PyQt4 modules installed. gtk and PyQt4 modules are not available for Python 3, and this module does not work with PyGObject yet. """ -__version__ = '1.5.28' +__version__ = '1.5.29' import platform import os
Bumping version to <I>
asweigart_pyperclip
train
py
a956de09fd857e4150a8d19a453f1055af9f24c9
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/properties_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/properties_controller.rb index <HASH>..<HASH> 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/properties_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/properties_controller.rb @@ -156,7 +156,7 @@ class Api::PropertiesController < Api::ApiController end def allowed?(property_key) - !property_key.end_with?('.secured') || is_admin? + !property_key.end_with?('.secured') || is_admin? || (property_key.include?(".license") && logged_in?) end def get_default_property(key)
SONAR-<I> WS api/properties should return licenses if user is authenticated (#<I>)
SonarSource_sonarqube
train
rb
af883a9a815a14851f7686330162e88f56fc03be
diff --git a/lib/dtf.rb b/lib/dtf.rb index <HASH>..<HASH> 100644 --- a/lib/dtf.rb +++ b/lib/dtf.rb @@ -1,5 +1,5 @@ require "dtf/version" module Dtf - # Your code goes here... + load "#{File.join(File.dirname(__FILE__), "/config/environment.rb")}" end
Added logic to lib/dtf/rb to load the model files so that require 'dtf' autoloaded them
dtf-gems_dtf
train
rb
95e63fd9c9d3fea600a88e60485db29d34859d78
diff --git a/packages/babel/src/traversal/path/evaluation.js b/packages/babel/src/traversal/path/evaluation.js index <HASH>..<HASH> 100644 --- a/packages/babel/src/traversal/path/evaluation.js +++ b/packages/babel/src/traversal/path/evaluation.js @@ -175,8 +175,6 @@ export function evaluate(): { confident: boolean; value: any } { case "<<": return left << right; case ">>": return left >> right; case ">>>": return left >>> right; - case "in": return left in right; - case "instanceof": return left instanceof right; } }
evaluation: don't evaluate `in` and `instanceof` binary exp - fixes #<I>
babel_babel
train
js
71c5db7ffa25581a5c528acfc3423b9811335d41
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -82,6 +82,8 @@ } return function load(items) { - return Promise.all([].concat(items).map(exec)); + return items instanceof Array ? + Promise.all(items.map(exec)) : + exec(items); } });
fixed return type to make sure to return array if input is array.
MiguelCastillo_load-js
train
js
9776e847dbc0c29c6222d9493fddeb14eccf0024
diff --git a/spec/pg_closure_tree_rebuild_spec.rb b/spec/pg_closure_tree_rebuild_spec.rb index <HASH>..<HASH> 100644 --- a/spec/pg_closure_tree_rebuild_spec.rb +++ b/spec/pg_closure_tree_rebuild_spec.rb @@ -67,16 +67,20 @@ describe PgClosureTreeRebuild::Builder do end end - it '#rebuild' do - expect(db).to( - receive(:copy_into) - .with( - :table_hierarchies, - columns: [:ancestor_id, :descendant_id, :generations], - format: :binary, - data: anything - ) - ) - subject.rebuild(db) + context '#rebuild' do + let(:pgcopy) { %(PGCOPY\n\xFF\r\n\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0004) } + + it 'succeeds' do + expect(db).to( + receive(:copy_into) + .with( + :table_hierarchies, + columns: [:ancestor_id, :descendant_id, :generations], + format: :binary, + data: ->(v) { v[0..32] == pgcopy } + ) + ) + subject.rebuild(db) + end end end
Rebuild spec updated with PGCOPY verification
gzigzigzeo_pg_closure_tree_rebuild
train
rb
4f7d7975676c61ea613036ce105b5c3a0573310e
diff --git a/Structural/Composite/Tests/CompositeTest.php b/Structural/Composite/Tests/CompositeTest.php index <HASH>..<HASH> 100644 --- a/Structural/Composite/Tests/CompositeTest.php +++ b/Structural/Composite/Tests/CompositeTest.php @@ -16,6 +16,9 @@ class CompositeTest extends \PHPUnit_Framework_TestCase $embed->addElement(new Composite\InputElement()); $form->addElement($embed); + // This is just an example, in a real world scenario it is important to remember that web browsers do not + // currently support nested forms + $this->assertEquals( '<form>Email:<input type="text" /><form>Password:<input type="text" /></form></form>', $form->render()
Composite Test: Add information about nested forms Add information for composite pattern test to hopefully help to not mislead anyone viewing this test, into thinking that they can nest HTML form elements. Closes #<I>
domnikl_DesignPatternsPHP
train
php
dd9df6c8d49a639d06814d5f43261b7794645891
diff --git a/src/Command/CommandBase.php b/src/Command/CommandBase.php index <HASH>..<HASH> 100644 --- a/src/Command/CommandBase.php +++ b/src/Command/CommandBase.php @@ -1257,12 +1257,14 @@ abstract class CommandBase extends Command implements MultiAwareInterface $container = self::$container; self::$container = null; - $application->setCurrentCommand($command); - $result = $command->run($cmdInput, $output ?: $this->output); - $application->setCurrentCommand($this); - - // Restore the old service container. - self::$container = $container; + try { + $application->setCurrentCommand($command); + $result = $command->run($cmdInput, $output ?: $this->output); + } finally { + $application->setCurrentCommand($this); + // Restore the old service container. + self::$container = $container; + } return $result; }
Hotfix for: You have requested a non-existent service "input".
platformsh_platformsh-cli
train
php
732fd01cc580f356a1f85d78e2e87bc3445628c8
diff --git a/tests/func/test_repro.py b/tests/func/test_repro.py index <HASH>..<HASH> 100644 --- a/tests/func/test_repro.py +++ b/tests/func/test_repro.py @@ -127,9 +127,6 @@ class TestReproWorkingDirectoryAsOutput(TestDvc): self.dvc.reproduce(faulty_stage_path) def test_nested(self): - from dvc.stage import Stage - - # # . # |-- a # | |__ nested
test: drop a reimport (#<I>)
iterative_dvc
train
py
e13f6609e2bd232aa7adb445dc972af6164c8f57
diff --git a/modules/orionode/test/endpoints/test-file.js b/modules/orionode/test/endpoints/test-file.js index <HASH>..<HASH> 100644 --- a/modules/orionode/test/endpoints/test-file.js +++ b/modules/orionode/test/endpoints/test-file.js @@ -1593,7 +1593,7 @@ describe('File endpoint', function() { }); }) }); - it("testRenameFileChangeCase", function(done) { + it.skip("testRenameFileChangeCase", function(done) { var fileNameLowerCase = "testrenamefilechangecase"; var fileNameLowerCase2 = "testrenamefilechangecase2"; var fileNameUpperCase = "testRenameFileChangeCase";
Disable broken test. (#<I>) Test is broken in Travis. Please see output log: <URL>
eclipse_orion.client
train
js
ddfbf578367b5c6dd0e729bc8cc5e0859ac61518
diff --git a/src/main/java/com/github/tomakehurst/wiremock/admin/AdminRoutes.java b/src/main/java/com/github/tomakehurst/wiremock/admin/AdminRoutes.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/tomakehurst/wiremock/admin/AdminRoutes.java +++ b/src/main/java/com/github/tomakehurst/wiremock/admin/AdminRoutes.java @@ -80,7 +80,7 @@ public class AdminRoutes { router.add(GET, "/requests/unmatched/near-misses", FindNearMissesForUnmatchedTask.class); router.add(GET, "/requests/{id}", GetServedStubTask.class); - router.add(POST, "/snapshot", SnapshotTask.class); + router.add(POST, "/recordings/snapshot", SnapshotTask.class); router.add(POST, "/near-misses/request", FindNearMissesForRequestTask.class); router.add(POST, "/near-misses/request-pattern", FindNearMissesForRequestPatternTask.class);
Relocate snapshot endpoint to /recordings/snapshot
tomakehurst_wiremock
train
java
6ba2bf36eaf6612c8ddc7d7902f88bcb937bced8
diff --git a/lib/cl/version.rb b/lib/cl/version.rb index <HASH>..<HASH> 100644 --- a/lib/cl/version.rb +++ b/lib/cl/version.rb @@ -1,3 +1,3 @@ class Cl - VERSION = '0.1.7' + VERSION = '0.1.8' end
Bump cl to <I>
svenfuchs_cl
train
rb
3553b098e27c32df3c3c0295bb4de1dbec547b2b
diff --git a/mina.netty/src/main/java/org/kaazing/mina/netty/socket/nio/NioDatagramChannelIoSession.java b/mina.netty/src/main/java/org/kaazing/mina/netty/socket/nio/NioDatagramChannelIoSession.java index <HASH>..<HASH> 100644 --- a/mina.netty/src/main/java/org/kaazing/mina/netty/socket/nio/NioDatagramChannelIoSession.java +++ b/mina.netty/src/main/java/org/kaazing/mina/netty/socket/nio/NioDatagramChannelIoSession.java @@ -41,7 +41,7 @@ import static java.lang.Thread.currentThread; * It forces all operations of the session to be done in the worker thread (using worker.executeIntoThread if a call * is made in another thread). */ -class NioDatagramChannelIoSession extends ChannelIoSession<DatagramChannelConfig> { +public class NioDatagramChannelIoSession extends ChannelIoSession<DatagramChannelConfig> { private static final IoFilter IDLE_FILTER = new NioDatagramIdleFilter(); private static final Logger LOGGER = LoggerFactory.getLogger(NioDatagramChannelIoSession.class);
Promote NioDatagramChannelIoSession class to public.
kaazing_gateway
train
java
e65542d1ed8477a2307452c4aa965db72864d13b
diff --git a/src/AggregateRoot.php b/src/AggregateRoot.php index <HASH>..<HASH> 100644 --- a/src/AggregateRoot.php +++ b/src/AggregateRoot.php @@ -34,7 +34,7 @@ abstract class AggregateRoot public function persist(): AggregateRoot { call_user_func( - [$this->storedEventModel ?? config('event-projector.stored_event_model'), 'storeMany'], + [$this->getStoredEventClass(), 'storeMany'], $this->getAndClearRecoredEvents(), $this->aggregateUuid ); @@ -42,6 +42,11 @@ abstract class AggregateRoot return $this; } + protected function getStoredEventClass(): string + { + return $this->storedEventModel ?? config('event-projector.stored_event_model'); + } + private function getAndClearRecoredEvents(): array { $recordedEvents = $this->recordedEvents; diff --git a/src/Projectors/ProjectsEvents.php b/src/Projectors/ProjectsEvents.php index <HASH>..<HASH> 100644 --- a/src/Projectors/ProjectsEvents.php +++ b/src/Projectors/ProjectsEvents.php @@ -30,6 +30,6 @@ trait ProjectsEvents protected function getStoredEventClass(): string { - return config('event-projector.stored_event_model'); + return $this->storedEventModel ?? config('event-projector.stored_event_model'); } }
Make the api the same as projectors for getting the stored event model.
spatie_laravel-event-projector
train
php,php
f894a39be5b97954584c648dd2f5323649d64c96
diff --git a/jquery.datetimepicker.js b/jquery.datetimepicker.js index <HASH>..<HASH> 100644 --- a/jquery.datetimepicker.js +++ b/jquery.datetimepicker.js @@ -363,10 +363,14 @@ options.prev = 'xdsoft_next'; } - if( !options.datepicker && options.timepicker ) + if( options.timepicker ) + datepicker.addClass('active'); + else datepicker.removeClass('active'); - - if( options.datepicker && !options.timepicker ) + + if( options.timepicker ) + timepicker.addClass('active'); + else timepicker.removeClass('active'); if( options.value ){
Updated setOptions to toggle timepicker and datepicker
xdan_datetimepicker
train
js
050846cd3f7e93641b8bf5b8909757a3b5544cd0
diff --git a/iyzipay/__init__.py b/iyzipay/__init__.py index <HASH>..<HASH> 100644 --- a/iyzipay/__init__.py +++ b/iyzipay/__init__.py @@ -5,9 +5,9 @@ # Nurettin Bakkal <[email protected]> # Configuration variables -api_key = 'mrI3mIMuNwGiIxanQslyJBRYa8nYrCU5' -secret_key = '9lkVluNHBABPw0LIvyn50oYZcrSJ8oNo' -base_url = 'localhost:8080' +api_key = '1' +secret_key = '1' +base_url = 'localhost' # Resource from iyzipay.iyzipay_resource import ( # noqa
ide file added to gitignore
iyzico_iyzipay-python
train
py
0d920943a36edafc2898013e857d50c08ff96568
diff --git a/lib/berkshelf/locations/hg.rb b/lib/berkshelf/locations/hg.rb index <HASH>..<HASH> 100644 --- a/lib/berkshelf/locations/hg.rb +++ b/lib/berkshelf/locations/hg.rb @@ -1,3 +1,4 @@ +require 'buff/shell_out' require 'digest/sha1' require 'pathname' require 'berkshelf' @@ -139,9 +140,13 @@ module Berkshelf raise HgNotInstalled.new end - out = %x|hg #{command}| - raise HgCommandError.new(command, cache_path) if error && !$?.success? - out.strip + response = Buff::ShellOut.shell_out(%|hg #{command}|) + + if error && !response.success? + raise HgCommandError.new(command, cache_path) + end + + response.stdout.strip end # Determine if this hg repo has already been downloaded.
Use Buff::Shellout
berkshelf_berkshelf-hg
train
rb
79116dbb8723920632d9a163c277ac57913292f9
diff --git a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php +++ b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php @@ -31,12 +31,12 @@ use Webmozart\Assert\Assert; class Kernel extends HttpKernel { - public const VERSION = '1.3.4-DEV'; + public const VERSION = '1.3.4'; public const VERSION_ID = '10304'; public const MAJOR_VERSION = '1'; public const MINOR_VERSION = '3'; public const RELEASE_VERSION = '4'; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public function __construct(string $environment, bool $debug) {
Change application version to <I>
Sylius_Sylius
train
php
88214be0a31608b93ffbb0444d57ab30bf0227f8
diff --git a/lib/Sp_Lib.php b/lib/Sp_Lib.php index <HASH>..<HASH> 100644 --- a/lib/Sp_Lib.php +++ b/lib/Sp_Lib.php @@ -124,7 +124,10 @@ class Sp_Lib } foreach ($arrays as $key => $value) { - $k = isset( $prefix ) ? $prefix . '[' . $key . ']' : $key; + $k = + isset($prefix) ? + $prefix . '[' . $key . ']' : + $key; if (is_array($value) || is_object($value)) { $this->_flattenMultiDimensionalParams($value, $new, $k);
Standards fix on ternary expression.
ShootProof_php-sdk
train
php
920b8b1187923e8c5395b0289b0138fe03fc8c9f
diff --git a/src/jquery.ez-plus.js b/src/jquery.ez-plus.js index <HASH>..<HASH> 100644 --- a/src/jquery.ez-plus.js +++ b/src/jquery.ez-plus.js @@ -795,6 +795,7 @@ if (typeof Object.create !== 'function') { var self = this; if (change == "show") { if (!self.isWindowActive) { + self.options.onShow(self); if (self.options.zoomWindowFadeIn) { self.zoomWindow.stop(true, true, false).fadeIn(self.options.zoomWindowFadeIn); } @@ -1836,8 +1837,8 @@ if (typeof Object.create !== 'function') { onComplete: $.noop, onImageSwap: $.noop, onImageSwapComplete: $.noop, - onZoomedImageLoaded: function () { - }, + onShow: $.noop, + onZoomedImageLoaded: $.noop, onImageClick: $.noop, preloading: 1, //by default, load all the images, if 0, then only load images after activated (PLACEHOLDER FOR NEXT VERSION) respond: [],
Improvement: Added callback for when zoomWindow is just about to be shown I found that the zoomWindow would often fall offscreen, so I added a callback just before it is shown so that repositioning it is possible.
igorlino_elevatezoom-plus
train
js
cd3bc1d91044e682fba9cbb1fe1d76e396389f50
diff --git a/a10_neutron_lbaas/neutron_ext/common/attributes.py b/a10_neutron_lbaas/neutron_ext/common/attributes.py index <HASH>..<HASH> 100644 --- a/a10_neutron_lbaas/neutron_ext/common/attributes.py +++ b/a10_neutron_lbaas/neutron_ext/common/attributes.py @@ -42,5 +42,7 @@ def _find(*args): convert_to_int = _find(lambda: old_attributes.convert_to_int, lambda: lib_converters.convert_to_int) +convert_kvp_list_to_dict = _find(lambda: old_attributes.convert_kvp_list_to_dict, + lambda: lib_converters.convert_kvp_list_to_dict) ATTR_NOT_SPECIFIED = _find(lambda: old_constants.ATTR_NOT_SPECIFIED, lambda: lib_constants.ATTR_NOT_SPECIFIED)
Missing key-value list to dict converter
a10networks_a10-neutron-lbaas
train
py
5de12b137ab9b76a87a544a3792aab1dc2a3438a
diff --git a/src/main/java/org/dita/dost/writer/ConkeyrefFilter.java b/src/main/java/org/dita/dost/writer/ConkeyrefFilter.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/dita/dost/writer/ConkeyrefFilter.java +++ b/src/main/java/org/dita/dost/writer/ConkeyrefFilter.java @@ -90,7 +90,14 @@ public final class ConkeyrefFilter extends AbstractXMLFilter { * @return updated href URI */ private URI getRelativePath(final URI href) { - final URI keyValue = job.tempDirURI.resolve(stripFragment(href)); + final URI keyValue; + final URI inputMap = job.getInputMap(); + if (inputMap != null) { + final URI tmpMap = job.tempDirURI.resolve(inputMap); + keyValue = tmpMap.resolve(stripFragment(href)); + } else { + keyValue = job.tempDirURI.resolve(stripFragment(href)); + } return URLUtils.getRelativePath(currentFile, keyValue); }
Fix conkeyref target resolution when outer levels Fixes calculation of the target path during transformation @from conkeyref to @conref in case of folder level shifting (topics outside of the ditamap folder). It belongs to #<I>, #<I>, #<I>, and possibly some others.
dita-ot_dita-ot
train
java
04407faf6fbd400f1c9f72f752395e1dfa5865f7
diff --git a/ext/extconf.rb b/ext/extconf.rb index <HASH>..<HASH> 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -27,7 +27,7 @@ end # darwin nix clang doesn't support lto # disable -lto flag for darwin + nix # see: https://github.com/sass/sassc-ruby/issues/148 -enable_lto_by_default = (Gem::Platform.local.os == "darwin" && !ENV['NIX_CC'].nil?) +enable_lto_by_default = (Gem::Platform.local.os == "darwin" && ENV['NIX_CC'].nil?) if enable_config('lto', enable_lto_by_default) $CFLAGS << ' -flto'
Fix check to disable LTO by default
sass_sassc-ruby
train
rb
d30415d74abfb8ef60101fa5f69c99b627bbc6cb
diff --git a/test/core/fixtures/transformation/es6.spec.symbols/instanceof/exec.js b/test/core/fixtures/transformation/es6.spec.symbols/instanceof/exec.js index <HASH>..<HASH> 100644 --- a/test/core/fixtures/transformation/es6.spec.symbols/instanceof/exec.js +++ b/test/core/fixtures/transformation/es6.spec.symbols/instanceof/exec.js @@ -10,9 +10,11 @@ function Greeting(greeting) { this.greeting = greeting; } -Greeting[Symbol.hasInstance] = function(inst) { - return inst.greeting == "hello"; -}; +Object.defineProperty(Greeting, Symbol.hasInstance, { + value: function(inst) { + return inst.greeting == "hello"; + } +}); var a = new Greeting("hello"); var b = new Greeting("world");
update es6.spec.symbols instanceof test to reflect Function.prototype[@@hasInstance] being nonwritable #<I>
babel_babel
train
js
9c8d51b5af7943abeef0045cc02fa66dbdc575f5
diff --git a/lib/remote_syslog/cli.rb b/lib/remote_syslog/cli.rb index <HASH>..<HASH> 100644 --- a/lib/remote_syslog/cli.rb +++ b/lib/remote_syslog/cli.rb @@ -51,7 +51,9 @@ module RemoteSyslog def is_file_writable?(file) directory = File.dirname(file) - (File.directory?(directory) && File.writable?(directory) && !File.exists?(file)) || File.writable?(file) + if (File.directory?(directory) && File.writable?(directory) && !File.exists?(file)) || File.writable?(file) + return file + end end def default_pid_file
Add exclude_files to advanced example config
papertrail_remote_syslog
train
rb
a39c29933a71b0d872ab644412347aa6479bef51
diff --git a/core/commands/root.go b/core/commands/root.go index <HASH>..<HASH> 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -94,7 +94,7 @@ The CLI will exit with one of the following values: cmdkit.BoolOption(cmds.OptLongHelp, "Show the full command help text."), cmdkit.BoolOption(cmds.OptShortHelp, "Show a short version of the command help text."), cmdkit.BoolOption(LocalOption, "L", "Run the command locally, instead of using the daemon. DEPRECATED: use --offline."), - cmdkit.BoolOption(OfflineOption, "O", "Run the command offline."), + cmdkit.BoolOption(OfflineOption, "Run the command offline."), cmdkit.StringOption(ApiOption, "Use a specific API instance (defaults to /ip4/127.0.0.1/tcp/5001)"), // global options, added to every command
commands: don't use -O as global offline License: MIT
ipfs_go-ipfs
train
go
1473703b3490091052f1f9d76c1e564a1d055d03
diff --git a/lib/chef/provider/package/smartos.rb b/lib/chef/provider/package/smartos.rb index <HASH>..<HASH> 100644 --- a/lib/chef/provider/package/smartos.rb +++ b/lib/chef/provider/package/smartos.rb @@ -30,7 +30,7 @@ class Chef attr_accessor :is_virtual_package provides :package, platform: "smartos" - provides :smartos_package, platform_family: "smartos" + provides :smartos_package, platform: "smartos" def load_current_resource Chef::Log.debug("#{new_resource} loading current resource")
Just use platform for smartos as well
chef_chef
train
rb
aa44a548a36950a4dad8d3aab2da7909e8395b2e
diff --git a/master/setup.py b/master/setup.py index <HASH>..<HASH> 100755 --- a/master/setup.py +++ b/master/setup.py @@ -271,6 +271,9 @@ else: if not py_26: setup_args['install_requires'].append('pysqlite') + if os.getenv('NO_INSTALL_REQS'): + setup_args['install_requires'] = None + entry_points={ 'console_scripts': [ 'buildbot = buildbot.scripts.runner:run'],
Setup: quick hack to avoid downloading/installing requirements. When building for a distro, having intermediate steps like requirements auto-download is forbidden. Until I find some better method, I put an env var "NO_INSTALL_REQS" to supress that behavior.
buildbot_buildbot
train
py
0f0376f0ae625a97718e8a1c59e16de4ca8e2675
diff --git a/openpnm/io/Statoil.py b/openpnm/io/Statoil.py index <HASH>..<HASH> 100644 --- a/openpnm/io/Statoil.py +++ b/openpnm/io/Statoil.py @@ -51,13 +51,13 @@ class Statoil(GenericIO): p = Path(path) # Deal with reservoir pores if Pinlet is None: - inlet = network.Np - 2 + Pinlet = network.Np - 2 if Poutlet is None: - outlet = network.Np - 1 - Pin = network.find_neighbor_pores(pores=inlet) + Poutlet = network.Np - 1 + Pin = network.find_neighbor_pores(pores=Pinlet) inlets = np.zeros_like(network.Ps, dtype=bool) inlets[Pin] = True - Pout = network.find_neighbor_pores(pores=outlet) + Pout = network.find_neighbor_pores(pores=Poutlet) outlets = np.zeros_like(network.Ps, dtype=bool) outlets[Pout] = True
fixing naming of inlet/outlet pores
PMEAL_OpenPNM
train
py
594533a7cc7a07002e4ff457f114a73a9c79c5f5
diff --git a/src/Charcoal/Object/CategoryTrait.php b/src/Charcoal/Object/CategoryTrait.php index <HASH>..<HASH> 100644 --- a/src/Charcoal/Object/CategoryTrait.php +++ b/src/Charcoal/Object/CategoryTrait.php @@ -68,7 +68,7 @@ trait CategoryTrait public function numCategoryItems() { $items = $this->categoryItems(); - return count($items); + return is_countable($items) ? count($items) : 0; } /**
fix warning count() starting in PHP<I>+ if non-countable
locomotivemtl_charcoal-object
train
php
c656ff2bf595a0b264f2fa3a0474b4a3cc9a4031
diff --git a/safe/test/utilities.py b/safe/test/utilities.py index <HASH>..<HASH> 100644 --- a/safe/test/utilities.py +++ b/safe/test/utilities.py @@ -1108,7 +1108,7 @@ def clone_raster_layer( trg_path = temp_path + ext shutil.copy2(src_path, trg_path) - raster_path = '%s.shp' % temp_path + raster_path = '%s%s' % (temp_path, extension) layer = QgsRasterLayer(raster_path, os.path.basename(raster_path)) return layer
Fix safe.test.utilities.clone_raster_layer
inasafe_inasafe
train
py
686743c6452b44bafcd06d47db7f36ddf3f3f118
diff --git a/lib/email-addresses.js b/lib/email-addresses.js index <HASH>..<HASH> 100644 --- a/lib/email-addresses.js +++ b/lib/email-addresses.js @@ -893,7 +893,7 @@ function parse5322(opts) { function giveResultMailbox(mailbox) { var name = findNode('display-name', mailbox); var aspec = findNode('addr-spec', mailbox); - var comments = findAllNodes('comment', mailbox); + var comments = findAllNodesNoChildren(['comment'], mailbox); var local = findNode('local-part', aspec);
disable recursion in comment search
jackbearheart_email-addresses
train
js
fc529109e3ab3592c8d6d6fbc3352b020782cb8c
diff --git a/app/view/Gruntfile.js b/app/view/Gruntfile.js index <HASH>..<HASH> 100644 --- a/app/view/Gruntfile.js +++ b/app/view/Gruntfile.js @@ -129,6 +129,7 @@ module.exports = function(grunt) { browser: true, // Defines globals exposed by modern browsers curly: true, // Always put curly braces around blocks devel: true, // Defines globals that are usually used for logging/debugging + immed: true, // Prohibits the use of immediate function invocations without parentheses indent: 4, // Tab width latedef: true, // Prohibits the use of a variable before it was defined maxlen: 120, // Maximum length of a line diff --git a/app/view/js/src/obj-datetime.js b/app/view/js/src/obj-datetime.js index <HASH>..<HASH> 100644 --- a/app/view/js/src/obj-datetime.js +++ b/app/view/js/src/obj-datetime.js @@ -1,7 +1,7 @@ /** * DateTime/Date input combo initalization and handling */ -bolt.datetimes = function () { +bolt.datetimes = (function () { /** * @typedef InputElements * @type {Object} data - Element holding the data @@ -217,4 +217,4 @@ bolt.datetimes = function () { } } }; -} (); +} ());
Add jshint option: immed
bolt_bolt
train
js,js
291af48d89894b1d5cbc5e4d8b04876af85eb1ae
diff --git a/cli/commands/get.js b/cli/commands/get.js index <HASH>..<HASH> 100644 --- a/cli/commands/get.js +++ b/cli/commands/get.js @@ -128,7 +128,7 @@ class GetCommand extends Command { !fs.existsSync('/tmp') && fs.mkdirSync('/tmp'); !fs.existsSync('/tmp/stdlib') && fs.mkdirSync('/tmp/stdlib', 0o777); - let tmpPath = `/tmp/${service.replace(/\//g, '.')}.tgz`; + let tmpPath = `/tmp/stdlib/${service.replace(/\//g, '.')}.tgz`; try { fs.writeFileSync(tmpPath, response); } catch (e) {
Updates tmpPath in lib get
stdlib_lib
train
js
19bd3c8be505f66872203de2c0bb43dc969c65dd
diff --git a/lib/endpoints/class-wp-rest-users-controller.php b/lib/endpoints/class-wp-rest-users-controller.php index <HASH>..<HASH> 100755 --- a/lib/endpoints/class-wp-rest-users-controller.php +++ b/lib/endpoints/class-wp-rest-users-controller.php @@ -402,7 +402,6 @@ class WP_REST_Users_Controller extends WP_REST_Controller { public function delete_item_permissions_check( $request ) { $id = (int) $request['id']; - $reassign = isset( $request['reassign'] ) ? absint( $request['reassign'] ) : null; if ( ! current_user_can( 'delete_user', $id ) ) { return new WP_Error( 'rest_user_cannot_delete', __( 'Sorry, you are not allowed to delete this user.' ), array( 'status' => rest_authorization_required_code() ) );
Remove unneeded definition of `$reassign` variable
WP-API_WP-API
train
php