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
58bb404082316bb809bf822dd0554656a5e98f0b
diff --git a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/server/GenerateFeaturesMojo.java b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/server/GenerateFeaturesMojo.java index <HASH>..<HASH> 100644 --- a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/server/GenerateFeaturesMojo.java +++ b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/server/GenerateFeaturesMojo.java @@ -640,6 +640,10 @@ public class GenerateFeaturesMojo extends ServerFeatureSupport { public void info(String msg) { log.info(msg); } + @Override + public boolean isDebugEnabled() { + return log.isDebugEnabled(); + } } }
Enable binary scanner logging in debug mode.
WASdev_ci.maven
train
java
4ff96046052b68fc35a70d9e07f685cc88581a3f
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -145,6 +145,16 @@ module.exports = function(grunt) { src: ['**'], dest: path.join(chromiumSrc, 'tools/perf/') }, { + expand: true, + flatten: true, + src: 'node_modules/topcoat-theme/font/**', + dest: path.join(chromiumSrc, 'tools/perf/page_sets/topcoat/font') + }, { + expand: true, + flatten: true, + src: 'node_modules/topcoat-theme/img/*', + dest: path.join(chromiumSrc, 'tools/perf/page_sets/topcoat/img') + }, { src: ['css/**'], dest: path.join(chromiumSrc, 'tools/perf/page_sets/topcoat/release/') }]
fixed copy task for Grunt telemetry
topcoat_topcoat
train
js
ace6a04671a2ec893cad1f05300b85b6dff5ddf2
diff --git a/test/specs/wrapper.spec.js b/test/specs/wrapper.spec.js index <HASH>..<HASH> 100644 --- a/test/specs/wrapper.spec.js +++ b/test/specs/wrapper.spec.js @@ -146,7 +146,7 @@ describe('wrapper', function () { }, 0); }); - // TODO this won't work until karma-jasmine updates to jasmine-ajax 2.99.0 + // TODO this won't work until karma-jasmine updates to jasmine-ajax 3.0.0 /* it('should support array buffer response', function (done) { var request, response; @@ -176,12 +176,11 @@ describe('wrapper', function () { }); setTimeout(function () { - console.log(response.data); - expect(response.data.byteLength).toBe(16); + expect(response.data.byteLength).toBe(22); done(); }, 0); }, 0); }); - */ + //*/ });
Noting that jasmine-ajax <I> is needed
axios_axios
train
js
8fb970ff74978e3185b623812c7d667492dc1ef4
diff --git a/Tests/Functional/UseCasesTest.php b/Tests/Functional/UseCasesTest.php index <HASH>..<HASH> 100644 --- a/Tests/Functional/UseCasesTest.php +++ b/Tests/Functional/UseCasesTest.php @@ -14,6 +14,7 @@ use Interop\Queue\PsrMessage; use Interop\Queue\PsrQueue; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Filesystem\Filesystem; +use Symfony\Component\HttpKernel\Kernel; /** * @group functional @@ -92,11 +93,14 @@ class UseCasesTest extends WebTestCase ], ]]; - yield 'default_dsn_as_env' => [[ - 'transport' => [ - 'default' => '%env(AMQP_DSN)%', - ], - ]]; + // Symfony 2.x does not such env syntax + if (version_compare(Kernel::VERSION, '3.2', '>=')) { + yield 'default_dsn_as_env' => [[ + 'transport' => [ + 'default' => '%env(AMQP_DSN)%', + ], + ]]; + } yield 'default_dbal_as_dsn' => [[ 'transport' => [
revert sf version check
php-enqueue_enqueue-bundle
train
php
13780b150154cb329260d27ac051124a8bf39f77
diff --git a/src/test/java/fr/pilato/elasticsearch/crawler/fs/test/FSCrawlerReproduceInfoPrinter.java b/src/test/java/fr/pilato/elasticsearch/crawler/fs/test/FSCrawlerReproduceInfoPrinter.java index <HASH>..<HASH> 100644 --- a/src/test/java/fr/pilato/elasticsearch/crawler/fs/test/FSCrawlerReproduceInfoPrinter.java +++ b/src/test/java/fr/pilato/elasticsearch/crawler/fs/test/FSCrawlerReproduceInfoPrinter.java @@ -65,7 +65,7 @@ public class FSCrawlerReproduceInfoPrinter extends RunListener { final StringBuilder b = new StringBuilder(); b.append("REPRODUCE WITH:\n"); - b.append("mvn test"); + b.append("mvn integration-test"); MavenMessageBuilder mavenMessageBuilder = new MavenMessageBuilder(b); mavenMessageBuilder.appendAllOpts(failure.getDescription());
Need to use integration-test instead of test for integration tests
dadoonet_fscrawler
train
java
4def1356fdb11b2280877c6c8dc0ee7ee6772c78
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,7 @@ module.exports._opts = function _opts(agent) { return { headers: { 'User-Agent': 'NRK%20TV/43 CFNetwork/711.5.6 Darwin/14.0.0', - 'accept': '*/*', + accept: '*/*', 'app-version-ios': '43', 'Accept-Language:': 'en-us', }, @@ -25,7 +25,7 @@ module.exports._opts = function _opts(agent) { 'AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0', 'Mobile/10A5376e Safari/8536.25', ].join(' '), - 'accept': 'application/json, text/javascript, */*; q=0.01', + accept: 'application/json, text/javascript, */*; q=0.01', 'x-requested-with': 'XMLHttpRequest', }, };
fix(eslint): unnecessarily quoted property `accept`
Starefossen_node-nrk
train
js
5035152c9cb9eac97fc5e6f0c6873882415aed82
diff --git a/engarde/checks.py b/engarde/checks.py index <HASH>..<HASH> 100644 --- a/engarde/checks.py +++ b/engarde/checks.py @@ -182,15 +182,15 @@ def within_n_std(df, n=3): ========== df : DataFame n : int - number of standard devations from the mean + number of standard deviations from the mean Returns ======= - df : DatFrame + df : DataFrame """ means = df.mean() stds = df.std() - inliers = (np.abs(df - means) < n * stds) + inliers = (np.abs(df[means.index] - means) < n * stds) if not np.all(inliers): msg = generic.bad_locations(~inliers) raise AssertionError(msg)
handle within_n_std with non-numerical columns Let within_n_std handle df with non-numerical columns without failing
TomAugspurger_engarde
train
py
7edbb2131a4a44f75c4c00e375600e500062936e
diff --git a/config.js b/config.js index <HASH>..<HASH> 100644 --- a/config.js +++ b/config.js @@ -7,8 +7,9 @@ module.exports = { realname: "http://github.com/erming/shout", }, networks: [{ - host: "irc.freenode.org", - port: 6667, + host: "chat.freenode.net", + port: 6697, + tls: true, onConnect: { commands: [""], join: [ diff --git a/lib/server.js b/lib/server.js index <HASH>..<HASH> 100644 --- a/lib/server.js +++ b/lib/server.js @@ -5,6 +5,7 @@ var http = require("connect"); var io = require("socket.io"); var irc = require("slate-irc"); var net = require("net"); +var tls = require("tls"); // Models @@ -92,11 +93,12 @@ function connect(params) { var host = params.host; var port = params.port || 6667; - - var stream = net.connect({ - port: port, + var options = { host: host, - }); + port: port, + }; + + var stream = params.tls ? tls.connect(options) : net.connect(options); stream.on("error", function(e) { console.log(e);
Add TLS connection support Also update the example config to be safe by default.
erming_shout
train
js,js
ff47952156b8596639427966641c56e9b8b3638a
diff --git a/scripts/release.js b/scripts/release.js index <HASH>..<HASH> 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -4,7 +4,7 @@ const semver = require('semver'); const fs = require('fs'); const _ = require('lodash'); -const ONLY_ON_BRANCH = 'master'; +const ONLY_ON_BRANCH = 'origin/master'; const VERSION_TAG = 'latest'; const VERSION_INC = 'patch';
Change branch to origin/master for release
wix_remx
train
js
2fc34a5796c363a47a142e96ada50d4ddf9eff9a
diff --git a/cache/cache.go b/cache/cache.go index <HASH>..<HASH> 100644 --- a/cache/cache.go +++ b/cache/cache.go @@ -90,6 +90,8 @@ func (r *RowCache) Row(uuid string) model.Model { // RowByModel searches the cache using a the indexes for a provided model func (r *RowCache) RowByModel(m model.Model) model.Model { + r.mutex.RLock() + defer r.mutex.RUnlock() if reflect.TypeOf(m) != r.dataType { return nil }
cache: rlock row by model
socketplane_libovsdb
train
go
edf9ac11d473ad45974b4383bc16ceca62bfa7bd
diff --git a/examples/multiple-choice/utils_multiple_choice.py b/examples/multiple-choice/utils_multiple_choice.py index <HASH>..<HASH> 100644 --- a/examples/multiple-choice/utils_multiple_choice.py +++ b/examples/multiple-choice/utils_multiple_choice.py @@ -535,7 +535,12 @@ def convert_examples_to_features( text_b = example.question + " " + ending inputs = tokenizer.encode_plus( - text_a, text_b, add_special_tokens=True, max_length=max_length, pad_to_max_length=True, + text_a, + text_b, + add_special_tokens=True, + max_length=max_length, + pad_to_max_length=True, + return_overflowing_tokens=True, ) if "num_truncated_tokens" in inputs and inputs["num_truncated_tokens"] > 0: logger.info(
Should return overflowing information for the log (#<I>)
huggingface_pytorch-pretrained-BERT
train
py
06a9f2786dc5611210ec56144752a7661598cd60
diff --git a/chess/__init__.py b/chess/__init__.py index <HASH>..<HASH> 100644 --- a/chess/__init__.py +++ b/chess/__init__.py @@ -478,12 +478,6 @@ class Move: return "0000" def xboard(self): - """ - Gets an XBoard string for the move. - - Same as :func:`~chess.Move.uci()`, except that the notation for null - moves is ``@@@@``. - """ return self.uci() if self else "@@@@" def __bool__(self):
xboard is undocumented for now
niklasf_python-chess
train
py
3adcb9bee887030ef46825570e5cb44a426329eb
diff --git a/spec/rest_api_spec.rb b/spec/rest_api_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rest_api_spec.rb +++ b/spec/rest_api_spec.rb @@ -317,7 +317,7 @@ RSpec.describe Shodanz::API::REST do end expect(resp).to be_a(Hash) expect(resp[ip]).to be_a(Array) - expect(resp[ip].first).to eq('google-public-dns-a.google.com') + # expect(resp[ip].first).to eq('google-public-dns-a.google.com') end describe 'resolves ip addresses to domains' do
Update rest_api_spec.rb
picatz_shodanz
train
rb
17883f75e66f33d35b876dbc33a5f6ee7385c5d8
diff --git a/lib/fixed.js b/lib/fixed.js index <HASH>..<HASH> 100644 --- a/lib/fixed.js +++ b/lib/fixed.js @@ -49,7 +49,7 @@ module.exports=function(statpath,def){ type='application/json'; break; case '.js': - type='text/javascript'; + type='text/javascript;charset=UTF-8'; break; case '.ico': bin=true;
javascript should always be utf8
ansuz_unmon
train
js
9eb6e2cb884cac69c78a4c704e3d72edf58f3af0
diff --git a/impl/src/main/java/org/jboss/seam/faces/rewrite/RewriteConfiguration.java b/impl/src/main/java/org/jboss/seam/faces/rewrite/RewriteConfiguration.java index <HASH>..<HASH> 100644 --- a/impl/src/main/java/org/jboss/seam/faces/rewrite/RewriteConfiguration.java +++ b/impl/src/main/java/org/jboss/seam/faces/rewrite/RewriteConfiguration.java @@ -51,8 +51,10 @@ public class RewriteConfiguration implements ConfigurationProvider { private List<UrlMapping> loadUrlMappings(ViewConfigStore store, String facesMapping) { List<UrlMapping> mappings = new ArrayList<UrlMapping>(); Map<String, Annotation> map = store.getAllAnnotationViewMap(org.jboss.seam.faces.rewrite.UrlMapping.class); - for (Map.Entry<String, Annotation> entry : map.entrySet()) { - mappings.add(buildPrettyFacesUrlMapping(entry.getKey(), entry.getValue(), facesMapping)); + if (map != null) { + for (Map.Entry<String, Annotation> entry : map.entrySet()) { + mappings.add(buildPrettyFacesUrlMapping(entry.getKey(), entry.getValue(), facesMapping)); + } } return mappings; }
Avoided a NPE when no @UrlMapping annoations are present in the view config
seam_faces
train
java
00becfe7da6cc7d1e7ca372a2d394fd08053a22e
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -9,7 +9,7 @@ var BBY = { init: function(options) { this.options = { key: process.env.BBY_API_KEY, - url: 'https://api.bestbuy.com/v1', + url: 'https://api.bestbuy.com/v1', debug: false, headers: { 'User-Agent': 'bestbuy-sdk-js'
Recommendations and Smart Lists
BestBuyAPIs_bestbuy-sdk-js
train
js
8d4e387c1fac95b760d2ada6b827091e0f960839
diff --git a/lib/apiary/command/publish.rb b/lib/apiary/command/publish.rb index <HASH>..<HASH> 100644 --- a/lib/apiary/command/publish.rb +++ b/lib/apiary/command/publish.rb @@ -25,6 +25,7 @@ module Apiary :content_type => "text/plain", :authentication => "Token #{@options.api_key}" } + @options.message_to_save||= "Saved with apiary-client" end def self.execute(args) @@ -57,7 +58,8 @@ module Apiary def query_apiary(host, path) url = "https://#{host}/blueprint/publish/#{@options.api_name}" data = { - :code => File.read(path) + :code => File.read(path), + :messageToSave => @options.messageToSave } RestClient.proxy = @options.proxy
Manage messageToSave option in publish command.
apiaryio_apiary-client
train
rb
5facf6d86d82594fb723da2f4ebacaae52604d9c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ def read(fname): setup( name='django-angular', - version='0.1.4', + version='0.2.0', author='Jacob Rief', author_email='[email protected]', description=DESCRIPTION, @@ -30,6 +30,6 @@ setup( platforms=['OS Independent'], classifiers=CLASSIFIERS, install_requires=['Django>=1.4'], - packages=find_packages(exclude=["tests", "docs"]), + packages=find_packages(exclude=['unittests', 'docs']), include_package_data=True, )
Bumped to version <I>
jrief_django-angular
train
py
8bde52b68ef429d45687fc975b03484efcbfcb9f
diff --git a/core/packet.go b/core/packet.go index <HASH>..<HASH> 100644 --- a/core/packet.go +++ b/core/packet.go @@ -133,11 +133,35 @@ func (p *Packet) UnmarshalJSON(raw []byte) error { if err != nil { return err } - payload := new(lorawan.PHYPayload) + + // Try first to unmarshal as an uplink payload + payload := lorawan.NewPHYPayload(true) if err := payload.UnmarshalBinary(rawPayload); err != nil { return err } - p.Payload = *payload + + switch payload.MHDR.MType.String() { + case "JoinAccept": + fallthrough + case "UnconfirmedDataDown": + fallthrough + case "ConfirmedDataDown": + payload = lorawan.NewPHYPayload(false) + if err := payload.UnmarshalBinary(rawPayload); err != nil { + return err + } + case "JoinRequest": + fallthrough + case "UnconfirmedDataUp": + fallthrough + case "ConfirmedDataUp": + // Nothing, we handle them by default + + case "Proprietary": + return fmt.Errorf("Unsupported MType Proprietary") + } + + p.Payload = payload p.Metadata = proxy.Metadata return nil }
[packet.unmarshal] Fix packet unmarshalling issues. Use of MType to distinguish packet type
TheThingsNetwork_ttn
train
go
97fb6f19b1dedbb9a00bd76d9e19ff610bf53949
diff --git a/jax/lax.py b/jax/lax.py index <HASH>..<HASH> 100644 --- a/jax/lax.py +++ b/jax/lax.py @@ -427,7 +427,7 @@ def while_loop(cond_fun, body_fun, init_val): Returns: The output from the final iteration of body_fun, of type `T`. - The semantics of `while_loop` are given by this Python implementation: + The semantics of `while_loop` are given by this Python implementation:: def while_loop(cond_fun, body_fun, init_val): val = init_val @@ -648,7 +648,7 @@ def fori_loop(lower, upper, body_fun, init_val): Returns: Loop value from the final iteration, of type T. - The semantics of `fori_loop` are given by this Python implementation: + The semantics of `fori_loop` are given by this Python implementation:: def fori_loop(lower, upper, body_fun, init_val): val = init_val
Fix formatting of lax.while_loop and lax.fori_loop doc comments.
tensorflow_probability
train
py
59cf88b5a663b7eba6d3034b46c45276e8a975a7
diff --git a/command/common/install_plugin_command_test.go b/command/common/install_plugin_command_test.go index <HASH>..<HASH> 100644 --- a/command/common/install_plugin_command_test.go +++ b/command/common/install_plugin_command_test.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "math/rand" + "os" "strconv" "code.cloudfoundry.org/cli/actor/pluginaction" @@ -29,6 +30,7 @@ var _ = Describe("install-plugin command", func() { fakeActor *commonfakes.FakeInstallPluginActor executeErr error expectedErr error + pluginHome string ) BeforeEach(func() { @@ -44,11 +46,16 @@ var _ = Describe("install-plugin command", func() { } tmpDirectorySeed := strconv.Itoa(int(rand.Int63())) - fakeConfig.PluginHomeReturns(fmt.Sprintf("some-pluginhome-%s", tmpDirectorySeed)) + pluginHome = fmt.Sprintf("some-pluginhome-%s", tmpDirectorySeed) + fakeConfig.PluginHomeReturns(pluginHome) fakeConfig.ExperimentalReturns(true) fakeConfig.BinaryNameReturns("faceman") }) + AfterEach(func() { + os.RemoveAll(pluginHome) + }) + JustBeforeEach(func() { executeErr = cmd.Execute(nil) })
delete temp directories created by install-plugin tests
cloudfoundry_cli
train
go
8aeb051c7bb243fa33f7c0777f47ef51a38d64be
diff --git a/twitter_ads/campaign.py b/twitter_ads/campaign.py index <HASH>..<HASH> 100644 --- a/twitter_ads/campaign.py +++ b/twitter_ads/campaign.py @@ -65,6 +65,13 @@ resource_property(FundingInstrument, 'type', readonly=True) resource_property(FundingInstrument, 'created_at', readonly=True, transform=TRANSFORM.TIME) resource_property(FundingInstrument, 'updated_at', readonly=True, transform=TRANSFORM.TIME) resource_property(FundingInstrument, 'deleted', readonly=True, transform=TRANSFORM.BOOL) +resource_property(FundingInstrument, 'able_to_fund', readonly=True, transform=TRANSFORM.BOOL) +resource_property(FundingInstrument, 'paused', readonly=True, transform=TRANSFORM.BOOL) +resource_property(FundingInstrument, 'io_header', readonly=True) +resource_property(FundingInstrument, 'reasons_not_able_to_fund', readonly=True) +resource_property(FundingInstrument, 'start_time', readonly=True) +resource_property(FundingInstrument, 'end_time', readonly=True) +resource_property(FundingInstrument, 'credit_remaining_local_micro', readonly=True) class PromotableUser(Resource):
Funding instrument properties (#<I>) * parity with Ruby SDK * additional FI properties
twitterdev_twitter-python-ads-sdk
train
py
755f3060f71dcfeb384c136cc821c617bd65fbf5
diff --git a/lib/Models/ImageryLayerCatalogItem.js b/lib/Models/ImageryLayerCatalogItem.js index <HASH>..<HASH> 100644 --- a/lib/Models/ImageryLayerCatalogItem.js +++ b/lib/Models/ImageryLayerCatalogItem.js @@ -490,11 +490,13 @@ ImageryLayerCatalogItem.prototype._show = function() { ImageryLayerCatalogItem.showLayer(this, this._imageryLayer); ImageryLayerCatalogItem.showLayer(this, this._nextLayer); + ImageryLayerCatalogItem.addTimesToChart(this); }; ImageryLayerCatalogItem.prototype._hide = function() { ImageryLayerCatalogItem.hideLayer(this, this._imageryLayer); ImageryLayerCatalogItem.hideLayer(this, this._nextLayer); + this.terria.catalog.removeChartableItem(this); }; ImageryLayerCatalogItem.prototype.showOnSeparateMap = function(globeOrMap) {
Add and remove imagery layer as chartable item.
TerriaJS_terriajs
train
js
5b87567e77059d98411656456e1af8491c0de124
diff --git a/vespa/kepler.py b/vespa/kepler.py index <HASH>..<HASH> 100644 --- a/vespa/kepler.py +++ b/vespa/kepler.py @@ -79,7 +79,7 @@ def kepler_starfield_file(koi): chips,ras,decs = np.loadtxt(CHIPLOC_FILE,unpack=True) ds = ((c.ra.deg-ras)**2 + (c.dec.deg-decs)**2) chip = chips[np.argmin(ds)] - return '{}/kepler_starfield_{}'.format(STARFIELD_DIR,chip) + return '{}/kepler_starfield_{}.h5'.format(STARFIELD_DIR,chip) def pipeline_weaksec(koi):
added h5 filename to kepler_starfield_file
timothydmorton_VESPA
train
py
0450a0eff64c6431a64ce830c26303fd0e2ee8e6
diff --git a/spec/graphql/schema/traversal_spec.rb b/spec/graphql/schema/traversal_spec.rb index <HASH>..<HASH> 100644 --- a/spec/graphql/schema/traversal_spec.rb +++ b/spec/graphql/schema/traversal_spec.rb @@ -20,6 +20,7 @@ describe GraphQL::Schema::Traversal do it "finds types from a single type and its fields" do expected = { + "Boolean" => GraphQL::BOOLEAN_TYPE, "Cheese" => Dummy::CheeseType, "Float" => GraphQL::FLOAT_TYPE, "String" => GraphQL::STRING_TYPE, @@ -67,9 +68,10 @@ describe GraphQL::Schema::Traversal do result = reduce_types([type_parent]) expected = { + "Boolean" => GraphQL::BOOLEAN_TYPE, + "String" => GraphQL::STRING_TYPE, "InputTypeParent" => type_parent, "InputTypeChild" => type_child, - "String" => GraphQL::STRING_TYPE } assert_equal(expected, result.to_h) end
Fix broken tests from visiting directive arguments in Traversal
rmosolgo_graphql-ruby
train
rb
64a8785709b3a444f547e495d3ac803133b92a19
diff --git a/lib/ransack_ui/ransack_overrides/helpers/form_builder.rb b/lib/ransack_ui/ransack_overrides/helpers/form_builder.rb index <HASH>..<HASH> 100644 --- a/lib/ransack_ui/ransack_overrides/helpers/form_builder.rb +++ b/lib/ransack_ui/ransack_overrides/helpers/form_builder.rb @@ -16,7 +16,7 @@ module Ransack if bases.size > 1 @template.select( @object_name, :name, - @template.grouped_options_for_select(attribute_collection_for_bases(bases)), + @template.grouped_options_for_select(attribute_collection_for_bases(bases), object.name), objectify_options(options), @default_options.merge(html_options) ) else
Set value on attribute select in grouped_options_for_select method
ndbroadbent_ransack_ui
train
rb
eb208f038d48a823180050b2e42cee21addbbea1
diff --git a/lib/send.js b/lib/send.js index <HASH>..<HASH> 100644 --- a/lib/send.js +++ b/lib/send.js @@ -90,7 +90,7 @@ function send(path, options, req, res, next) { // vary if (!res.getHeader('Vary')) { res.setHeader('Vary', 'Accept-Encoding'); - } else if (!~vary.indexOf('Accept-Encoding')) { + } else if (!~res.getHeader('Vary').indexOf('Accept-Encoding')) { res.setHeader('Vary', res.getHeader('Vary') + ', Accept-Encoding'); }
fixed bug. `vary` undefined
ForbesLindesay_browserify-middleware
train
js
5ca372a626f7f9103408bbcf428f5cb26aa00927
diff --git a/ArgParser.php b/ArgParser.php index <HASH>..<HASH> 100644 --- a/ArgParser.php +++ b/ArgParser.php @@ -23,7 +23,9 @@ class ArgParser $args = [$primary => $args]; } - $this->setNameConverter($nameConverter); + if ($nameConverter instanceof NameConverterInterface) { + $this->setNameConverter($nameConverter); + } $this->setArgs($args); }
Add check to see if nameconverter has been passed in
palmtreephp_argparser
train
php
c562b487b08b7bb1869f9d354b60c29ccbdbbba8
diff --git a/src/collectors/userscripts/userscripts.py b/src/collectors/userscripts/userscripts.py index <HASH>..<HASH> 100644 --- a/src/collectors/userscripts/userscripts.py +++ b/src/collectors/userscripts/userscripts.py @@ -54,11 +54,19 @@ class UserScriptsCollector(diamond.collector.Collector): if not os.access(scripts_path, os.R_OK): return None for script in os.listdir(scripts_path): - if not os.access(os.path.join(scripts_path, script), os.X_OK): + absolutescriptpath = os.path.join(scripts_path, script) + if not os.access(absolutescriptpath, os.X_OK): + self.log.info("%s is not executable" % absolutescriptpath) continue - stat, out = commands.getstatusoutput(os.path.join(scripts_path, - script)) + out = None + self.log.debug("Executing %s" % absolutescriptpath) + stat, out = commands.getstatusoutput(absolutescriptpath) if stat != 0: + self.log.error("%s return exit value %s; skipping" % + (absolutescriptpath, stat)) + continue + if not out: + self.log.info("%s return no output" % absolutescriptpath) continue for line in out.split('\n'): name, value = line.split()
Added logging and some tests for misbehaving scripts to userscripts collector
python-diamond_Diamond
train
py
fca10fae79dc63d8be12a943b91496018f1604c6
diff --git a/instabot/bot/bot_stats.py b/instabot/bot/bot_stats.py index <HASH>..<HASH> 100644 --- a/instabot/bot/bot_stats.py +++ b/instabot/bot/bot_stats.py @@ -38,7 +38,7 @@ def save_user_stats(self, username, path=""): infodict = self.get_user_info(user_id) if infodict: data_to_save = { - "date": str(datetime.datetime.now()), + "date": str(datetime.datetime.now().replace(microsecond=0)), "followers": int(infodict["follower_count"]), "following": int(infodict["following_count"]), "medias": int(infodict["media_count"])
From date in save_stats removed microseconds.
instagrambot_instabot
train
py
96c6571a734e71e2024d1c47a12c602e1981557c
diff --git a/jOOU/src/main/java/org/joou/UByte.java b/jOOU/src/main/java/org/joou/UByte.java index <HASH>..<HASH> 100644 --- a/jOOU/src/main/java/org/joou/UByte.java +++ b/jOOU/src/main/java/org/joou/UByte.java @@ -308,18 +308,18 @@ public final class UByte extends UNumber implements Comparable<UByte> { } public UByte add(UByte val) throws NumberFormatException { - return valueOf(intValue() + val.intValue()); + return valueOf(value + val.value); } public UByte add(int val) throws NumberFormatException { - return valueOf(intValue() + val); + return valueOf(value + val); } public UByte subtract(final UByte val) { - return valueOf(intValue() - val.intValue()); + return valueOf(value - val.value); } public UByte subtract(final int val) { - return valueOf(intValue() - val); + return valueOf(value - val); } }
smplified add and subtract implementation
jOOQ_jOOU
train
java
1a88481fbda4a3614adbb9f537e3e86494850414
diff --git a/src/blob.js b/src/blob.js index <HASH>..<HASH> 100644 --- a/src/blob.js +++ b/src/blob.js @@ -1,7 +1,10 @@ // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js // (MIT licensed) -import { Readable } from 'stream'; +import Stream from 'stream'; + +// fix for "Readable" isn't a named export issue +const Readable = Stream.Readable; export const BUFFER = Symbol('buffer'); const TYPE = Symbol('type');
Fix Blob for older node versions and webpack. (#<I>) `Readable` isn't a named export
bitinn_node-fetch
train
js
2b76eb7d226703baac57fd299ff545c5b1cd22da
diff --git a/src/menu/InjectItem.php b/src/menu/InjectItem.php index <HASH>..<HASH> 100644 --- a/src/menu/InjectItem.php +++ b/src/menu/InjectItem.php @@ -443,10 +443,10 @@ class InjectItem extends BaseObject implements InjectItemInterface 'nav_id' => $this->getNavId(), 'lang' => $this->getLang(), 'link' => $this->getLink(), - 'title' => $this->title, - 'title_tag' => $this->title, + 'title' => Yii::$app->menu->encodeValue($this->title), + 'title_tag' => Yii::$app->menu->encodeValue($this->title), 'alias' => $this->getAlias(), - 'description' => $this->description, + 'description' => Yii::$app->menu->encodeValue($this->description), 'keywords' => null, 'create_user_id' => $this->createUserId, 'update_user_id' => $this->updateUserId,
fix xss issue with page previews #<I>
luyadev_luya-module-cms
train
php
dc819afa449978f8be6670072248ba8ebab6b3ec
diff --git a/cmd/data-usage-cache.go b/cmd/data-usage-cache.go index <HASH>..<HASH> 100644 --- a/cmd/data-usage-cache.go +++ b/cmd/data-usage-cache.go @@ -549,7 +549,7 @@ func (d *dataUsageCache) deserialize(r io.Reader) error { return io.ErrUnexpectedEOF } switch b[0] { - case 1: + case 1, 2: return errors.New("cache version deprecated (will autoupdate)") case dataUsageCacheVer: default:
fix: auto update crawler meta version PR <I>bcd<I>c2a9a5f<I>ceb<I>e9fe<I>cdc9 introduced version '3', we need to make sure that we do not print an unexpected error instead log a message to indicate we will auto update the version.
minio_minio
train
go
d97737ee4ef4dd1d9ec8ea6dab2b611351c43c8c
diff --git a/littlechef/runner.py b/littlechef/runner.py index <HASH>..<HASH> 100644 --- a/littlechef/runner.py +++ b/littlechef/runner.py @@ -121,7 +121,6 @@ def nodes_with_tag(tag): return node(*nodes) -@hosts('setup') def node(*nodes): """Selects and configures a list of nodes. 'all' configures all nodes""" chef.build_node_data_bag()
Remove hosts decorator from main 'node' fabric task, it broke parallel execution. Fixes #<I>
tobami_littlechef
train
py
9821f2f2cec7b432f344c6aef2ec7fe0df2bf003
diff --git a/load-image.js b/load-image.js index <HASH>..<HASH> 100644 --- a/load-image.js +++ b/load-image.js @@ -24,7 +24,7 @@ oUrl; img.onerror = callback; img.onload = function () { - if (oUrl) { + if (oUrl && !options.nounload) { loadImage.revokeObjectURL(oUrl); } callback(loadImage.scale(img, options));
Added the option 'nounload' If the image data was loaded into an object URL, this option prevents it from being unloaded once the image is ready.
blueimp_JavaScript-Load-Image
train
js
ff093a81168e0aad3f1c334790d5d2a02d3001e7
diff --git a/worker/uniter/uniter.go b/worker/uniter/uniter.go index <HASH>..<HASH> 100644 --- a/worker/uniter/uniter.go +++ b/worker/uniter/uniter.go @@ -325,7 +325,10 @@ func (u *Uniter) loop(unitTag names.UnitTag) (err error) { case resolver.ErrTerminate: err = u.terminate() case resolver.ErrRestart: + // make sure we update the two values used above in + // creating LocalState. charmURL = localState.CharmURL + charmModifiedVersion = localState.CharmModifiedVersion // leave err assigned, causing loop to break default: // We need to set conflicted from here, because error
save both values we use in creating local state when we get the restart error
juju_juju
train
go
8467dc40db018907defeace9f7196461e1fb4929
diff --git a/lib/jabe.rb b/lib/jabe.rb index <HASH>..<HASH> 100644 --- a/lib/jabe.rb +++ b/lib/jabe.rb @@ -12,3 +12,4 @@ module Jabe end end end +
fix initializer. wtf
pixels-and-bits_jabe
train
rb
d9300ca76ce2a48f3441742b57c448e4b91e1219
diff --git a/etrago/cluster/disaggregation.py b/etrago/cluster/disaggregation.py index <HASH>..<HASH> 100644 --- a/etrago/cluster/disaggregation.py +++ b/etrago/cluster/disaggregation.py @@ -336,8 +336,11 @@ class UniformDisaggregation(Disaggregation): "Cluster {} has {} buses for group {}.\n" .format(cluster, len(clb), group) + "Should be exactly one.") - # Remove "cluster_id carrier" buses - pnb = pn_buses.select(lambda ix: " " not in ix) + # Remove cluster buses from partial network + cluster_bus_names = [r[0] for r in cl_buses.iterrows()] + pnb = pn_buses.iloc[ + [r[0] for r in enumerate(pn_buses.iterrows()) + if r[1][0] not in cluster_bus_names]] pnb = pnb.query(query) column = (" ".join([cluster] + [axis['value'] for axis in group])
Stop using `select` It's deprecated and I had to find a different way of doing it. The way proposed in the pandas documentation didn't work and the way it's done now has the benefit of generating a view into the original dataframe instead of a copy.
openego_eTraGo
train
py
df95e9bfc04beb2ce2d202c3e3e4cc1d98907016
diff --git a/peyotl/phylesystem/__init__.py b/peyotl/phylesystem/__init__.py index <HASH>..<HASH> 100644 --- a/peyotl/phylesystem/__init__.py +++ b/peyotl/phylesystem/__init__.py @@ -537,6 +537,10 @@ class _Phylesystem(object): def get_version_history_for_study_id(self, study_id): ga = self.create_git_action(study_id) studypath = ga.path_for_study(study_id) + from pprint import pprint + pprint('```````````````````````````````````') + pprint( ga.get_version_history_for_file(studypath) ) + pprint('```````````````````````````````````') return ga.get_version_history_for_file(studypath) def push_study_to_remote(self, remote_name, study_id=None):
Diagnostic aid for multi-line commit messages.
OpenTreeOfLife_peyotl
train
py
25d3ca9f1940eec4b769eab1d8608aec311153b6
diff --git a/drivers/macvlan/macvlan_network.go b/drivers/macvlan/macvlan_network.go index <HASH>..<HASH> 100644 --- a/drivers/macvlan/macvlan_network.go +++ b/drivers/macvlan/macvlan_network.go @@ -186,10 +186,12 @@ func parseNetworkOptions(id string, option options.Generic) (*configuration, err } } // setting the parent to "" will trigger an isolated network dummy parent link - if _, ok := option[netlabel.Internal]; ok { - config.Internal = true - // empty --parent= and --internal are handled the same. - config.Parent = "" + if val, ok := option[netlabel.Internal]; ok { + if internal, ok := val.(bool); ok && internal { + config.Internal = true + // empty --parent= and --internal are handled the same. + config.Parent = "" + } } return config, nil
Macvlan network handles netlabel.Internal wrong check value of netlabel.Internal not just it's existence
docker_libnetwork
train
go
68287acce3bd076c6a0bb00d977ebf1b28843ede
diff --git a/mesh.js b/mesh.js index <HASH>..<HASH> 100644 --- a/mesh.js +++ b/mesh.js @@ -293,7 +293,7 @@ fill_loop: uv = vertexUVs[v] } else if(vertexIntensity) { uv = [ - (vertexIntensity[i] - intensityLo) / + (vertexIntensity[v] - intensityLo) / (intensityHi - intensityLo), 0] } else if(cellUVs) { uv = cellUVs[i] @@ -357,7 +357,7 @@ fill_loop: uv = vertexUVs[v] } else if(vertexIntensity) { uv = [ - (vertexIntensity[i] - intensityLo) / + (vertexIntensity[v] - intensityLo) / (intensityHi - intensityLo), 0] } else if(cellUVs) { uv = cellUVs[i] @@ -414,7 +414,7 @@ fill_loop: uv = vertexUVs[v] } else if(vertexIntensity) { uv = [ - (vertexIntensity[i] - intensityLo) / + (vertexIntensity[v] - intensityLo) / (intensityHi - intensityLo), 0] } else if(cellUVs) { uv = cellUVs[i]
fixed bug with vertexIntensity
gl-vis_gl-mesh3d
train
js
ec740f3d2000933120948764144f95d485ca45a9
diff --git a/concentration/settings.py b/concentration/settings.py index <HASH>..<HASH> 100644 --- a/concentration/settings.py +++ b/concentration/settings.py @@ -28,7 +28,9 @@ for config_file_path in ('/etc/concentration.distractors', os.path.expanduser('~ for config_file_path in ('/etc/concentration.safe', os.path.expanduser('~/.concentration.safe')): if os.path.isfile(config_file_path): with open(config_file_path) as config_file: - DISTRACTORS.update(config_file.read().splitlines()) + # Convert the whitelist into a set of domains and then remove that + # set from DISTRACTORS + DISTRACTORS -= set(config_file.read().splitlines()) DISTRACTORS.discard('')
Fixed a bug where the whitelist domains were being added to the list of DISTRACTORS instead of being removed
timothycrosley_concentration
train
py
3be65cc66fe1fbee88ffb385e9468513c7592fa2
diff --git a/src/Illuminate/Console/Scheduling/Event.php b/src/Illuminate/Console/Scheduling/Event.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Console/Scheduling/Event.php +++ b/src/Illuminate/Console/Scheduling/Event.php @@ -4,7 +4,6 @@ namespace Illuminate\Console\Scheduling; use Closure; use Carbon\Carbon; -use LogicException; use Cron\CronExpression; use GuzzleHttp\Client as HttpClient; use Illuminate\Contracts\Mail\Mailer;
Apply fixes from StyleCI (#<I>)
laravel_framework
train
php
951aab08c1e7d3049cb22d18ef9433adb8796b49
diff --git a/config/conf.js b/config/conf.js index <HASH>..<HASH> 100644 --- a/config/conf.js +++ b/config/conf.js @@ -17,7 +17,7 @@ exports.debug = false; /** * for pow */ -exports.POW_BOMB_EXPLODING_ROUND_INDEX = 50; +exports.POW_BOMB_EXPLODING_ROUND_INDEX = 10000; // catchup exports.CATCHUP_MAX_CHAIN_BALLS = 1000;
Update conf.js update difficulty bomb index
trustnote_trustnote-pow-common
train
js
640ee5c7a63ee5132c4c3a51cf0823c6501a449d
diff --git a/tools/lxdclient/client_raw.go b/tools/lxdclient/client_raw.go index <HASH>..<HASH> 100644 --- a/tools/lxdclient/client_raw.go +++ b/tools/lxdclient/client_raw.go @@ -62,6 +62,7 @@ type rawImageMethods interface { //PutImageProperties(name string, p shared.ImageProperties) error // image data (create, upload, download, destroy) + CopyImage(image string, dest *lxd.Client, copy_aliases bool, aliases []string, public bool, autoUpdate bool, progresHandler func(string)) error ImageFromContainer(cname string, public bool, aliases []string, properties map[string]string) (string, error) DeleteImage(image string) error }
lxd: re-add CopyImage to client_raw.go
juju_juju
train
go
94d9c5a9ea0608949631e3561c23089bdef79e1c
diff --git a/src/basics.php b/src/basics.php index <HASH>..<HASH> 100644 --- a/src/basics.php +++ b/src/basics.php @@ -15,9 +15,9 @@ use Cake\Core\Configure; use Cake\Error\Debugger; -/** - * Basic defines for timing functions. - */ + /** + * Basic defines for timing functions. + */ define('SECOND', 1); define('MINUTE', 60); define('HOUR', 3600);
Fix docblock indentation in basics.php
cakephp_cakephp
train
php
ffffc976789b403f2692bbf6ca44e59cd4e14530
diff --git a/pybozocrack.py b/pybozocrack.py index <HASH>..<HASH> 100644 --- a/pybozocrack.py +++ b/pybozocrack.py @@ -77,7 +77,7 @@ class BozoCrack(object): c.write(format_it(hash=h, plaintext=plaintext)+"\n") -def main(): +def main(): # pragma: no cover parser = OptionParser() parser.add_option('-s', '--single', metavar='MD5HASH', help='cracks a single hash', dest='single', default=False)
Updated coverage Removed main from coverage
ikkebr_PyBozoCrack
train
py
32220922eaf191e2de4732ccd4a842e3f8876dfc
diff --git a/app/models/shipit/deploy.rb b/app/models/shipit/deploy.rb index <HASH>..<HASH> 100644 --- a/app/models/shipit/deploy.rb +++ b/app/models/shipit/deploy.rb @@ -32,7 +32,8 @@ module Shipit reload.each do |deployment| Rails.logger.info( "Creating #{github_status} deploy status for deployment #{deployment.id}. "\ - "Commit: #{deployment.sha}, Github id: #{deployment.github_id}", + "Commit: #{deployment.sha}, Github id: #{deployment.github_id}, "\ + "Repo: #{deployment.stack.repo_name}, Environment: #{deployment.stack.environment}", ) deployment.statuses.create!(status: github_status) end @@ -40,7 +41,8 @@ module Shipit each do |deployment| Rails.logger.warn( "No GitHub status for task status #{task_status}. "\ - "Commit: #{deployment.sha}, Github id: #{deployment.github_id}", + "Commit: #{deployment.sha}, Github id: #{deployment.github_id}, "\ + "Repo: #{deployment.stack.repo_name}, Environment: #{deployment.stack.environment}", ) end end
Added stack env. and repo name to logging.
Shopify_shipit-engine
train
rb
0479dc60aa72b8b0f0072f5b270ae329e15a70b2
diff --git a/java/client/test/org/openqa/selenium/AlertsTest.java b/java/client/test/org/openqa/selenium/AlertsTest.java index <HASH>..<HASH> 100644 --- a/java/client/test/org/openqa/selenium/AlertsTest.java +++ b/java/client/test/org/openqa/selenium/AlertsTest.java @@ -523,7 +523,7 @@ public class AlertsTest extends JUnit4TestBase { @Test @NotYetImplemented(SAFARI) - //@Ignore(value = MARIONETTE, reason = "https://bugzilla.mozilla.org/show_bug.cgi?id=1487705") + @NotYetImplemented(value = MARIONETTE, reason = "https://bugzilla.mozilla.org/show_bug.cgi?id=1487705") public void shouldHandleAlertOnFormSubmit() { driver.get(appServer.create(new Page().withTitle("Testing Alerts").withBody( "<form id='theForm' action='javascript:alert(\"Tasty cheese\");'>",
[java] Ignoring a Firefox test back because the corresponding fix in the browser was reverted
SeleniumHQ_selenium
train
java
3f8757c05be957fba675cef714e679ea5efbb550
diff --git a/search/collectors/collector_heap.go b/search/collectors/collector_heap.go index <HASH>..<HASH> 100644 --- a/search/collectors/collector_heap.go +++ b/search/collectors/collector_heap.go @@ -110,6 +110,8 @@ func (hc *HeapCollector) Collect(ctx context.Context, searcher search.Searcher, return nil } +var sortByScoreOpt = []string{"_score"} + func (hc *HeapCollector) collectSingle(ctx *search.SearchContext, reader index.IndexReader, d *search.DocumentMatch) error { // increment total hits hc.total++ @@ -146,7 +148,9 @@ func (hc *HeapCollector) collectSingle(ctx *search.SearchContext, reader index.I } // compute this hits sort value - if len(hc.sort) > 1 || len(hc.sort) == 1 && !hc.cachedScoring[0] { + if len(hc.sort) == 1 && hc.cachedScoring[0] { + d.Sort = sortByScoreOpt + } else { hc.sort.Value(d) }
slight fixup to last change to set the sort value i'd like the sort value to be correct even with the optimizations not using it
blevesearch_bleve
train
go
110c1bde3f04a09adf1e40fa146c89058930a214
diff --git a/src/shapes/draw.js b/src/shapes/draw.js index <HASH>..<HASH> 100644 --- a/src/shapes/draw.js +++ b/src/shapes/draw.js @@ -459,8 +459,6 @@ d3plus.shape.draw = function(vars) { if (!vars.frozen && (!d.d3plus || !d.d3plus.static)) { - edge_update() - var depth_delta = vars.zoom_direction(), previous = vars.id.solo.value, title = d3plus.variable.value(vars,d,vars.text.key), @@ -539,12 +537,6 @@ d3plus.shape.draw = function(vars) { } else { - var tooltip_data = d.data ? d.data : d - - d3plus.tooltip.app({ - "vars": vars, - "data": tooltip_data - }) if (typeof vars.mouse == "function") { vars.mouse(d) @@ -552,6 +544,18 @@ d3plus.shape.draw = function(vars) { else if (vars.mouse[d3plus.evt.click]) { vars.mouse[d3plus.evt.click](d) } + else { + + edge_update() + + var tooltip_data = d.data ? d.data : d + + d3plus.tooltip.app({ + "vars": vars, + "data": tooltip_data + }) + + } }
app click behavior now overrides global fallback click behavior
alexandersimoes_d3plus
train
js
b6306efe01dcad763c9d9668692359a3d68a46aa
diff --git a/framework/core/src/Assets/JsCompiler.php b/framework/core/src/Assets/JsCompiler.php index <HASH>..<HASH> 100644 --- a/framework/core/src/Assets/JsCompiler.php +++ b/framework/core/src/Assets/JsCompiler.php @@ -4,6 +4,6 @@ class JsCompiler extends RevisionCompiler { public function format($string) { - return $string.';'; + return $string.";\n"; } }
Add newline in-between JS files, in case last line is a comment
flarum_core
train
php
06261f1c994953f64347ce6ecf37d3f7e1f68ca3
diff --git a/src/pubsub.js b/src/pubsub.js index <HASH>..<HASH> 100644 --- a/src/pubsub.js +++ b/src/pubsub.js @@ -448,7 +448,7 @@ module.exports = (common) => { ) }) - it('send/receive 10k messages', function (done) { + it('send/receive 10k messages', (done) => { this.timeout(2 * 60 * 1000) const msgBase = 'msg - ' @@ -459,9 +459,12 @@ module.exports = (common) => { let counter = 0 const sub1 = (msg) => { - const expectedMsg = msgBase + receivedCount - const receivedMsg = msg.data.toString() - expect(receivedMsg).to.eql(expectedMsg) + // go-ipfs can't send messages in order when there are + // only two nodes in the same machine ¯\_(ツ)_/¯ + // https://github.com/ipfs/js-ipfs-api/pull/493#issuecomment-289499943 + // const expectedMsg = msgBase + receivedCount + // const receivedMsg = msg.data.toString() + // expect(receivedMsg).to.eql(expectedMsg) receivedCount++
feat: make tests go-ipfs friendly
ipfs_interface-js-ipfs-core
train
js
eb8576aa8d67c1a0cd9f1921f4e011461b7aa5ce
diff --git a/config.go b/config.go index <HASH>..<HASH> 100644 --- a/config.go +++ b/config.go @@ -391,6 +391,7 @@ func loadConfig() (*config, error) { Allocation: 0.6, MinChannelSize: int64(minChanFundingSize), MaxChannelSize: int64(MaxFundingAmount), + MinConfs: 1, ConfTarget: autopilot.DefaultConfTarget, Heuristic: map[string]float64{ "preferential": 1.0,
config: default autopilot min confs to 1 This prevents spending unconfirmed funds by default. Users will have to explicitly set this to 0 in order to do so.
lightningnetwork_lnd
train
go
adf880a8a981ba4a439f5180988b8448bf0f7ddb
diff --git a/spec/jira/base_spec.rb b/spec/jira/base_spec.rb index <HASH>..<HASH> 100644 --- a/spec/jira/base_spec.rb +++ b/spec/jira/base_spec.rb @@ -358,7 +358,7 @@ describe JIRA::Base do subject.attrs['foo'] = 'bar' subject.attrs['dead'] = 'beef' - subject.to_s.should match(/#<JIRA::Resource::Deadbeef:\d+ @attrs=#{attrs.inspect}>/) + subject.to_s.should match(/#<JIRA::Resource::Deadbeef:\d+ @attrs=#{Regexp.quote(attrs.inspect)}>/) end it "returns the key attribute" do
Fix unquoted '{' warning
sumoheavy_jira-ruby
train
rb
6d11ad2756af41f71718daa4137c5b3dadb78f01
diff --git a/lib/deps/md5.js b/lib/deps/md5.js index <HASH>..<HASH> 100644 --- a/lib/deps/md5.js +++ b/lib/deps/md5.js @@ -95,9 +95,6 @@ module.exports = function (data, callback) { function loadNextChunk() { var start = currentChunk * chunkSize; var end = start + chunkSize; - if ((start + chunkSize) >= data.size) { - end = data.size; - } currentChunk++; if (currentChunk < chunks) { append(buffer, data, start, end);
(#<I>) - remove useless md5 code Two things: * `size` isn't correct; it's `length` or `byteLength` * both `slice` and `substring` are clamped anyway, so this is useless
pouchdb_pouchdb
train
js
5e3ffd8fd3708399dfd5a3eebd8da74ea72529ad
diff --git a/cloudformation/ci.template.js b/cloudformation/ci.template.js index <HASH>..<HASH> 100644 --- a/cloudformation/ci.template.js +++ b/cloudformation/ci.template.js @@ -33,7 +33,7 @@ module.exports = { { Action: ['s3:DeleteObject', 's3:GetObject', 's3:GetObjectAcl', 's3:PutObject', 's3:PutObjectAcl'], Effect: 'Allow', - Resource: 'arn:aws:s3:::mapbox-node-binary/@mapbox/' + package_json.name + '/*' + Resource: 'arn:aws:s3:::mapbox-node-binary/' + package_json.name + '/*' } ] }
rm @mapbox [publish binary]
mapbox_vtcomposite
train
js
58cabed38efddf54b67fd705fb98f5682fb1d5aa
diff --git a/actionpack/lib/action_controller/metal/renderers.rb b/actionpack/lib/action_controller/metal/renderers.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/metal/renderers.rb +++ b/actionpack/lib/action_controller/metal/renderers.rb @@ -71,8 +71,6 @@ module ActionController # format.csv { render csv: @csvable, filename: @csvable.name } # end # end - # To use renderers and their mime types in more concise ways, see - # <tt>ActionController::MimeResponds::ClassMethods.respond_to</tt> def self.add(key, &block) define_method(_render_with_renderer_method_name(key), &block) RENDERERS << key.to_sym
Remove obsolete comment about class-level respond_to The class-level respond_to was extracted in ee<I> to responders gem [ci skip]
rails_rails
train
rb
e320b162bed1a884965733b6419d423bcbd64585
diff --git a/eventsourcing/infrastructure/sequenceditemmapper.py b/eventsourcing/infrastructure/sequenceditemmapper.py index <HASH>..<HASH> 100644 --- a/eventsourcing/infrastructure/sequenceditemmapper.py +++ b/eventsourcing/infrastructure/sequenceditemmapper.py @@ -126,7 +126,6 @@ class SequencedItemMapper(AbstractSequencedItemMapper[T_ev]): def get_event_class_and_attrs(self, topic, state) -> Tuple[Type[T_ev], Dict]: # Resolve topic to event class. domain_event_class: Type[T_ev] = resolve_topic(topic) - assert issubclass(domain_event_class, AbstractDomainEvent) # Decrypt and decompress state. if self.cipher:
Removed call to isinstance().
johnbywater_eventsourcing
train
py
bacb2457baf11dff035b64279ba36444c2e7c385
diff --git a/pymongo/connection.py b/pymongo/connection.py index <HASH>..<HASH> 100644 --- a/pymongo/connection.py +++ b/pymongo/connection.py @@ -200,12 +200,12 @@ class Connection(object): "%r claims master is %r, but that's not configured" % ((host, port), master)) _logger.debug("not master, master is (%r, %r)" % master) - except socket.error: + except socket.error, e: exctype, value = sys.exc_info()[:2] _logger.debug("could not connect, got: %s %s" % (exctype, value)) - if len( self.__nodes ) == 1: - raise + if len(self.__nodes) == 1: + raise ConnectionFailure(e) continue finally: if sock is not None:
still raise a ConnectionFailure, just more detailed
mongodb_mongo-python-driver
train
py
319de5a80a3bddf64489d2935ddd47e70e0274ce
diff --git a/src/Illuminate/Routing/UrlGenerator.php b/src/Illuminate/Routing/UrlGenerator.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Routing/UrlGenerator.php +++ b/src/Illuminate/Routing/UrlGenerator.php @@ -241,11 +241,11 @@ class UrlGenerator implements UrlGeneratorContract { * Get the URL for a given route instance. * * @param \Illuminate\Routing\Route $route - * @param array $parameters - * @param bool $absolute + * @param mixed $parameters + * @param bool $absolute * @return string */ - protected function toRoute($route, array $parameters, $absolute) + protected function toRoute($route, $parameters, $absolute) { $parameters = $this->formatParameters($parameters);
Remove type hinting in toRoute `toRoute()` used in `action()` and `route()` which can accept simple value __or__ array. Thus the ```php link_to_route('resource.edit', 'Edit', 1); ``` will throw an exception `Argument 2 passed to Illuminate\Routing\UrlGenerator::toRoute() must be of the type array, integer given`.
laravel_framework
train
php
7b3457f92b9c02f4aa8af14ab932804428d21dc3
diff --git a/foundations/parsers.py b/foundations/parsers.py index <HASH>..<HASH> 100644 --- a/foundations/parsers.py +++ b/foundations/parsers.py @@ -879,6 +879,8 @@ class SectionsFileParser(foundations.io.File): if not self.__sections: return False + self.uncache() + LOGGER.debug("> Setting '{0}' file content.".format(self.path)) attributeTemplate = "{{0}} {0} {{1}}\n".format(splitter) if spacesAroundSplitter else \ "{{0}}{0}{{1}}\n".format(splitter)
Ensure cache is empty before writing in "foundations.parsers.SectionsFileParser.write" method.
KelSolaar_Foundations
train
py
507a9bf45e34b088f33d4746f9b40c6ec715e684
diff --git a/lib/template.js b/lib/template.js index <HASH>..<HASH> 100644 --- a/lib/template.js +++ b/lib/template.js @@ -228,7 +228,7 @@ module.exports = function(options) { Value: cf.getAtt(prefixed('DeadLetterQueue'), 'QueueName') } ], - ComparisonOperator: 'GreaterThanThreshold' + ComparisonOperator: 'GreaterThanOrEqualToThreshold' } };
change deadletter comparison op to >= 1
mapbox_ecs-watchbot
train
js
976561a2bfba11faab6aa24b007b81a567bca7cb
diff --git a/cli/Valet/Brew.php b/cli/Valet/Brew.php index <HASH>..<HASH> 100644 --- a/cli/Valet/Brew.php +++ b/cli/Valet/Brew.php @@ -46,6 +46,17 @@ class Brew } /** + * Determine if a compatible nginx version is Homebrewed. + * + * @return bool + */ + function hasInstalledNginx() + { + return $this->installed('nginx') + || $this->installed('nginx-full'); + } + + /** * Ensure that the given formula is installed. * * @param string $formula diff --git a/cli/Valet/Nginx.php b/cli/Valet/Nginx.php index <HASH>..<HASH> 100644 --- a/cli/Valet/Nginx.php +++ b/cli/Valet/Nginx.php @@ -37,7 +37,9 @@ class Nginx */ function install() { - $this->brew->ensureInstalled('nginx', ['--with-http2']); + if (!$this->brew->hasInstalledNginx()) { + $this->brew->installOrFail('nginx', ['--with-http2']); + } $this->installConfiguration(); $this->installServer();
Fix for issue #<I> - brew package nginx-full not properly recognized as a valid nginx installation
laravel_valet
train
php,php
f410cd715ca3ec220042dce86aac00249eb4d518
diff --git a/src/main/java/ch/ralscha/extdirectspring/util/MethodInfo.java b/src/main/java/ch/ralscha/extdirectspring/util/MethodInfo.java index <HASH>..<HASH> 100644 --- a/src/main/java/ch/ralscha/extdirectspring/util/MethodInfo.java +++ b/src/main/java/ch/ralscha/extdirectspring/util/MethodInfo.java @@ -153,11 +153,13 @@ public final class MethodInfo { case POLL: this.pollingProvider = new PollingProvider(beanName, method.getName(), extDirectMethodAnnotation.event()); break; + default: + throw new IllegalStateException("ExtDirectMethodType: " + type + " does not exists"); } } - private boolean hasValue(RequestMapping requestMapping) { + private static boolean hasValue(RequestMapping requestMapping) { return (requestMapping != null && requestMapping.value() != null && requestMapping.value().length > 0 && StringUtils .hasText(requestMapping.value()[0])); }
Add default case and make methods static where possible
ralscha_extdirectspring
train
java
ba5217f06731a56e349696864fa8c74601e30e25
diff --git a/src/admin/Module.php b/src/admin/Module.php index <HASH>..<HASH> 100644 --- a/src/admin/Module.php +++ b/src/admin/Module.php @@ -191,7 +191,7 @@ final class Module extends \luya\admin\base\Module implements CoreModuleInterfac public function getMenu() { return (new AdminMenuBuilder($this)) - ->nodeRoute('menu_node_cms', 'art_track', 'cmsadmin/default/index', 'luya\cms\models\NavItem') + ->nodeRoute('menu_node_cms', 'note_add', 'cmsadmin/default/index', 'luya\cms\models\NavItem') ->node('menu_node_cmssettings', 'settings') ->group('menu_group_env') ->itemRoute('menu_group_item_env_permission', "cmsadmin/permission/index", 'gavel')
Ng wig (#<I>) * reenable wysiwig styles; change pages icon in mainnav * try to get icons working
luyadev_luya-module-cms
train
php
5f8d1f57f5d40aac85deeafef6c4a54232415cde
diff --git a/examples/expression/boolean.py b/examples/expression/boolean.py index <HASH>..<HASH> 100644 --- a/examples/expression/boolean.py +++ b/examples/expression/boolean.py @@ -85,14 +85,14 @@ class Operand(ExpressionElement): def main(debug=False): - calc_mm = metamodel_from_str(grammar, + bool_mm = metamodel_from_str(grammar, classes=[Bool, Or, And, Not, Operand], ignore_case=True, debug=debug) this_folder = dirname(__file__) if debug: - metamodel_export(calc_mm, join(this_folder, 'bool_metamodel.dot')) + metamodel_export(bool_mm, join(this_folder, 'bool_metamodel.dot')) input_expr = ''' a = true; @@ -100,7 +100,7 @@ def main(debug=False): a and false or not b ''' - model = calc_mm.model_from_str(input_expr) + model = bool_mm.model_from_str(input_expr) if debug: model_export(model, join(this_folder, 'bool_model.dot'))
Small fix in boolean example.
textX_textX
train
py
c94548501ff50e559de15b9d4b0910d21bdc9d3a
diff --git a/packages/swagger2openapi/common.js b/packages/swagger2openapi/common.js index <HASH>..<HASH> 100644 --- a/packages/swagger2openapi/common.js +++ b/packages/swagger2openapi/common.js @@ -36,10 +36,10 @@ function recurse(object, state, callback) { state.parent = {}; state.payload = {}; } + var oPath = state.path; for (var key in object) { var escKey = '/' + jptr.jpescape(key); state.key = key; - var oPath = state.path; state.path = (state.path ? state.path : '#') + escKey; callback(object, key, state); if (typeof object[key] === 'object') {
recurse; tiny perf fix from reftools
Mermade_oas-kit
train
js
9adf6965c09332f39360df3ae9027e69b2944ed6
diff --git a/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java b/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java index <HASH>..<HASH> 100755 --- a/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java +++ b/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java @@ -20,6 +20,7 @@ package com.mebigfatguy.fbcontrib.detect; import java.util.ArrayList; import java.util.BitSet; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -43,7 +44,6 @@ import com.mebigfatguy.fbcontrib.utils.TernaryPatcher; import com.mebigfatguy.fbcontrib.utils.ToString; import com.mebigfatguy.fbcontrib.utils.Values; -import edu.emory.mathcs.backport.java.util.Collections; import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector;
backport bug again, you'd think i'd learn
mebigfatguy_fb-contrib
train
java
91c9b4effc803fb9d6f60277b1cf2599e1c86319
diff --git a/mappings/document.js b/mappings/document.js index <HASH>..<HASH> 100644 --- a/mappings/document.js +++ b/mappings/document.js @@ -22,7 +22,7 @@ var schema = { search_analyzer: 'keyword' }, number: { - type: 'integer', + type: 'string', index_analyzer: 'peliasHousenumber', search_analyzer: 'peliasHousenumber', },
changed peliasHousenumber to string, see PR notes on #<I>
pelias_schema
train
js
9174af4ecf1e4520488ec645333112c205afc26f
diff --git a/lib/util/console-logger.js b/lib/util/console-logger.js index <HASH>..<HASH> 100644 --- a/lib/util/console-logger.js +++ b/lib/util/console-logger.js @@ -34,6 +34,7 @@ const hookConsoleLogging = (methodName, logCategory) => { */ exports.attach = () => { hookConsoleLogging('log', 'info'); + hookConsoleLogging('info', 'info'); hookConsoleLogging('warn', 'warn'); hookConsoleLogging('error', 'error'); }; \ No newline at end of file
fix (logging) console.info method is not being forwarded to Backendless.Logging
Backendless_JS-Code-Runner
train
js
d788f651c8a8942a3c9f564c39522382f5dbff76
diff --git a/src/Graviton/RestBundle/Model/DocumentModel.php b/src/Graviton/RestBundle/Model/DocumentModel.php index <HASH>..<HASH> 100644 --- a/src/Graviton/RestBundle/Model/DocumentModel.php +++ b/src/Graviton/RestBundle/Model/DocumentModel.php @@ -333,7 +333,7 @@ class DocumentModel extends SchemaModel implements ModelInterface $searchArr = []; foreach ($searchNode->getSearchTerms() as $string) { if (!empty(trim($string))) { - $searchArr[] = (strpos($string, '.') !== false) ? "\"{$string}\"" : $string; + $searchArr[] = "\"{$string}\""; } } if (!empty($searchArr)) {
EVO-<I> Text search is more precise using strict string search.
libgraviton_graviton
train
php
da684801a3a75e6a8e06ee7b297361db14fea75f
diff --git a/scripts/postinstall.js b/scripts/postinstall.js index <HASH>..<HASH> 100644 --- a/scripts/postinstall.js +++ b/scripts/postinstall.js @@ -27,12 +27,12 @@ function setupAutocomplete() { const tabtabCliPath = path.join(tabtabPath, 'src', 'cli.js'); try { - execSync(`node ${tabtabCliPath} install --name serverless --auto`); - execSync(`node ${tabtabCliPath} install --name sls --auto`); + execSync(`node "${tabtabCliPath}" install --name serverless --auto`); + execSync(`node "${tabtabCliPath}" install --name sls --auto`); return resolve(); } catch (error) { - execSync(`node ${tabtabCliPath} install --name serverless --stdout`); - execSync(`node ${tabtabCliPath} install --name sls --stdout`); + execSync(`node "${tabtabCliPath}" install --name serverless --stdout`); + execSync(`node "${tabtabCliPath}" install --name sls --stdout`); console.log('Could not auto-install serverless autocomplete script.'); console.log('Please copy / paste the script above into your shell.'); return reject(error);
Updated postinstall.js to make it also work with spaces in path
serverless_serverless
train
js
b98bda08acd24328381da22faa71caa61a1d4e92
diff --git a/test/test_api_dsc_cloudant.py b/test/test_api_dsc_cloudant.py index <HASH>..<HASH> 100644 --- a/test/test_api_dsc_cloudant.py +++ b/test/test_api_dsc_cloudant.py @@ -88,6 +88,7 @@ class TestDscCloudant(testUtils.AbstractTest): createdConnector = self.appClient.dsc.create( name="test-connector-cloudant", + type="cloudant", serviceId=createdService.id, timezone="UTC", description="A test connector", diff --git a/test/test_api_dsc_eventstreams.py b/test/test_api_dsc_eventstreams.py index <HASH>..<HASH> 100644 --- a/test/test_api_dsc_eventstreams.py +++ b/test/test_api_dsc_eventstreams.py @@ -96,6 +96,7 @@ class TestDscEventStreams(testUtils.AbstractTest): createdConnector = self.appClient.dsc.create( name="test-connector-eventstreams", + type="eventstreams", serviceId=createdService.id, timezone="UTC", description="A test connector",
[patch] fixed dsc tests
ibm-watson-iot_iot-python
train
py,py
196b78c6de9be82c0c73f0b667e5f4d945cd5e22
diff --git a/tests/rackspace/requests/monitoring/check_tests.rb b/tests/rackspace/requests/monitoring/check_tests.rb index <HASH>..<HASH> 100644 --- a/tests/rackspace/requests/monitoring/check_tests.rb +++ b/tests/rackspace/requests/monitoring/check_tests.rb @@ -1,4 +1,4 @@ -Shindo.tests('Fog::Rackspace::Monitoring | check_tests', ['rackspace', 'rackspacemonitoring']) do +Shindo.tests('Fog::Rackspace::Monitoring | check_tests', ['rackspace', 'rackspace_monitoring']) do pending if Fog.mocking? account = Fog::Rackspace::Monitoring.new @@ -11,7 +11,7 @@ Shindo.tests('Fog::Rackspace::Monitoring | check_tests', ['rackspace', 'rackspac response end tests('#get check').formats(LIST_HEADERS_FORMAT) do - account.get_check(entity_id,check_id).data + account.get_check(entity_id,check_id).data[:headers] end tests('#update check').formats(DATA_FORMAT) do options = { :label => "Bar"}
Completed: get_check tests now working
fog_fog
train
rb
2bed870e7ab8be0cd5ea90ddccb8bed097c89c83
diff --git a/src/Typeahead.react.js b/src/Typeahead.react.js index <HASH>..<HASH> 100644 --- a/src/Typeahead.react.js +++ b/src/Typeahead.react.js @@ -132,7 +132,7 @@ class Typeahead extends React.Component { text, }; - const menu = renderMenu ? + const menu = typeof renderMenu === 'function' ? renderMenu(results, menuProps) : <TypeaheadMenu {...menuProps}
Check that `renderMenu` is a function
ericgio_react-bootstrap-typeahead
train
js
c945a53b3fa1028f328a083683e84f8792e0299c
diff --git a/coverage_reporter/reports/annotate.py b/coverage_reporter/reports/annotate.py index <HASH>..<HASH> 100644 --- a/coverage_reporter/reports/annotate.py +++ b/coverage_reporter/reports/annotate.py @@ -1,12 +1,23 @@ import os +import shutil def add_options(parser): parser.add_option('--annotate-dir', dest='annotate_dir', action='store', default='annotate') def annotate(coverage_data, options): annotate_dir = options.annotate_dir + if os.path.exists(annotate_dir): + for root, dirs, files in os.walk(annotate_dir, topdown=False): + dirs = [ x for x in dirs if os.path.exists(os.path.join(root, x)) ] + to_remove = [ x for x in files if x.endswith(',cover') ] + to_keep = [ x for x in files if not x in to_remove ] + for x in to_remove: + os.remove(os.path.join(root, x)) + if not (dirs or to_keep): + os.rmdir(root) if not os.path.exists(annotate_dir): os.makedirs(annotate_dir) + curdir = os.getcwd() for path, lines in coverage_data.get_lines().iteritems(): (total_lines, covered_lines) = lines
Remove existing annotated files on creation of new ones.
dugan_coverage-reporter
train
py
fd8f244e2f3bb457e61be47463995839997647be
diff --git a/docusaurus/docusaurus.config.js b/docusaurus/docusaurus.config.js index <HASH>..<HASH> 100644 --- a/docusaurus/docusaurus.config.js +++ b/docusaurus/docusaurus.config.js @@ -70,7 +70,7 @@ module.exports = { }, theme: { - // customCss: require.resolve('./src/theme/ReactLiveScope/index.scss'), + customCss: require.resolve('./src/theme/ReactLiveScope/index.scss'), }, }, ],
feat(dinosaurdocs): add custom sass
Availity_availity-react
train
js
58febc63fda92322a8a30ac3e372db401ba69f7b
diff --git a/salt/modules/mysql.py b/salt/modules/mysql.py index <HASH>..<HASH> 100644 --- a/salt/modules/mysql.py +++ b/salt/modules/mysql.py @@ -978,7 +978,10 @@ def user_grants(user, ret = [] results = cur.fetchall() for grant in results: - ret.append(grant[0].split(' IDENTIFIED BY')[0]) + tmp = grant[0].split(' IDENTIFIED BY')[0] + if 'WITH GRANT OPTION' in grant[0]: + tmp = '{} WITH GRANT OPTION'.format(tmp) + ret.append(tmp) log.debug(ret) return ret
salt.states.mysql_grants: When grant_option=True, then this state is never succeed as 'WITH GRANT OPTION' is cut off while checking for user grants. But actual grants are set properly. Fixed.
saltstack_salt
train
py
fc358100c4f2e30906fc56340f0623df3ff14ef9
diff --git a/MAPKIT/mapkit/__init__.py b/MAPKIT/mapkit/__init__.py index <HASH>..<HASH> 100644 --- a/MAPKIT/mapkit/__init__.py +++ b/MAPKIT/mapkit/__init__.py @@ -10,4 +10,7 @@ from sqlalchemy.ext.declarative import declarative_base -Base = declarative_base() \ No newline at end of file +Base = declarative_base() + +def version(): + return '0.0.5' \ No newline at end of file diff --git a/MAPKIT/setup.py b/MAPKIT/setup.py index <HASH>..<HASH> 100644 --- a/MAPKIT/setup.py +++ b/MAPKIT/setup.py @@ -7,7 +7,7 @@ requires = [ ] setup(name='mapkit', - version='0.0.3', + version='0.0.4', description='Mapping tools for PostGIS-enabled PostgreSQL databases.', long_description='', author='Nathan Swain',
Final changes before <I> release.
CI-WATER_mapkit
train
py,py
6503d008b490134c4dc8962a688990f56e859154
diff --git a/static/seriously.js b/static/seriously.js index <HASH>..<HASH> 100755 --- a/static/seriously.js +++ b/static/seriously.js @@ -15,7 +15,7 @@ function genChar() { if(!code) return; $('#code').val($('#code').val() + cp437.encode(parseInt(code))); - updateByteCount(); + updateUtils(); }; function getByteCount(s) { @@ -109,7 +109,9 @@ function updateHexDump() { var hex = ''; var code = $('#code').val(); for(var i = 0; i < code.length; i++) { - hex += cp437.decode(code.charAt(i)).toString(16); + var hexi = cp437.decode(code.charAt(i)).toString(16); + if(hexi.length < 2) hexi = "0" + hexi; + hex+=hexi; } $('#hexdump').val(hex); }
update stuff when inserting a character
Mego_Seriously
train
js
21a48abb002f02a40ef7992b82b926fb1c05cd4f
diff --git a/openquake/calculators/classical.py b/openquake/calculators/classical.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/classical.py +++ b/openquake/calculators/classical.py @@ -310,7 +310,8 @@ class ClassicalCalculator(base.HazardCalculator): self.datastore['csm_info'] = self.csm_info return {} smap = parallel.Starmap( - self.core_task.__func__, h5=self.datastore.hdf5) + self.core_task.__func__, h5=self.datastore.hdf5, + num_cores=oq.num_cores) smap.task_queue = list(self.gen_task_queue()) # really fast acc0 = self.acc0() # create the rup/ datasets BEFORE swmr_on() self.datastore.swmr_on()
Fixed num_cores in classical [skip CI] Former-commit-id: b<I>f5a<I>acd3ff0a4e<I>bac<I>b<I>bce9bb
gem_oq-engine
train
py
a658b0c5d635cf272980c8fc1f1f3b53a15ff934
diff --git a/lib/transforms/inlineAngularJsTemplates.js b/lib/transforms/inlineAngularJsTemplates.js index <HASH>..<HASH> 100644 --- a/lib/transforms/inlineAngularJsTemplates.js +++ b/lib/transforms/inlineAngularJsTemplates.js @@ -26,6 +26,7 @@ module.exports = function (queryObj) { relationToInline.detach(); } else { id = relationToInline.href; + relationToInline.remove(); } if (!alreadyInlinedById[id]) { var node = document.createElement('script');
inlineAngularJsTemplate: Remove the existing JavaScriptAngularJsTemplate relations. Prevents the templates from getting cloned.
assetgraph_assetgraph
train
js
bf88a9de2e5ccd62b4d3f078195f16cd16271cd0
diff --git a/lib/active_enum/extensions.rb b/lib/active_enum/extensions.rb index <HASH>..<HASH> 100644 --- a/lib/active_enum/extensions.rb +++ b/lib/active_enum/extensions.rb @@ -125,14 +125,15 @@ module ActiveEnum # user.sex?(:male) # def define_active_enum_question_method(attribute) - define_method("#{attribute}?") do |*arg| - arg = arg.first - if arg - send(attribute) == self.class.active_enum_for(attribute)[arg] - else - super() + class_eval <<-DEF + def #{attribute}?(*args) + if args.first + #{attribute} == self.class.active_enum_for(:#{attribute})[args.first] + else + super() + end end - end + DEF end end
Remove define_method usage which is slower
adzap_active_enum
train
rb
660603b050ab658ff3ed954b76d314d317d73067
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup setup( name='upcloud-api', - version='0.4.4', + version='0.4.5', description='UpCloud API Client', author='Elias Nygren', maintainer='Mika Lackman',
version: update to <I>
UpCloudLtd_upcloud-python-api
train
py
6977125b99e4849ffe3560efead934f2f357bc0f
diff --git a/test/tc_multiarray.rb b/test/tc_multiarray.rb index <HASH>..<HASH> 100644 --- a/test/tc_multiarray.rb +++ b/test/tc_multiarray.rb @@ -85,5 +85,13 @@ class TC_MultiArray < Test::Unit::TestCase end end + def test_at_assign + for t in @@types + m = Hornetseye::MultiArray.new t, 3, 2 + m[] = 0 + assert_equal [ [ 0, 0, 0 ], [ 0, 0, 0 ] ], m.to_a + end + end + end
Added a test for multi-dimensional assignments
wedesoft_multiarray
train
rb
6357a36226c548aba44fb4e4fe7f39e8ba341cef
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,10 +1,7 @@ module.exports = function (inputArray, singleCb, finalCb) { -var len = inputArray.length; -var lenTarget = 0; - -for (i = 0; i < len; i++) { +for (let i = 0, len = inputArray.length, lenTarget = 0; i < len; i++) { (function() { - var ii = i; + let ii = i; process.nextTick( function(){ singleCb(inputArray[ii]); lenTarget++; @@ -15,4 +12,4 @@ for (i = 0; i < len; i++) { }); })(); } -} \ No newline at end of file +}
Update variable handling Moved all variables into the for loop declaration. Changed to let, instead of var.
jasoncmcg_node-in-parallel
train
js
f97ae6a26a3678d6bad99055d7b2fe378b328a37
diff --git a/src/test/java/com/adobe/epubcheck/cli/CheckerIT.java b/src/test/java/com/adobe/epubcheck/cli/CheckerIT.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/adobe/epubcheck/cli/CheckerIT.java +++ b/src/test/java/com/adobe/epubcheck/cli/CheckerIT.java @@ -21,7 +21,7 @@ public class CheckerIT { try { - Process process = run(valid30EPUB + "minimal.epub"); + Process process = run(valid30EPUB + "ocf-minimal-valid.epub"); InputStream stderr = process.getErrorStream(); process.waitFor(); assertEmpty(stderr);
test: fix CheckerIT test after renaming the minimal packaged EPUB 3
w3c_epubcheck
train
java
4a8006ec9c3a3a771cf5c3bdb403e092c268a3bf
diff --git a/lib/trestle/controller/location.rb b/lib/trestle/controller/location.rb index <HASH>..<HASH> 100644 --- a/lib/trestle/controller/location.rb +++ b/lib/trestle/controller/location.rb @@ -4,11 +4,15 @@ module Trestle extend ActiveSupport::Concern included do - after_action :set_trestle_location_header, unless: :dialog_request? + after_action :set_trestle_location_header end + # The X-Trestle-Location header is set to indicate that the remote form has triggered + # a new page URL (e.g. new -> show) without demanding a full page refresh. def set_trestle_location_header - headers["X-Trestle-Location"] = request.path + unless dialog_request? || response.location + headers["X-Trestle-Location"] = request.path + end end end end
Do not set X-Trestle-Location header when Location header is set
TrestleAdmin_trestle
train
rb
837edc2d100101bd76feb25c9d2c5058bca2326e
diff --git a/ariba/sequence_metadata.py b/ariba/sequence_metadata.py index <HASH>..<HASH> 100644 --- a/ariba/sequence_metadata.py +++ b/ariba/sequence_metadata.py @@ -27,7 +27,7 @@ class SequenceMetadata: def __eq__(self, other): - return type(other) is type(self) and self.name == other.name and self.seq_type == other.seq_type and self.var_only == other.var_only and self.variant == other.variant and self.free_text == other.free_text + return type(other) is type(self) and self.name == other.name and self.seq_type == other.seq_type and self.variant_only == other.variant_only and self.variant == other.variant and self.free_text == other.free_text def __lt__(self, other):
Typo in variable name in __eq__
sanger-pathogens_ariba
train
py
b23f429188170e26c8f486dce1c42543cc4d213c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -45,7 +45,8 @@ local_file = lambda *f: \ open(os.path.join(os.path.dirname(__file__), *f)).read() -tests_require = ['nose', 'mock'] +install_requires = ['mock', 'six'] +tests_require = ['nose'] if __name__ == '__main__': @@ -58,6 +59,7 @@ if __name__ == '__main__': include_package_data=True, url='http://github.com/gabrielfalcao/sure', packages=find_packages(exclude=['*tests*']), + install_requires=install_requires, tests_require=tests_require, test_suite='nose.collector', )
Added 'six' to install requirements in setup.py
gabrielfalcao_sure
train
py
06243275d3c26763c2fa2824d2b4a41aea88da59
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -392,7 +392,7 @@ module.exports = function ( grunt ) { ] ); grunt.registerTask( 'lint', [ 'jshint', 'jscs', 'csslint', 'banana' ] ); - grunt.registerTask( 'test', [ 'pre-test', 'git-build', 'lint', 'karma:main', 'karma:other' ] ); + grunt.registerTask( 'test', [ 'lint', 'pre-test', 'git-build', 'karma:main', 'karma:other' ] ); grunt.registerTask( 'default', 'test' ); };
build: Run lint before build in grunt-test Saves about 1-2 minutes in terms of feedback during development. Change-Id: Ia<I>f<I>de<I>c4af6e<I>bffe<I>f<I>c<I>e<I>e<I>
wikimedia_oojs-ui
train
js
aaf55ec9660dc9efa2e93f5911e67091f0bf5d54
diff --git a/lib/dash/mpd_processor.js b/lib/dash/mpd_processor.js index <HASH>..<HASH> 100644 --- a/lib/dash/mpd_processor.js +++ b/lib/dash/mpd_processor.js @@ -1064,6 +1064,7 @@ shaka.dash.MpdProcessor.prototype.makeSegmentIndexSourceViaSegmentTemplate_ = } shaka.asserts.unreachable(); + return null; };
Silence a warning about missing return Some versions of the compiler do not seem to recognize this as unreachable, so add a return to satisfy the compiler and silence the warning. Change-Id: I<I>d<I>be<I>b6c4f<I>e<I>cb4c<I>
google_shaka-player
train
js
5ad15b8cd3e373862cf21036eaa506bde0be3aec
diff --git a/structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java b/structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java index <HASH>..<HASH> 100644 --- a/structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java +++ b/structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java @@ -301,6 +301,9 @@ public class HtmlServlet extends HttpServlet implements HttpServiceServlet { if (!securityContext.isVisible(rootElement)) { rootElement = notFound(response, securityContext); + if (rootElement == null) { + return; + } }
Always return if <I> to avoid exceptions about already committed response.
structr_structr
train
java
35c2cd4eece6c63b83f0d857a2ec9d91488d6d3e
diff --git a/gems/stomp/lib/torquebox-stomp.rb b/gems/stomp/lib/torquebox-stomp.rb index <HASH>..<HASH> 100644 --- a/gems/stomp/lib/torquebox-stomp.rb +++ b/gems/stomp/lib/torquebox-stomp.rb @@ -17,6 +17,11 @@ require 'torquebox/stomp/jms_stomplet' require 'torquebox/stomp/message' -require 'torquebox/stomp/ext/stomplet_config' -require 'torquebox/stomp/ext/stomp_session' require 'torquebox/stomp/rack/stomp_javascript_client_provider' +begin + require 'torquebox/stomp/ext/stomplet_config' + require 'torquebox/stomp/ext/stomp_session' +rescue NameError + # This is expected if torquebox-stomp gets loaded when not running + # inside TorqueBox, like in Rake tasks. +end
Ensure torquebox-stomp doesn't prevent rake tasks from working (TORQUE-<I>)
torquebox_torquebox
train
rb
07997b720ca4cfe9c41abb6e1fa98c0e61d2b065
diff --git a/src/REST/keywords.py b/src/REST/keywords.py index <HASH>..<HASH> 100644 --- a/src/REST/keywords.py +++ b/src/REST/keywords.py @@ -1029,7 +1029,7 @@ class Keywords(object): """ if isinstance(what, (STRING_TYPES)): if what == "": - message = "\nThe instance JSON Schema is:" + message = "\nThe current instance JSON Schema is:" try: json = self._last_instance_or_error()['schema'] except IndexError: @@ -1110,7 +1110,7 @@ class Keywords(object): """ if isinstance(what, (STRING_TYPES)): if what == "": - message = "\nThe instance as JSON is:" + message = "\nThe current instance is:" try: json = deepcopy(self._last_instance_or_error()) json.pop('schema')
Slightly improve `Output` and `Output Schema` headings
asyrjasalo_RESTinstance
train
py
8fe62522878fa27f17222ba54e7626e7a88fda41
diff --git a/actor-system.js b/actor-system.js index <HASH>..<HASH> 100644 --- a/actor-system.js +++ b/actor-system.js @@ -457,6 +457,9 @@ class ActorSystem { // Use 'getName' getter, if present. if (_.isFunction(Behaviour.getName)) return Behaviour.getName(); + // Take 'actorName' field, if present. + if (Behaviour.actorName) return _.result(Behaviour, 'actorName'); + // Take 'name' field, if present. if (Behaviour.name) return _.result(Behaviour, 'name');
(saymon) object-concurrency-fix: Switched TypeScript actors from getName() method to actorName property.
untu_comedy
train
js
cbede47ec83c486186c2f48069b589d050023a36
diff --git a/sqlbrite/src/main/java/com/squareup/sqlbrite/BackpressureBufferLastOperator.java b/sqlbrite/src/main/java/com/squareup/sqlbrite/BackpressureBufferLastOperator.java index <HASH>..<HASH> 100644 --- a/sqlbrite/src/main/java/com/squareup/sqlbrite/BackpressureBufferLastOperator.java +++ b/sqlbrite/src/main/java/com/squareup/sqlbrite/BackpressureBufferLastOperator.java @@ -43,8 +43,8 @@ final class BackpressureBufferLastOperator<T> implements Operator<T, T> { private final Subscriber<? super T> child; - private volatile Object last = NONE; // Guarded by 'this'. - private volatile long requested; // Guarded by 'this'. Starts at zero. + private Object last = NONE; // Guarded by 'this'. + private long requested; // Guarded by 'this'. Starts at zero. final Producer producer = new Producer() { @Override public void request(long n) {
Remove unnecessary volatile keyword being used in BackpressureBufferLastOperator class.
square_sqlbrite
train
java
4a2eec0c644aca83a414ce02753b029165b44f28
diff --git a/tests/integration/test_package.py b/tests/integration/test_package.py index <HASH>..<HASH> 100644 --- a/tests/integration/test_package.py +++ b/tests/integration/test_package.py @@ -52,7 +52,7 @@ def _get_random_package_name(): reason='Extended packaging tests only run on py3.') @pytest.mark.parametrize( 'package,contents', [ - ('pandas==1.0.3', [ + ('pandas==1.1.5', [ 'pandas/_libs/__init__.py', 'pandas/io/sas/_sas.cpython-*-x86_64-linux-gnu.so']), ('SQLAlchemy==1.3.20', [ @@ -142,12 +142,12 @@ class TestPackage(object): ) @pytest.mark.skipif(sys.version_info[0] == 2, - reason='pandas==1.0.3 is only suported on py3.') + reason='pandas==1.1.5 is only suported on py3.') def test_can_package_pandas(self, runner, app_skeleton, no_local_config): assert_can_package_dependency( runner, app_skeleton, - 'pandas==1.0.3', + 'pandas==1.1.5', contents=[ 'pandas/_libs/__init__.py', ],
Pin pandas installed by tests to <I> <I> is the latest version that supports both Python <I> and <I>.
aws_chalice
train
py