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
999459c5e0254a1c7435e33e15892ed799bbf235
diff --git a/Generator/ProjectGenerator.php b/Generator/ProjectGenerator.php index <HASH>..<HASH> 100644 --- a/Generator/ProjectGenerator.php +++ b/Generator/ProjectGenerator.php @@ -122,9 +122,10 @@ class ProjectGenerator extends Generator // Renaming the siteaccess group names - $project = strtolower( $input->getOption( 'project' ) ); - $frontendGroupName = $project . '_frontend_group'; - $administrationGroupName = $project . '_administration_group'; + $project = $input->getOption( 'project' ); + $projectNormalized = Container::underscore( $project ); + $frontendGroupName = $projectNormalized . '_frontend_group'; + $administrationGroupName = $projectNormalized . '_administration_group'; $output->writeln( array(
Fix renaming siteaccess groups in demo bundle
netgen_site-generator-bundle
train
php
5ce690bd1eb6ef6a9c06c31100853c087ac7224f
diff --git a/Python/lipd/pkg_resources/excel/excel_main.py b/Python/lipd/pkg_resources/excel/excel_main.py index <HASH>..<HASH> 100644 --- a/Python/lipd/pkg_resources/excel/excel_main.py +++ b/Python/lipd/pkg_resources/excel/excel_main.py @@ -702,9 +702,9 @@ def _get_header_keys(row): row[idx] = EXCEL_KEYS[key.value.lower()] else: try: - row[idx] = key.value.lower() - except AttributeError: - pass + row[idx] = key.value + except AttributeError as e: + logger_excel.warn("excel_main: get_header_keys: unknown header key, unable to add: {}".format(e)) header_keys = _rm_cells_reverse(row) return header_keys
Sheet Metadata Stop lowercasing all the header key values. We want to preserve camelCasing in case the user adds in new keys in the template. The keys should be written to the LiPD file in the same way that they were written by the user.
nickmckay_LiPD-utilities
train
py
ca3ef8ecad9bc5e0def8fad94070068aa9e27fe4
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -1125,3 +1125,43 @@ test('stack push index and word', (t) => { }); + +test('stack push/pull', (t) => { + const cpu = CPU(); + let lines = [ + '.equ 10000 stack', + 'LDY #>stack', + 'LDX #<stack', + 'TXYS', + + 'PHWD foo', + + 'PLX', + 'CPX #%11111', + 'BNE fail', + + 'PLY', + 'CPY #%iiiii', + 'BNE fail', + + 'HALTZ', + + + 'fail:', + 'HALTN', + + 'foo:', + '.word %11111iiiii', + ]; + + const machine_code = assembler(lines); + + console.log(machine_code); + + cpu.memory.writeArray(0, machine_code); + cpu.run(); + + t.equal(cpu.flags.H, 0); + + t.end(); +});
Add test for stack/push pull: push word from memory, pull into registers
thirdcoder_cpu3502
train
js
d62715ca98d3e79d8fe16961849d35ca5f6a9429
diff --git a/src/extensions/default/HTMLCodeHints/unittests.js b/src/extensions/default/HTMLCodeHints/unittests.js index <HASH>..<HASH> 100644 --- a/src/extensions/default/HTMLCodeHints/unittests.js +++ b/src/extensions/default/HTMLCodeHints/unittests.js @@ -199,6 +199,12 @@ define(function (require, exports, module) { testEditor.setCursorPos({ line: 6, ch: 10 }); // cursor between space and = expectNoHints(HTMLCodeHints.attrHintProvider); }); + it("should NOT list hints to right of '=' sign with whitespace on id attr", function () { + testEditor.setCursorPos({ line: 6, ch: 11 }); // cursor between = and space + expectNoHints(HTMLCodeHints.attrHintProvider); + testEditor.setCursorPos({ line: 6, ch: 12 }); // cursor between space and ' + expectNoHints(HTMLCodeHints.attrHintProvider); + }); it("should list hints to right of '=' sign with whitespace", function () { testDocument.setText('<style type = "text/css">'); testEditor.setCursorPos({ line: 0, ch: 13 }); // cursor between = and space
add more unit tests for the id attribute case
adobe_brackets
train
js
430891e310aedbf23a63458eda44db3a4115728c
diff --git a/lib/Doctrine/ODM/PHPCR/Mapping/Driver/YamlDriver.php b/lib/Doctrine/ODM/PHPCR/Mapping/Driver/YamlDriver.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ODM/PHPCR/Mapping/Driver/YamlDriver.php +++ b/lib/Doctrine/ODM/PHPCR/Mapping/Driver/YamlDriver.php @@ -68,6 +68,10 @@ class YamlDriver extends FileDriver $class->setCustomRepositoryClassName($element['repositoryClass']); } + if (isset($element['translator'])) { + $class->setTranslator($element['translator']); + } + if (isset($element['versionable']) && $element['versionable']) { $class->setVersioned($element['versionable']); } @@ -162,7 +166,9 @@ class YamlDriver extends FileDriver } } - // TODO: locale + if (isset($element['locale'])) { + $class->mapLocale(array('fieldName' => $element['locale'])); + } if (isset($element['referrers'])) { foreach ($element['referrers'] as $name=>$attributes) {
Implement translator and locale mapping in YAML mapping driver
doctrine_phpcr-odm
train
php
0342af1da4b9c503f1560495c11d76784c26efbb
diff --git a/stanza/models/classifiers/cnn_classifier.py b/stanza/models/classifiers/cnn_classifier.py index <HASH>..<HASH> 100644 --- a/stanza/models/classifiers/cnn_classifier.py +++ b/stanza/models/classifiers/cnn_classifier.py @@ -112,6 +112,7 @@ class CNNClassifier(nn.Module): self.extra_vocab = list(extra_vocab) self.extra_vocab_map = { word: i for i, word in enumerate(self.extra_vocab) } # TODO: possibly add regularization specifically on the extra embedding? + # TODO FIXME: word of idx 0 is being shared with the padding! self.extra_embedding = nn.Embedding(num_embeddings = len(extra_vocab), embedding_dim = self.config.extra_wordvec_dim, max_norm = self.config.extra_wordvec_max_norm,
This is a bug in the classifier I think
stanfordnlp_stanza
train
py
859a3589232346b5ec3abb80a5c9f9d5b0288707
diff --git a/Tests/Unit/Message/MessageFactoryTest.php b/Tests/Unit/Message/MessageFactoryTest.php index <HASH>..<HASH> 100644 --- a/Tests/Unit/Message/MessageFactoryTest.php +++ b/Tests/Unit/Message/MessageFactoryTest.php @@ -106,7 +106,9 @@ EOF; $reder = new \Doctrine\Common\Annotations\AnnotationReader(); $annotationDriver = new \Lexik\Bundle\MailerBundle\Mapping\Driver\Annotation($reder); + + $signerFactory = new \Lexik\Bundle\MailerBundle\Signer\SignerFactory(array()); - return new MessageFactory($this->em, $renderer, $annotationDriver, $options); + return new MessageFactory($this->em, $renderer, $annotationDriver, $options, $signerFactory); } }
fix unit test of MessageFactory
lexik_LexikMailerBundle
train
php
bad7d6b340fa2af6b151b7b689a6f43d07681de7
diff --git a/critical.js b/critical.js index <HASH>..<HASH> 100644 --- a/critical.js +++ b/critical.js @@ -10,7 +10,7 @@ var fs = require( "fs" ); var os = require( "os" ); - var DEFAULT_BUFFER_SIZE = 200*1024; + var DEFAULT_BUFFER_SIZE = 800*1024; //had this as the set val before, don't want to break things exports.getRules = function( url, opts, cb ){ var defaultCb = function( err, output ){
Make default size what it hard-coded to before to avoid breaks
filamentgroup_criticalCSS
train
js
796e52a40e9427028568e683a1530c90c58d1f8a
diff --git a/bigfloat_cython/bigfloat/test/test_mpfr.py b/bigfloat_cython/bigfloat/test/test_mpfr.py index <HASH>..<HASH> 100644 --- a/bigfloat_cython/bigfloat/test/test_mpfr.py +++ b/bigfloat_cython/bigfloat/test/test_mpfr.py @@ -1876,10 +1876,12 @@ class TestMpfr(unittest.TestCase): assert t == 0 with temporary_emin(0): mpfr_clear_flags() - actual_ternary_out = cmp( - mpfr_subnormalize(x, ternary_in, rnd), - 0 - ) + actual_ternary_out = mpfr_subnormalize(x, ternary_in, rnd) + # Normalize return value from mpfr_subnormalize to -1, 0 or 1. + if actual_ternary_out < 0: + actual_ternary_out = -1 + elif actual_ternary_out > 0: + actual_ternary_out = 1 actual_flags = get_current_flags() actual_val_out = mpfr_get_d(x, MPFR_RNDN) self.assertEqual(actual_val_out, val_out)
Recode a test to avoid use of cmp builtin function.
mdickinson_bigfloat
train
py
469681da41126f63008dddde9295fd267a503d90
diff --git a/generator/lib/behavior/i18n/I18nBehavior.php b/generator/lib/behavior/i18n/I18nBehavior.php index <HASH>..<HASH> 100644 --- a/generator/lib/behavior/i18n/I18nBehavior.php +++ b/generator/lib/behavior/i18n/I18nBehavior.php @@ -105,6 +105,7 @@ class I18nBehavior extends Behavior $fk->addReference($column->getName(), $column->getName()); } $i18nTable->addForeignKey($fk); + $i18nTable->doNaming(); $table->addReferrer($fk); } diff --git a/generator/lib/behavior/versionable/VersionableBehavior.php b/generator/lib/behavior/versionable/VersionableBehavior.php index <HASH>..<HASH> 100755 --- a/generator/lib/behavior/versionable/VersionableBehavior.php +++ b/generator/lib/behavior/versionable/VersionableBehavior.php @@ -119,6 +119,7 @@ class VersionableBehavior extends Behavior $fk->addReference($column, $tablePKs[$key]); } $versionTable->addForeignKey($fk); + $versionTable->doNaming(); $table->addReferrer($fk); // add the version column to the primary key $versionTable->getColumn($this->getParameter('version_column'))->setPrimaryKey(true);
[<I>] Fixed unnamed FKs in versionable and i<I>n behaviors (refs #<I>, #<I>)
propelorm_Propel
train
php,php
7c92a351d6b0281f40fedc177480234254f79052
diff --git a/helper/testhelpers/testhelpers.go b/helper/testhelpers/testhelpers.go index <HASH>..<HASH> 100644 --- a/helper/testhelpers/testhelpers.go +++ b/helper/testhelpers/testhelpers.go @@ -230,7 +230,7 @@ func deriveStableActiveCore(t testing.T, cluster *vault.TestCluster) *vault.Test } func DeriveActiveCore(t testing.T, cluster *vault.TestCluster) *vault.TestClusterCore { - for i := 0; i < 10; i++ { + for i := 0; i < 20; i++ { for _, core := range cluster.Cores { leaderResp, err := core.Client.Sys().Leader() if err != nil {
Use a longer timeout for DeriveActiveCore in the hopes that giving more time will allow for raft leader election failure to recover. (#<I>)
hashicorp_vault
train
go
cd5aacc73a7996576ec786beec9d3510d657c3a0
diff --git a/spec/rango/core_ext_spec.rb b/spec/rango/core_ext_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rango/core_ext_spec.rb +++ b/spec/rango/core_ext_spec.rb @@ -0,0 +1,34 @@ +# encoding: utf-8 + +require_relative "../spec_helper" + +require "rango/core_ext" + +describe ParamsMixin do + describe ".convert" do + end + + describe "getter & setter" do + before(:each) do + @mash = {key: "value"}.extend(ParamsMixin) + end + + it "should work with strings" do + @mash["key"].should eql("value") + end + + it "should work with symbols" do + @mash[:key].should eql("value") + end + + it "should set the value with key if key is a string" do + @mash["key"] = "changed" + @mash[:key].should eql("changed") + end + + it "should set the value with key if key is a symbol" do + @mash[:key] = "changed" + @mash["key"].should eql("changed") + end + end +end
Added specs for ParamsMixin
botanicus_rango
train
rb
97f10bf4c7c3e062b6b31a8a175574d301a605ac
diff --git a/generators/app/templates/gulp/watch-assets.js b/generators/app/templates/gulp/watch-assets.js index <HASH>..<HASH> 100644 --- a/generators/app/templates/gulp/watch-assets.js +++ b/generators/app/templates/gulp/watch-assets.js @@ -87,7 +87,7 @@ module.exports = (gulp, plugins) => { ], () => { processChange('data', () => { if (config.get('nitro.mode.livereload')) { - browserSync.reload(); + browserSync.reload('*.html'); } }); });
#<I> small improvement for livereload
namics_generator-nitro
train
js
340c77f7fdafbd27960c23c2d1f220bb6b95f54f
diff --git a/src/org/openscience/cdk/math/MinMax.java b/src/org/openscience/cdk/math/MinMax.java index <HASH>..<HASH> 100644 --- a/src/org/openscience/cdk/math/MinMax.java +++ b/src/org/openscience/cdk/math/MinMax.java @@ -3,7 +3,7 @@ * $Date$ * $Revision$ * - * Copyright (C) 2000-2007 The Chemistry Development Kit (CDK) project + * Copyright (C) 2000-2007 Yongquan Han * * Contact: [email protected] * @@ -33,7 +33,7 @@ package org.openscience.cdk.math; public class MinMax { /** - * Analog of Math.max that returns the largest int value in an array of ints + * Analog of Math.max that returns the largest int value in an array of ints. * * @param values the values to be searched for the largest value among them * @return the largest value among a set of given values @@ -48,7 +48,7 @@ public class MinMax { } /** - * Analog of Math.min that returns the largest int value in an array of ints + * Analog of Math.min that returns the largest int value in an array of ints. * * @param values the values to be searched for the smallest value among them * @return the smallest value among a set of given values
Fixed JavaDoc: copyright owner, and missing periods. git-svn-id: <URL>
cdk_cdk
train
java
0462329166cc667c2dc81abc85493e2ae6db5e4c
diff --git a/activesupport/lib/active_support/file_evented_update_checker.rb b/activesupport/lib/active_support/file_evented_update_checker.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/file_evented_update_checker.rb +++ b/activesupport/lib/active_support/file_evented_update_checker.rb @@ -4,8 +4,6 @@ require 'pathname' module ActiveSupport class FileEventedUpdateChecker - attr_reader :listener - def initialize(files, dirs={}, &block) @files = files.map {|f| expand_path(f)}.to_set @@ -18,8 +16,7 @@ module ActiveSupport @modified = false if (watch_dirs = base_directories).any? - @listener = Listen.to(*watch_dirs, &method(:changed)) - @listener.start + Listen.to(*watch_dirs, &method(:changed)).start end end
no need to have access to the listener
rails_rails
train
rb
118b183be33227c74f63ee6b08a15b9367d29b3e
diff --git a/lib/active_file/blob.rb b/lib/active_file/blob.rb index <HASH>..<HASH> 100644 --- a/lib/active_file/blob.rb +++ b/lib/active_file/blob.rb @@ -2,7 +2,7 @@ require "active_file/site" # Schema: id, key, filename, content_type, metadata, byte_size, checksum, created_at class ActiveFile::Blob < ActiveRecord::Base - self.table_name = "active_file_blobs" + self.table_name = "rails_blobs" has_secure_token :key store :metadata, coder: JSON diff --git a/lib/active_file/migration.rb b/lib/active_file/migration.rb index <HASH>..<HASH> 100644 --- a/lib/active_file/migration.rb +++ b/lib/active_file/migration.rb @@ -1,9 +1,10 @@ class ActiveFile::CreateBlobs < ActiveRecord::Migration[5.1] def change - create_table :active_file_blobs do |t| + create_table :rails_blobs do |t| t.string :key t.string :filename t.string :content_type + t.text :metadata t.integer :byte_size t.string :checksum t.time :created_at
Use rails_blobs for table to mimic routes prefix etc
rails_rails
train
rb,rb
c17d8f55490bba02a6bab24cc0716387aad59a3e
diff --git a/src/Storage.php b/src/Storage.php index <HASH>..<HASH> 100644 --- a/src/Storage.php +++ b/src/Storage.php @@ -946,8 +946,8 @@ class Storage // only add taxonomies if they exist if (!empty($taxonomies) && !empty($tagsWhere)) { $tagsQueryA = sprintf("%s.contenttype = '%s'", $taxonomytable, $contenttype); - $tags_query_2 = implode(' OR ', $tagsWhere); - $tagsQuery = sprintf(' OR (%s AND (%s))', $tagsQueryA, $tags_query_2); + $tagsQueryB = implode(' OR ', $tagsWhere); + $tagsQuery = sprintf(' OR (%s AND (%s))', $tagsQueryA, $tagsQueryB); } // Build filter 'WHERE"
Variable naming: $tags_query_2 => $tagsQueryB
bolt_bolt
train
php
007a3cdc3b1550993bc24fd08e46a9f7187ebf1e
diff --git a/cirq-google/setup.py b/cirq-google/setup.py index <HASH>..<HASH> 100644 --- a/cirq-google/setup.py +++ b/cirq-google/setup.py @@ -15,7 +15,7 @@ import os from setuptools import find_packages, setup -# This reads the __version__ variable from cirq/_version.py +# This reads the __version__ variable from cirq_google/_version.py __version__ = '' exec(open('cirq_google/_version.py').read())
Fix path in `__version__` docstring for `setup.py` in `cirq-google` (#<I>)
quantumlib_Cirq
train
py
f477e85ac426de532c724e911409f41a63f1e1c5
diff --git a/js/material.js b/js/material.js index <HASH>..<HASH> 100644 --- a/js/material.js +++ b/js/material.js @@ -304,7 +304,7 @@ var FloatingLabel = function ($) { /*! * navigation drawer - * based on bootstrap's (v4.0.0-alpha.5) modal.js + * based on bootstrap's (v4.0.0-alpha.6) modal.js */ var NavDrawer = function ($) { // constants >>> @@ -659,7 +659,7 @@ var NavDrawer = function ($) { /*! * tab indicator animation - * requires bootstrap's (v4.0.0-alpha.5) tab.js + * requires bootstrap's (v4.0.0-alpha.6) tab.js */ var TabSwitch = function ($) { // constants >>> @@ -800,7 +800,7 @@ var TabSwitch = function ($) { /*! * global util js - * based on bootstrap's (v4.0.0-alpha.5) util.js + * based on bootstrap's (v4.0.0-alpha.6) util.js */ var Util = function ($) { var transition = false;
recompile css and js
Daemonite_material
train
js
f507227fd4efff3c8b32b2a8c8f2860af2546e3b
diff --git a/lib/model.rb b/lib/model.rb index <HASH>..<HASH> 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -176,11 +176,15 @@ module OpenTox return @prediction_dataset if database_activity(subjectid) - - if metadata[RDF.type] == [OTA.ClassificationLazySingleTarget] + load_metadata(subjectid) + case OpenTox::Feature.find(metadata[OT.dependentVariables]).feature_type + when "classification" # AM: Balancing, see http://www.maunz.de/wordpress/opentox/2011/balanced-lazar l = Array.new # larger s = Array.new # smaller fraction + + raise "no fingerprints in model" if @fingerprints.size==0 + @fingerprints.each do |training_compound,training_features| @activities[training_compound].each do |act| case act.to_s @@ -231,6 +235,7 @@ module OpenTox ### END AM balanced predictions else # regression case: no balancing + LOGGER.info "LAZAR: Unbalanced." neighbors prediction = eval("#{@prediction_algorithm}(@neighbors,{:similarity_algorithm => @similarity_algorithm, :p_values => @p_values})") end
Hotfix: Switch to balanced mode.
opentox_lazar
train
rb
d072ebfd5193bb32f948ea4e1b9503679c73062e
diff --git a/lib/bel/quoting.rb b/lib/bel/quoting.rb index <HASH>..<HASH> 100644 --- a/lib/bel/quoting.rb +++ b/lib/bel/quoting.rb @@ -5,10 +5,13 @@ module BEL KeywordMatcher = Regexp.compile(/^(SET|DEFINE|a|g|p|r|m)$/) def ensure_quotes identifier - if quotes_required? identifier - %Q{"#{identifier}"} + identifier_string = identifier.to_s + + if quotes_required? identifier_string + identifier_string.gsub!('"', '\"') + %Q{"#{identifier_string}"} else - identifier.to_s + identifier_string end end
escape double quotes with an identifier This passes the previously failing spec/unit/bel_syntax_spec.rb test. refs #<I>
OpenBEL_bel.rb
train
rb
33c938d43a04e34416162407e9cad259a3a171b7
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -125,7 +125,6 @@ def find_library(library_root): # Get the version number execfile('astromodels/version.py') - def setup_xspec(): headas_root = os.environ.get("HEADAS")
Cleaned up the setup and made it more system-independent (see #<I>)
threeML_astromodels
train
py
cb4387df3f9328e4ff38b8299fe5fbb169576235
diff --git a/plugins/inputs/procstat/procstat.go b/plugins/inputs/procstat/procstat.go index <HASH>..<HASH> 100644 --- a/plugins/inputs/procstat/procstat.go +++ b/plugins/inputs/procstat/procstat.go @@ -295,6 +295,10 @@ func (p *Procstat) updateProcesses(pids []PID, tags map[string]string, prevInfo for _, pid := range pids { info, ok := prevInfo[pid] if ok { + // Assumption: if a process has no name, it probably does not exist + if name, _ := info.Name(); name == "" { + continue + } procs[pid] = info } else { proc, err := p.createProcess(pid) @@ -302,6 +306,10 @@ func (p *Procstat) updateProcesses(pids []PID, tags map[string]string, prevInfo // No problem; process may have ended after we found it continue } + // Assumption: if a process has no name, it probably does not exist + if name, _ := proc.Name(); name == "" { + continue + } procs[pid] = proc // Add initial tags
Verify a process passed by pid_file exists (#<I>)
influxdata_telegraf
train
go
378c4581855f2593e902a2a8569aa98250f8e865
diff --git a/pyqode/python/managers/file.py b/pyqode/python/managers/file.py index <HASH>..<HASH> 100644 --- a/pyqode/python/managers/file.py +++ b/pyqode/python/managers/file.py @@ -47,8 +47,7 @@ class PyFileManager(FileManager): return 'UTF-8' def open(self, path, encoding=None, use_cached_encoding=True): - if encoding is None: - encoding = self.detect_encoding(path) + encoding = self.detect_encoding(path) super(PyFileManager, self).open( path, encoding=encoding, use_cached_encoding=use_cached_encoding) try:
Force preferred encoding following python convention: if there is an encoding shebang line, the specified encoding is used otherwise UTF-8 is assumed.
pyQode_pyqode.python
train
py
0dd89bf1441f94a36164d5b9e993ee0587a81728
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -38,7 +38,13 @@ exports.run = function jsdoctest$run(filename) { exports.getJsdoctests = function jsdoctest$getJsdoctests(content) { var parsedContent = dox.parseComments(content); var functionComments = _.filter(parsedContent, function(c) { - return c.ctx && (c.ctx.type === 'method' || c.ctx.type === 'function'); + return c.ctx && ( + c.ctx.type === 'method' + || c.ctx.type === 'function' + || c.ctx.type === 'class' + || c.ctx.type === 'constructor' + || c.ctx.type === 'property' + ); }); var comments = _.map(functionComments, function(comment) {
Allow tests in class/constructor/property docs
yamadapc_jsdoctest
train
js
a131e11c5e15b4720deff025464e20d5d21a4b83
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index <HASH>..<HASH> 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -158,7 +158,7 @@ class Command(_BaseCommand): isn't one. cog: Optional[:class:`Cog`] The cog that this command belongs to. ``None`` if there isn't one. - checks: List[Callable[..., :class:`bool`]] + checks: List[Callable[[:class:`.Context`], :class:`bool`]] A list of predicates that verifies if the command could be executed with the given :class:`.Context` as the sole parameter. If an exception is necessary to be thrown to signal failure, then one inherited from
[commands] fix documented type for Command.checks
Rapptz_discord.py
train
py
364ade6e4ca738d4fa11191fb4d6c1de528e57cd
diff --git a/bin/browsertimeWebPageReplay.js b/bin/browsertimeWebPageReplay.js index <HASH>..<HASH> 100755 --- a/bin/browsertimeWebPageReplay.js +++ b/bin/browsertimeWebPageReplay.js @@ -38,6 +38,9 @@ async function runBrowsertime() { resultDir: '/tmp/browsertime', screenshotParams: { type: 'jpg' + }, + chrome: { + ignoreCertificateErrors: true } };
ignore certificate errors by default (#<I>)
sitespeedio_browsertime
train
js
9a719dc33aa0bb823fc6e696880945303305e740
diff --git a/src/toil/batchSystems/options.py b/src/toil/batchSystems/options.py index <HASH>..<HASH> 100644 --- a/src/toil/batchSystems/options.py +++ b/src/toil/batchSystems/options.py @@ -15,6 +15,12 @@ from __future__ import absolute_import from .registry import batchSystemFactoryFor, defaultBatchSystem, uniqueNames +import socket + + +def getLocalIP(): + # may return localhost on some systems (not osx and coreos) https://stackoverflow.com/a/166520 + return socket.gethostbyname(socket.gethostname()) def _parasolOptions(addOptionFn): addOptionFn("--parasolCommand", dest="parasolCommand", default=None, @@ -90,7 +96,7 @@ def setDefaultOptions(config): config.linkImports = False # mesos - config.mesosMasterAddress = 'localhost:5050' + config.mesosMasterAddress = '%s:5050' % getLocalIP() # parasol config.parasolCommand = 'parasol'
Automatically get local IP for mesosMaster (resolves #<I>)
DataBiosphere_toil
train
py
346e215db969bd9410b2ad6f5927f68f4ce44090
diff --git a/lib/spring/commands/testunit.rb b/lib/spring/commands/testunit.rb index <HASH>..<HASH> 100644 --- a/lib/spring/commands/testunit.rb +++ b/lib/spring/commands/testunit.rb @@ -8,7 +8,10 @@ module Spring def call $LOAD_PATH.unshift "test" ARGV << "test" if ARGV.empty? - ARGV.each { |arg| require_test(File.expand_path(arg)) } + ARGV.each do |arg| + break if arg.start_with?("-") + require_test(File.expand_path(arg)) + end end def require_test(path)
Don't try to require testunit args Fixes #<I>
rails_spring
train
rb
4d2f0d2287a4fde4e6425814e85d812dd7c4b203
diff --git a/activesupport/lib/active_support/core_ext/module/synchronization.rb b/activesupport/lib/active_support/core_ext/module/synchronization.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/core_ext/module/synchronization.rb +++ b/activesupport/lib/active_support/core_ext/module/synchronization.rb @@ -1,4 +1,5 @@ require 'active_support/core_ext/module/aliasing' +require 'active_support/core_ext/array/extract_options' class Module # Synchronize access around a method, delegating synchronization to a
synchronization.rb needs active_support/core_ext/array/extract_options
rails_rails
train
rb
5dca61a801cb81a969438346a2af3a021555bdea
diff --git a/src/Digbang/Security/SecurityServiceProvider.php b/src/Digbang/Security/SecurityServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Digbang/Security/SecurityServiceProvider.php +++ b/src/Digbang/Security/SecurityServiceProvider.php @@ -13,6 +13,8 @@ class SecurityServiceProvider extends ServiceProvider { public function boot() { $this->package('digbang/security'); + + $this->overrideSentry(); } protected function overrideSentry() @@ -21,6 +23,8 @@ class SecurityServiceProvider extends ServiceProvider { { $this->app['config']["cartalyst/sentry::$key"] = $val; } + + $this->app['Cartalyst\Sentry\Sentry'] = $this->app['sentry']; } /** @@ -30,8 +34,6 @@ class SecurityServiceProvider extends ServiceProvider { */ public function register() { - $this->overrideSentry(); - $this->app->register('Cartalyst\Sentry\SentryServiceProvider'); $this->registerCommands();
Don't need to override before sentry, as sentry resolutions are callbacks. Problem was when injecting Sentry.
digbang_security
train
php
1e67636360d7062b4e677cea9602a56198aceba3
diff --git a/src/SAML2/XML/saml/SubjectConfirmationData.php b/src/SAML2/XML/saml/SubjectConfirmationData.php index <HASH>..<HASH> 100644 --- a/src/SAML2/XML/saml/SubjectConfirmationData.php +++ b/src/SAML2/XML/saml/SubjectConfirmationData.php @@ -177,7 +177,7 @@ class SubjectConfirmationData public function setAddress(string $address = null) { if (!is_null($address) && !filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6)) { - throw new \InvalidArgumentException('Provided argument is not a valid IP address.'); + Utils::getContainer()->getLogger()->warning(sprintf('Provided argument (%s) is not a valid IP address.', $address)); } $this->Address = $address; }
Be less strict on the content of the Address attribute
simplesamlphp_saml2
train
php
1550bfffaac76b3a8ee9737d368ba5350bb2a4e6
diff --git a/lib/plugins/rollback/index.js b/lib/plugins/rollback/index.js index <HASH>..<HASH> 100644 --- a/lib/plugins/rollback/index.js +++ b/lib/plugins/rollback/index.js @@ -34,6 +34,11 @@ class Rollback { shortcut: 'f', required: true, }, + version: { + usage: 'Version of the function', + shortcut: 'v', + required: true, + }, stage: { usage: 'Stage of the function', shortcut: 's',
Add version option to core rollback plugin
serverless_serverless
train
js
c9ee435c633fc298c40eee99dfd5eeab7221ece0
diff --git a/src/Operation/CreateIndexes.php b/src/Operation/CreateIndexes.php index <HASH>..<HASH> 100644 --- a/src/Operation/CreateIndexes.php +++ b/src/Operation/CreateIndexes.php @@ -97,9 +97,7 @@ class CreateIndexes implements Executable 'indexes' => $this->indexes, ]); - $cursor = $server->executeCommand($this->databaseName, $command); - - return current($cursor->toArray()); + $server->executeCommand($this->databaseName, $command); } /**
CreateIndexes::executeCommand() need not return anything
mongodb_mongo-php-library
train
php
5b6ad39bef5c4cceb9f0f32ed2eb76ebc09c1876
diff --git a/tests/integrations/flask/test_flask.py b/tests/integrations/flask/test_flask.py index <HASH>..<HASH> 100644 --- a/tests/integrations/flask/test_flask.py +++ b/tests/integrations/flask/test_flask.py @@ -26,6 +26,7 @@ def app(): app.logger.setLevel(logging.DEBUG) handler = SentryHandler() handler.setLevel(logging.DEBUG) + app.logger.handlers = [] app.logger.addHandler(handler) login_manager.init_app(app)
chore: fix flask tests again
getsentry_sentry-python
train
py
f9268f80691c973c38c0fca6469a0ff8f434174d
diff --git a/law/contrib/glite/__init__.py b/law/contrib/glite/__init__.py index <HASH>..<HASH> 100644 --- a/law/contrib/glite/__init__.py +++ b/law/contrib/glite/__init__.py @@ -512,7 +512,7 @@ class GLiteWorkflowProxy(WorkflowProxy): outputs["submission"].parent.touch() # get all branch indexes and chunk them by tasks_per_job - branch_chunks = list(iter_chunks(task.branch_map, task.tasks_per_job)) + branch_chunks = list(iter_chunks(task.branch_map.keys(), task.tasks_per_job)) # submission output if not outputs["submission"].exists():
Fix creation of dummy control outputs in glite workflow.
riga_law
train
py
5a8f3f57857d331ac4cde2193d973c8f61856d08
diff --git a/satpy/tests/reader_tests/test_abi_l2_nc.py b/satpy/tests/reader_tests/test_abi_l2_nc.py index <HASH>..<HASH> 100644 --- a/satpy/tests/reader_tests/test_abi_l2_nc.py +++ b/satpy/tests/reader_tests/test_abi_l2_nc.py @@ -87,8 +87,7 @@ class Test_NC_ABI_L2_base(unittest.TestCase): 'add_offset': 0., '_FillValue': np.array(-1).astype(np.int16), '_Unsigned': 'True', - 'units': 'm'}, - ) + 'units': 'm'},) xr_.open_dataset.return_value = FakeDataset({ 'goes_imager_projection': proj,
fix another stickler E<I> complain
pytroll_satpy
train
py
ad5708f6d703c1f330baff55986080ca0984753d
diff --git a/lib/bashcov.rb b/lib/bashcov.rb index <HASH>..<HASH> 100644 --- a/lib/bashcov.rb +++ b/lib/bashcov.rb @@ -18,15 +18,6 @@ module Bashcov ) class << self - # Define option accessors - Options.new.members.each do |option| - [option, "#{option}="].each do |method| - define_method method do |*args| - options.public_send(*[method, *args]) - end - end - end - # @return [Struct] The +Struct+ object representing Bashcov configuration def options set_default_options! unless defined?(@options) @@ -88,6 +79,17 @@ module Bashcov @options.root_directory = Dir.getwd end + # Define option accessors + Options.new.members.each do |option| + [option, "#{option}="].each do |method| + next if instance_methods(false).include?(method) + + define_method method do |*args| + options.public_send(*[method, *args]) + end + end + end + private def help
Don't redefine existing methods lib/bashcov.rb:<I>: warning: method redefined; discarding old command_name lib/bashcov.rb:<I>: warning: previous definition of command_name was here
infertux_bashcov
train
rb
14c5375cccb74db24e8b32913769e2eb3cbbc933
diff --git a/tscreen_unix.go b/tscreen_unix.go index <HASH>..<HASH> 100644 --- a/tscreen_unix.go +++ b/tscreen_unix.go @@ -49,6 +49,7 @@ func (t *tScreen) engage() error { ti := t.ti t.TPuts(ti.EnterCA) + t.TPuts(ti.EnterKeypad) t.TPuts(ti.HideCursor) t.TPuts(ti.EnableAcs) t.TPuts(ti.Clear)
send enter_keypad during terminal engage
gdamore_tcell
train
go
b38d97a241369015e250920aa44a172c492fec6a
diff --git a/lib/net/NetworkManager.js b/lib/net/NetworkManager.js index <HASH>..<HASH> 100644 --- a/lib/net/NetworkManager.js +++ b/lib/net/NetworkManager.js @@ -157,7 +157,8 @@ class NetworkManager { let startHeight = parseInt(Object.keys(this._requests.headers)[0]) while (this._requests.blocks[startHeight] && - this._requests.blocks[startHeight].length > 0) { + this._requests.blocks[startHeight].length > 0 && + this._requests.blocks[startHeight] !== 'OPEN') { blocks = blocks.concat(this._requests.blocks[startHeight]) delete this._requests.headers[startHeight] delete this._requests.blocks[startHeight]
Do not add blocks when current start height is marked as OPEN
ethereumjs_ethereumjs-vm
train
js
b4967e683663c66e5a18fbba680278254174167a
diff --git a/pippo-core/src/main/java/ro/pippo/core/Request.java b/pippo-core/src/main/java/ro/pippo/core/Request.java index <HASH>..<HASH> 100644 --- a/pippo-core/src/main/java/ro/pippo/core/Request.java +++ b/pippo-core/src/main/java/ro/pippo/core/Request.java @@ -434,6 +434,14 @@ public final class Request { return httpServletRequest.getHeaders(name); } + /** + * Wrapper function to get all request header names + * @return the enumerator for request headers + */ + public Enumeration<String> getHeaderNames() { + return httpServletRequest.getHeaderNames(); + } + public boolean isSecure() { return httpServletRequest.isSecure(); }
feat: add wrapper method to get header names (#<I>)
pippo-java_pippo
train
java
49b68c06c9c85b737f4c2e98a7d5f8d4815da1f5
diff --git a/h2o-core/src/main/java/water/api/RequestServer.java b/h2o-core/src/main/java/water/api/RequestServer.java index <HASH>..<HASH> 100644 --- a/h2o-core/src/main/java/water/api/RequestServer.java +++ b/h2o-core/src/main/java/water/api/RequestServer.java @@ -632,7 +632,7 @@ public class RequestServer extends NanoHTTPD { else if (e instanceof MalformedURLException) error._http_status = HttpResponseStatus.BAD_REQUEST.getCode(); - Log.warn("Caught exception: " + error.toString()); + Log.err("Caught exception: " + error.toString()); // Note: don't use Schema.schema(version, error) because we have to work at bootstrap: return wrap(new H2OErrorV3().fillFromImpl(error), type);
PUBDEV-<I>: exceptions caught in RequestServer.serve() should be ERROR, not WARN.
h2oai_h2o-3
train
java
898d45e0796411238d7a354fcbafc4f5e92565ff
diff --git a/appinst/application_menus.py b/appinst/application_menus.py index <HASH>..<HASH> 100644 --- a/appinst/application_menus.py +++ b/appinst/application_menus.py @@ -80,7 +80,7 @@ def install(menus, shortcuts, install_mode='user'): elif plat == 'windows': pver = platform.win32_ver()[0] elif plat == 'darwin': - pver = platform.platform.mac_ver()[0] + pver = platform.mac_ver()[0] # Dispatch for RedHat 3. if plat.startswith('redhat') and pver[0] == '3':
Corrected method of finding platform version on OS X.
ContinuumIO_menuinst
train
py
308520890e5ab228cbdff545ca72093f2bf00c54
diff --git a/titlecase/__init__.py b/titlecase/__init__.py index <HASH>..<HASH> 100755 --- a/titlecase/__init__.py +++ b/titlecase/__init__.py @@ -17,7 +17,7 @@ __all__ = ['titlecase'] __version__ = '0.12.0' SMALL = 'a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v\.?|via|vs\.?' -PUNCT = r"""!"#$%&'‘()*+,\-–‒—―./:;?@[\\\]_`{|}~""" +PUNCT = r"""!"“#$%&'‘()*+,\-–‒—―./:;?@[\\\]_`{|}~""" SMALL_WORDS = re.compile(r'^(%s)$' % SMALL, re.I) INLINE_PERIOD = re.compile(r'[a-z][.][a-z]', re.I) diff --git a/titlecase/tests.py b/titlecase/tests.py index <HASH>..<HASH> 100644 --- a/titlecase/tests.py +++ b/titlecase/tests.py @@ -259,7 +259,11 @@ TEST_DATA = ( ( "‘QUOTE’ A GREAT", "‘Quote’ a Great", - ) + ), + ( + "“YOUNG AND RESTLESS”", + "“Young and Restless”", + ), )
Add fancy double quote to punctuation This allows “ in text to be capitalised.
ppannuto_python-titlecase
train
py,py
9f8e6f074ba7d9d060355a67a22c30a0c2cb44fd
diff --git a/astroid/node_classes.py b/astroid/node_classes.py index <HASH>..<HASH> 100644 --- a/astroid/node_classes.py +++ b/astroid/node_classes.py @@ -168,7 +168,9 @@ def _infer_slice(node, context=None): if all(elem is not _SLICE_SENTINEL for elem in (lower, upper, step)): return slice(lower, upper, step) - raise TypeError('Could not infer slice used in subscript.') + raise exceptions.AstroidTypeError( + message='Could not infer slice used in subscript', + node=node, index=node.parent, context=context) def _container_getitem(instance, elts, index, context=None): @@ -1243,6 +1245,7 @@ class Const(NodeNG, bases.Instance): index_value = index.value elif isinstance(index, Slice): index_value = _infer_slice(index, context=context) + else: raise exceptions.AstroidTypeError( 'Could not use type {} as subscript index'.format(type(index))
Raise AstroidTypeError whenever a slice cannot be inferred, instead of raising TypeError and letting the upper context to handle it.
PyCQA_astroid
train
py
1e36892c7359679fb2be15e1e2beb34bf80921a0
diff --git a/playground-runner/bref.php b/playground-runner/bref.php index <HASH>..<HASH> 100644 --- a/playground-runner/bref.php +++ b/playground-runner/bref.php @@ -11,7 +11,18 @@ $errorHandler->registerExceptionHandler(); $errorHandler->registerErrorHandler(); $errorHandler->registerShutdownFunction(); +function clearTemp(): void +{ + $files = glob('/tmp/*'); + foreach ($files as $file) { + if (is_file($file)) { + @unlink($file); + } + } +} + return function ($event) { + clearTemp(); $code = $event['code']; $level = $event['level']; $codePath = '/tmp/tmp.php';
Playground runner - clear /tmp before next run
phpstan_phpstan
train
php
547d259e365b4af47b8a98f092252a32bb3dd3b5
diff --git a/src/RecursivePublishable.php b/src/RecursivePublishable.php index <HASH>..<HASH> 100644 --- a/src/RecursivePublishable.php +++ b/src/RecursivePublishable.php @@ -57,6 +57,16 @@ class RecursivePublishable extends DataExtension */ public function publishRecursive() { + /** @var DataObject|Versioned $owner */ + $owner = $this->owner; + + // get the last published version + $original = null; + if ($owner->hasExtension(Versioned::class) && $owner->isPublished()) { + $original = Versioned::get_by_stage($owner->baseClass(), Versioned::LIVE) + ->byID($owner->ID); + } + // Create a new changeset for this item and publish it $changeset = ChangeSet::create(); $changeset->IsInferred = true; @@ -64,13 +74,22 @@ class RecursivePublishable extends DataExtension __CLASS__ . '.INFERRED_TITLE', "Generated by publish of '{title}' at {created}", [ - 'title' => $this->owner->Title, + 'title' => $owner->Title, 'created' => DBDatetime::now()->Nice() ] ); + $changeset->write(); - $changeset->addObject($this->owner); - return $changeset->publish(true); + $changeset->addObject($owner); + + $result = $changeset->publish(true); + if (!$result) { + return $result; + } + + $owner->invokeWithExtensions('onAfterPublishRecursive', $original); + + return $result; } /**
onAfterPublishRecursive extension hook added.
silverstripe_silverstripe-versioned
train
php
1a8289ca3bc733eb7282c2c068c98fbae264c422
diff --git a/cgo/cgo_main_run.go b/cgo/cgo_main_run.go index <HASH>..<HASH> 100644 --- a/cgo/cgo_main_run.go +++ b/cgo/cgo_main_run.go @@ -17,6 +17,7 @@ import ( "path" "github.com/mweagle/Sparta" + "github.com/spf13/cobra" "golang.org/x/tools/go/ast/astutil" ) @@ -31,10 +32,21 @@ func cgoMain(callerMainInputFilepath string, site *sparta.S3Site, workflowHooks *sparta.WorkflowHooks) error { + // We need to parse the command line args and get the subcommand... + cgoCommandName := "" + validationHook := func(command *cobra.Command) error { + cgoCommandName = command.Name() + return nil + } + // Extract & validate the SSH Key + parseErr := sparta.ParseOptions(validationHook) + if nil != parseErr { + return fmt.Errorf("Failed to parse command line") + } + // We can short circuit a lot of this if we're just // trying to do a unit test or export. - subCommand := os.Args[1] - if subCommand != "provision" { + if cgoCommandName != "provision" { return sparta.MainEx(serviceName, serviceDescription, lambdaAWSInfos,
Properly parse CLI options to determine when source should be rewritten
mweagle_Sparta
train
go
652d9409708510ddcfdf3c73c92205345ef3710c
diff --git a/generators/needle/needle-client-base.js b/generators/needle/needle-client-base.js index <HASH>..<HASH> 100644 --- a/generators/needle/needle-client-base.js +++ b/generators/needle/needle-client-base.js @@ -3,7 +3,9 @@ const needleBase = require('./needle-base'); module.exports = class extends needleBase { addStyle(style, comment, filePath, needle) { const styleBlock = this.mergeStyleAndComment(style, comment); - this.addBlockContentToFile(filePath, styleBlock, needle); + const rewriteFileModel = this.generateFileModel(filePath, needle, styleBlock); + + this.addBlockContentToFile(rewriteFileModel, 'Style not added to JHipster app.\n'); } mergeStyleAndComment(style, comment) {
Use needleNase API in clientBase
jhipster_generator-jhipster
train
js
c1cce6fe5e49df5546c30a662fd141d41f4fc389
diff --git a/Builder.php b/Builder.php index <HASH>..<HASH> 100644 --- a/Builder.php +++ b/Builder.php @@ -199,9 +199,7 @@ class Builder extends \Twig_Extension $this->addToExploreQueue($file); } - if (!$this->exploreQueue) { - $this->addToExploreQueue('index.html.twig'); - } + $this->addToExploreQueue('index.html.twig'); while ($this->exploreQueue) { $page = array_shift($this->exploreQueue);
[Builder] Adding root page in any case
Gregwar_Slidey
train
php
2c3d158da220baceee8c1013976b4f76ee46cc06
diff --git a/sprd/view/ProductViewerClass.js b/sprd/view/ProductViewerClass.js index <HASH>..<HASH> 100644 --- a/sprd/view/ProductViewerClass.js +++ b/sprd/view/ProductViewerClass.js @@ -224,7 +224,7 @@ define(["js/ui/View", "js/core/Bus"], function (View, Bus) { if (this.runsInBrowser() && this.$.editable) { var self = this; - this.bind("on:click", this._clickHandler, this); + this.$stage.bind("on:click", this._clickHandler, this); this.$stage.bind('on:blur', function () { self.set('focused', false); });
DEV-<I> - Improved Color selector
spreadshirt_rAppid.js-sprd
train
js
dde3edc5b460f1ff52bb1671c91236b60f5e0f2b
diff --git a/spyder/widgets/mixins.py b/spyder/widgets/mixins.py index <HASH>..<HASH> 100644 --- a/spyder/widgets/mixins.py +++ b/spyder/widgets/mixins.py @@ -694,14 +694,9 @@ class BaseEditMixin(object): def get_text_with_eol(self): """Same as 'toPlainText', replace '\n' by correct end-of-line characters""" - utext = to_text_string(self.toPlainText()) + utext = self.toPlainText() linesep = self.get_line_separator() - if linesep != '\n': - lines = utext.splitlines() - txt = linesep.join(lines) - if utext.endswith('\n'): - txt += linesep - return txt + utext.replace('\n', linesep) return utext #------Positions, coordinates (cursor, EOF, ...)
Mixins: keep text same as toPlainText in get_text_with_eol
spyder-ide_spyder
train
py
7dd2b8b725684a62fe18b3d6bfa5af68f7d70a56
diff --git a/modules/ve/dm/ve.dm.DocumentSynchronizer.js b/modules/ve/dm/ve.dm.DocumentSynchronizer.js index <HASH>..<HASH> 100644 --- a/modules/ve/dm/ve.dm.DocumentSynchronizer.js +++ b/modules/ve/dm/ve.dm.DocumentSynchronizer.js @@ -1,7 +1,7 @@ /** * Creates an ve.dm.DocumentSynchronizer object. * - * This object is a one-time use utilitiy for collecting actions to be performed on the model tree + * This object is a utility for collecting actions to be performed on the model tree * in multiple steps and then processing those actions in a single step. * * @class @@ -106,4 +106,7 @@ ve.dm.DocumentSynchronizer.prototype.synchronize = function() { break; } } + + // We've processed the queue, clear it + this.actions = []; };
Make DocumentSynchronizer clear the queue after it's done with it
wikimedia_parsoid
train
js
755cc57ec545f496eef9b3622fee77687ba706fb
diff --git a/src/main/java/org/asteriskjava/fastagi/internal/AgiRequestImpl.java b/src/main/java/org/asteriskjava/fastagi/internal/AgiRequestImpl.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/asteriskjava/fastagi/internal/AgiRequestImpl.java +++ b/src/main/java/org/asteriskjava/fastagi/internal/AgiRequestImpl.java @@ -100,7 +100,7 @@ public class AgiRequestImpl implements Serializable, AgiRequest } /** - * Builds a map containing variable names as key (with the "agi_" prefix + * Builds a map containing variable names as key (with the "agi_" or "ogi_" prefix * stripped) and the corresponding values.<p> * Syntactically invalid and empty variables are skipped. * @@ -128,8 +128,8 @@ public class AgiRequestImpl implements Serializable, AgiRequest continue; } - // key doesn't start with agi_? - if (!line.startsWith("agi_")) + // key doesn't start with agi_ or ogi_? + if (!line.startsWith("agi_") && !line.startsWith("ogi_")) { continue; }
[AJ-<I>] Applied patch to make AGI work with Callweaver
asterisk-java_asterisk-java
train
java
e8568ebee191c705e7d567dc1e47c6e48978047c
diff --git a/Model/Import/Category.php b/Model/Import/Category.php index <HASH>..<HASH> 100644 --- a/Model/Import/Category.php +++ b/Model/Import/Category.php @@ -238,6 +238,8 @@ class Category extends \Magento\ImportExport\Model\Import\AbstractEntity * @param \Magento\Catalog\Model\Category $defaultCategory * @param \Magento\Catalog\Model\ResourceModel\Category\Attribute\Collection $attributeCollection * @param \Magento\Catalog\Model\ResourceModel\Category\Collection $categoryCollection + * @param \Magento\Eav\Model\Config $eavConfig + * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param array $data */ public function __construct(
Correcting PHPDoc of Category import file
firegento_FireGento_FastSimpleImport2
train
php
ad025f540bec10b2eb192b0ecc7c8b7fa719b946
diff --git a/post_office/utils.py b/post_office/utils.py index <HASH>..<HASH> 100644 --- a/post_office/utils.py +++ b/post_office/utils.py @@ -141,7 +141,7 @@ def create_attachments(attachment_files): attachments.append(attachment) - if opened_file: + if opened_file is not None: opened_file.close() return attachments
More verbose check for opened_file
ui_django-post_office
train
py
41822718680dee04e26783666cd3a0ff3186d7d7
diff --git a/src/Kris/LaravelFormBuilder/Fields/CollectionType.php b/src/Kris/LaravelFormBuilder/Fields/CollectionType.php index <HASH>..<HASH> 100644 --- a/src/Kris/LaravelFormBuilder/Fields/CollectionType.php +++ b/src/Kris/LaravelFormBuilder/Fields/CollectionType.php @@ -77,7 +77,7 @@ class CollectionType extends ParentType $this->children = []; $type = $this->getOption('type'); $oldInput = $this->parent->getRequest()->old($this->getNameKey()); - $currentInput = $this->parent->getRequest()->get($this->getNameKey()); + $currentInput = $this->parent->getRequest()->input($this->getNameKey()); try { $fieldType = $this->formHelper->getFieldType($type);
Bug-fix: CollectionType.php Use input() to correctly return the data from the current request so that, if it contains multiple rows, those rows can be read in as children of the Collection field.
kristijanhusak_laravel-form-builder
train
php
eff1e29bd6887e3327439ab358a4b1fb4e543957
diff --git a/Tests/Unit/Core/Content/Block/Base/AlBlockManagerContainerBase.php b/Tests/Unit/Core/Content/Block/Base/AlBlockManagerContainerBase.php index <HASH>..<HASH> 100755 --- a/Tests/Unit/Core/Content/Block/Base/AlBlockManagerContainerBase.php +++ b/Tests/Unit/Core/Content/Block/Base/AlBlockManagerContainerBase.php @@ -93,7 +93,7 @@ abstract class AlBlockManagerContainerBase extends AlContentManagerBase $activeTheme->expects($this->once()) ->method('getThemeBootstrapVersion') ->will($this->returnValue($bootstrapVersion)); - $this->container->expects($this->at(2)) + $this->container->expects($this->at(3)) ->method('get') ->with('red_kite_cms.active_theme') ->will($this->returnValue($activeTheme));
fixed red_kite_cms.active_theme sevice getting
redkite-labs_RedKiteCmsBundle
train
php
f3c8a08edcb3e7fa431d20350e0d274921b6318a
diff --git a/app/scripts/angular-apimock.js b/app/scripts/angular-apimock.js index <HASH>..<HASH> 100644 --- a/app/scripts/angular-apimock.js +++ b/app/scripts/angular-apimock.js @@ -54,7 +54,11 @@ angular.module('apiMock', []) var p = ApiMock.prototype; p.shouldMock = function (req) { - return (this._isGlobalMock() || this._isLocalMock(req)) && this._isApiPath(req); + var mock = this._isLocalMock(req); + if (mock === undefined) { + mock = this._isGlobalMock(); + } + return mock && this._isApiPath(req); }; p.doMock = function (req) { @@ -78,7 +82,7 @@ angular.module('apiMock', []) }; p._isLocalMock = function (req) { - return !!req.apiMock; + return req.apiMock === undefined ? undefined : !!req.apiMock; }; p._isGlobalMock = function () {
Add override support through $http.
seriema_angular-apimock
train
js
30899fef7c78cfd9e10e5b6121d0d62cc82997df
diff --git a/boards.js b/boards.js index <HASH>..<HASH> 100644 --- a/boards.js +++ b/boards.js @@ -78,7 +78,7 @@ module.exports = { byteDelay:0x00, pollValue:0x53, pollIndex:0x03, - productId: ['0x0042'], + productId: ['0x0042', '0x6001'], protocol: 'stk500v2' }, 'sf-pro-micro': {
Added support for Sparkfun's Mega Pro board. Fixes: #<I>
noopkat_avrgirl-arduino
train
js
094ca1fcad4329decb897bf378341955805feae3
diff --git a/spec/functional/dsl/registry_helper_spec.rb b/spec/functional/dsl/registry_helper_spec.rb index <HASH>..<HASH> 100644 --- a/spec/functional/dsl/registry_helper_spec.rb +++ b/spec/functional/dsl/registry_helper_spec.rb @@ -39,6 +39,7 @@ describe Chef::Resource::RegistryKey, :unix_only do end describe Chef::Resource::RegistryKey, :windows_only do + include_context Chef::Resource::File let(:file_base) { "file_spec" } let(:expected_content) { "Don't fear the ruby." }
Finxing a missing line pushed too soon.
chef_chef
train
rb
a70b728e31f7454f86527e54c0896c98f32a3c03
diff --git a/doc/source/conf.py b/doc/source/conf.py index <HASH>..<HASH> 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -243,7 +243,7 @@ intersphinx_mapping = { 'numpy': ('https://docs.scipy.org/doc/numpy', None), 'scipy': ('https://docs.scipy.org/doc/scipy/reference', None), 'xarray': ('https://xarray.pydata.org/en/stable', None), - 'dask': ('https://dask.pydata.org/en/latest', None), + 'dask': ('https://docs.dask.org/en/latest', None), 'pyresample': ('https://pyresample.readthedocs.io/en/stable', None), 'trollsift': ('https://trollsift.readthedocs.io/en/stable', None), 'trollimage': ('https://trollimage.readthedocs.io/en/stable', None),
Update dask intersphinx to point to new dask documentation
pytroll_satpy
train
py
b118bf061e7ccfcfb39db72460a211ac8d955598
diff --git a/lib/tvdb_party/search.rb b/lib/tvdb_party/search.rb index <HASH>..<HASH> 100644 --- a/lib/tvdb_party/search.rb +++ b/lib/tvdb_party/search.rb @@ -85,7 +85,11 @@ module TvdbParty end def get_banners(series) - response = self.class.get("/#{@api_key}/series/#{series.id}/banners.xml").parsed_response + get_banners_for_series_id(series.id) + end + + def get_banners_for_series_id(series_id) + response = self.class.get("/#{@api_key}/series/#{series_id}/banners.xml").parsed_response return [] unless response["Banners"] && response["Banners"]["Banner"] case response["Banners"]["Banner"] when Array
add a method to return banners for a series id
maddox_tvdb_party
train
rb
5001642290bd0400f4858b2a826ccfadcfa78188
diff --git a/libs/Application.js b/libs/Application.js index <HASH>..<HASH> 100644 --- a/libs/Application.js +++ b/libs/Application.js @@ -91,15 +91,23 @@ _.extend(Application.prototype, { var self = this; var io = require('socket.io')(server); io.on('connection', function(socket){ - console.log('a user connected'); + self.onConnection(io, socket); self._loadModulesFromFolder( path.join(self.appRoot, self.folderConfigs.hubFolder), {io: io, socket: socket}); - socket.on('disconnect', function(){ - console.log('user disconnected'); + socket.on('disconnect', function () { + self.onDisconnect(io, socket); }); }); }, + onConnection: function () { + console.log('a user connected'); + }, + + onDisconnect: function () { + console.log('user disconnected'); + }, + // boot controller & api _boot: function () { this._loadModulesFromFolder(path.join(this.appRoot, this.folderConfigs.apiFolder), {app: this.app});
add defaults callback for socketio connection and disconnection
microscopejs_microscope-web
train
js
e307d33f54746f16f8d6e6f7c21c9ba9934cb760
diff --git a/src/Renderer/JsonRenderer.php b/src/Renderer/JsonRenderer.php index <HASH>..<HASH> 100644 --- a/src/Renderer/JsonRenderer.php +++ b/src/Renderer/JsonRenderer.php @@ -47,7 +47,13 @@ class JsonRenderer implements RendererInterface public function getResult($asString = true) { if ($asString) { - return json_encode(array_pop($this->result)); + $mergedResultArray= []; + + while ($suiteResultItem = array_pop($this->result)) { + $mergedResultArray = array_merge($mergedResultArray, $suiteResultItem); + } + + return json_encode($mergedResultArray); } return $this->result;
Enable support for multiple suites When rendering the result array only the first suite is taken. This patch merges the results together before rendering so all suites are processed.
Vanare_behat-cucumber-formatter
train
php
e4a10807532de3c5821d18f984eda785aae51540
diff --git a/Kwc/Basic/Text/Component.php b/Kwc/Basic/Text/Component.php index <HASH>..<HASH> 100644 --- a/Kwc/Basic/Text/Component.php +++ b/Kwc/Basic/Text/Component.php @@ -58,7 +58,9 @@ class Kwc_Basic_Text_Component extends Kwc_Abstract $ret['cssClass'] = 'webStandard kwcText'; - $ret['assets']['files']['styles'] = new Kwc_Basic_Text_StylesAsset('Kwc_Basic_Text_StylesModel'); + static $stylesAssets; + if (!isset($stylesAssets)) $stylesAssets = new Kwc_Basic_Text_StylesAsset('Kwc_Basic_Text_StylesModel'); + $ret['assets']['files']['styles'] = $stylesAssets; $ret['flags']['searchContent'] = true; $ret['flags']['hasFulltext'] = true; $ret['extConfig'] = 'Kwf_Component_Abstract_ExtConfig_Form';
only create one instance of asset this fixes 5x output of css
koala-framework_koala-framework
train
php
023ecc358edcce5361d7ead0527a1d0096da9173
diff --git a/src/Requests/Request.php b/src/Requests/Request.php index <HASH>..<HASH> 100644 --- a/src/Requests/Request.php +++ b/src/Requests/Request.php @@ -154,6 +154,11 @@ abstract class Request if (in_array($code, [502, 525])) { static::$endpointFailureCount++; + + if (static::$endpointFailureCount >= 5) { + exit("Discord endpoint failure 502 or 525, drop out after 5 attempts."); + } + static::getLoop()->addTimer(0.25, $request); } elseif(static::$endpointFailureCount > 0) { static::$endpointFailureCount = 0;
drop out at 5 attempts when discord sends <I> or <I>
discodian_core
train
php
bf9aab795e74a6916af68709d489e61a751ff21c
diff --git a/jpype/_jarray.py b/jpype/_jarray.py index <HASH>..<HASH> 100644 --- a/jpype/_jarray.py +++ b/jpype/_jarray.py @@ -172,6 +172,9 @@ class _JArray(object): except TypeError: return True + def clone(self): + return _jclass.JClass("java.util.Arrays").copyOf(self, len(self)) + JArray = _jobject.defineJObjectFactory("JArray", None, _JArray)
Added missing clone method for arrays.
jpype-project_jpype
train
py
810e1f9e648a24f35f917b14003c85a3595f953b
diff --git a/tests_regression/helpers/regression.py b/tests_regression/helpers/regression.py index <HASH>..<HASH> 100644 --- a/tests_regression/helpers/regression.py +++ b/tests_regression/helpers/regression.py @@ -54,16 +54,14 @@ def render_doctree(doctree, out_filename, reference_path, tmpdir, document = template_configuration.document(doctree) else: document = MinimalTemplate(doctree) - document.render(tmpdir.join(out_filename).strpath) output_dir = TEST_DIR / 'output' / out_filename - if output_dir.is_symlink(): - output_dir.unlink() - output_dir.symlink_to(tmpdir.strpath, target_is_directory=True) + output_dir.mkdir(parents=True, exist_ok=True) + document.render(output_dir / out_filename) pdf_filename = '{}.pdf'.format(out_filename) - with in_directory(tmpdir.strpath): + with in_directory(output_dir): _, _, _, badlinks, _, _ = check_pdf_links(pdf_filename) pytest.assume(badlinks == []) if not diff_pdf(reference_path / pdf_filename, pdf_filename): pytest.fail('The generated PDF is different from the reference ' 'PDF.\nGenerated files can be found in {}' - .format(tmpdir.strpath)) + .format(output_dir))
Regression tests: store output in output/ (no links)
brechtm_rinohtype
train
py
2dc6f52a5b7884db18e25d7337ac5731e2de4839
diff --git a/src/app/n2n/web/http/controller/ControllingPlan.php b/src/app/n2n/web/http/controller/ControllingPlan.php index <HASH>..<HASH> 100644 --- a/src/app/n2n/web/http/controller/ControllingPlan.php +++ b/src/app/n2n/web/http/controller/ControllingPlan.php @@ -324,7 +324,7 @@ class ControllingPlan { function executeToMain() { $this->ensureFilterable(); - while (null !== ($nextFilter = $this->nextFilter())) { + while (null !== ($nextFilter = $this->filterQueue->next())) { $nextFilter->execute(); }
Call to undefined method BUG FIX
n2n_n2n-web
train
php
cec6b56140a6b461efb8a692121382987786629a
diff --git a/src/Collection/Structure/AbstractStructure.php b/src/Collection/Structure/AbstractStructure.php index <HASH>..<HASH> 100644 --- a/src/Collection/Structure/AbstractStructure.php +++ b/src/Collection/Structure/AbstractStructure.php @@ -61,7 +61,7 @@ abstract class AbstractStructure implements Structure */ public static function keys(): array { - return self::create()->getKeys(); + return self::create()->getStructureKeys(); } /** @@ -183,7 +183,7 @@ abstract class AbstractStructure implements Structure /** * @return array */ - public function getKeys(): array + public function getStructureKeys(): array { return array_keys($this->getStructure());
renamed method getKeys() to getStructureKeys()
peakphp_framework
train
php
19f027f40267de7b9f27e6f1c7649dd3eaa1adc3
diff --git a/image/colors/convert.go b/image/colors/convert.go index <HASH>..<HASH> 100644 --- a/image/colors/convert.go +++ b/image/colors/convert.go @@ -94,8 +94,7 @@ func ColorAverageImage(i image.Image) color.Color { r, b, g, n := 0.0, 0.0, 0.0, 0.0 for x := min.X; x < max.X; x++ { for y := min.Y; y < max.Y; y++ { - c := i.At(x, y) - ri, gi, bi, _ := c.RGBA() + ri, gi, bi, _ := i.At(x, y).RGBA() r += float64(uint8(ri) * uint8(ri)) g += float64(uint8(gi) * uint8(gi)) b += float64(uint8(bi) * uint8(bi))
streamline: image/colors: update `ColorAverageImage()`
grokify_gotilla
train
go
33b1deadf128751477a4f1bc1398cc91b9f84ed0
diff --git a/src/Illuminate/Routing/RouteParameterBinder.php b/src/Illuminate/Routing/RouteParameterBinder.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Routing/RouteParameterBinder.php +++ b/src/Illuminate/Routing/RouteParameterBinder.php @@ -2,6 +2,8 @@ namespace Illuminate\Routing; +use Illuminate\Support\Arr; + class RouteParameterBinder { /**
Add missing import. (#<I>)
laravel_framework
train
php
783b808f78e33c142d3e950dc42f86956aa1a4c2
diff --git a/src/SchemaNormalizer.php b/src/SchemaNormalizer.php index <HASH>..<HASH> 100644 --- a/src/SchemaNormalizer.php +++ b/src/SchemaNormalizer.php @@ -251,7 +251,10 @@ final class SchemaNormalizer implements NormalizerInterface * @see https://spacetelescope.github.io/understanding-json-schema/structuring.html#reuse */ if (\property_exists($schema, '$ref') && \is_string($schema->{'$ref'})) { - return $this->schemaStorage->resolveRefSchema($schema); + return $this->resolveSchema( + $data, + $this->schemaStorage->resolveRefSchema($schema) + ); } return $schema;
Fix: Keep resolving references until there are none left
localheinz_json-normalizer
train
php
6afde35f6ed3d4b0ee536350982638175b8b5e87
diff --git a/test/specs/ajax.js b/test/specs/ajax.js index <HASH>..<HASH> 100644 --- a/test/specs/ajax.js +++ b/test/specs/ajax.js @@ -34,11 +34,11 @@ describe("A suite testing ajax functionality of scandio.js", function() { it("should construct a set of valid plugin urls", function() { var resultUrls = ß.ajax.plugins({ - 'scandio.js/example/scripts/': ['alert', 'log'] + 'scandio.js/example/scripts/': ['debug-error', 'debug-log'] }); - expect(resultUrls).toMatch('scandio.js/example/scripts/alert.js'); - expect(resultUrls).toMatch('scandio.js/example/scripts/log.js'); - expect(resultUrls).not.toMatch('scandio.js/example/scripts/warn.js'); + expect(resultUrls).toMatch('scandio.js/example/scripts/debug-error.js'); + expect(resultUrls).toMatch('scandio.js/example/scripts/debug-log.js'); + expect(resultUrls).not.toMatch('scandio.js/example/scripts/debug-warn.js'); }); }); \ No newline at end of file
Fixes loaded script filename in specs.
scandio_scandiojs
train
js
01f6f6d6626d5ab37bf236a00b6a8623410e8b67
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -19,15 +19,6 @@ from setuptools import find_packages from setuptools import setup from setuptools.command.build_ext import build_ext - -def read(*names, **kwargs): - with io.open( - join(dirname(__file__), *names), - encoding=kwargs.get('encoding', 'utf8') - ) as fh: - return fh.read() - - # Enable code coverage for C code: we can't use CFLAGS=-coverage in tox.ini, since that may mess with compiling # dependencies (e.g. numpy). Therefore we set SETUPPY_CFLAGS=-coverage in tox.ini and copy it to CFLAGS here (after # deps have been safely installed). @@ -39,7 +30,6 @@ else: LFLAGS = '' - class optional_build_ext(build_ext): """Allow the building of C extensions to fail.""" def run(self): @@ -64,6 +54,14 @@ class optional_build_ext(build_ext): print('*' * 80) +def read(*names, **kwargs): + with io.open( + join(dirname(__file__), *names), + encoding=kwargs.get('encoding', 'utf8') + ) as fh: + return fh.read() + + setup( name='lazy-object-proxy', use_scm_version={
Just a bit of reordering.
ionelmc_python-lazy-object-proxy
train
py
bb488c32887bf8c815538aed9df4a4f428d568e1
diff --git a/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/converter/TypeConverter.java b/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/converter/TypeConverter.java index <HASH>..<HASH> 100644 --- a/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/converter/TypeConverter.java +++ b/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/converter/TypeConverter.java @@ -53,10 +53,4 @@ public class TypeConverter extends AbstractConverter<Type> return result; } - - @Override - protected String convertToString(Type type) - { - return ReflectionUtils.serializeType(type); - } }
XCOMMONS-<I>: Define a stable way to serialize types * Revert convertToString method added in TypeConverter since it's never used.
xwiki_xwiki-commons
train
java
8cbefcc081ea3f386437ee0ddefcc6aaac766e7a
diff --git a/src/structures/ClientUser.js b/src/structures/ClientUser.js index <HASH>..<HASH> 100644 --- a/src/structures/ClientUser.js +++ b/src/structures/ClientUser.js @@ -271,7 +271,7 @@ class ClientUser extends User { * @returns {Promise<Presence>} */ setActivity(name, { url, type } = {}) { - if (!name) return this.setPresence({ activity: null }); + if (!name) return this.setPresence({ game: null }); return this.setPresence({ game: { name, type, url }, });
[<I>.x] Fix param to setPresence in setActivity (#<I>) ClientUser#setPresence in master branch (latest) calls client.presences.setClientPresence, but that in <I> does not so i change parameter sent to setPresence for clearing the game activity, from activity:null to game:null, for now until setPresence gets updated
discordjs_discord.js
train
js
e6e50d6ea03ac6c9550b27c5850eceeb59faf45f
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -518,7 +518,8 @@ describe('Filters', function() { map = { "filter1": "'ACME super soakers are the worst' | replace('worst', 'best')", "filter2": "'ACME super soakers are the worst' | replace('best', 'worst')", - "filter3": "Product.discount | replace('8', '0')" + "filter3": "Product.discount | replace('8', '0')", + "filter4": "Product.special | replace('[\\.]+', '_', Product.special, 'g')" }; }); @@ -526,6 +527,7 @@ describe('Filters', function() { expect(result.filter1).to.equal('ACME super soakers are the best'); expect(result.filter2).to.equal('ACME super soakers are the worst'); expect(result.filter3).to.equal('0.00'); + expect(result.filter4).to.equal('text_with_special_characters'); }); });
Added additional test for replace() regex flags
NFNChris_json-transmute
train
js
8f1ed010c98589665f0cdd9328f6014893d1465a
diff --git a/lice/core.py b/lice/core.py index <HASH>..<HASH> 100644 --- a/lice/core.py +++ b/lice/core.py @@ -1,4 +1,4 @@ -from pkg_resources import resource_stream +from pkg_resources import (resource_stream, resource_listdir) import argparse import datetime import re @@ -8,8 +8,11 @@ import sys __version__ = "0.2" -LICENSES = ["agpl3", "apache", "bsd2", "bsd3", "cddl", "cc0", - "epl", "gpl2", "gpl3", "lgpl", "mit", "mpl"] +LICENSES = [] +for file in sorted(resource_listdir(__name__, '.')): + if file.startswith('template-'): + LICENSES.append(file[9:-4]) + DEFAULT_LICENSE = "bsd3"
Discover available licences at runtime.
licenses_lice
train
py
ecfca8273f59a0ddf853dbe6f1603d485329ecc6
diff --git a/spyder/config/main.py b/spyder/config/main.py index <HASH>..<HASH> 100644 --- a/spyder/config/main.py +++ b/spyder/config/main.py @@ -503,7 +503,6 @@ DEFAULTS = [ ('kite', { 'enable': True, - 'enable_snippets': True, }), ] diff --git a/spyder/plugins/completion/kite/plugin.py b/spyder/plugins/completion/kite/plugin.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/completion/kite/plugin.py +++ b/spyder/plugins/completion/kite/plugin.py @@ -75,5 +75,6 @@ class KiteCompletionPlugin(SpyderCompletionPlugin): self.kite_process.kill() def update_configuration(self): - self.client.enable_code_snippets = self.get_option('enable_snippets') + self.client.enable_code_snippets = \ + CONF.get('lsp-server', 'code_snippets') self.enabled = self.get_option('enable')
revert to lsp enable snippets option
spyder-ide_spyder
train
py,py
49f220cbe0a1774066a048cdfd8682d214a6df68
diff --git a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java index <HASH>..<HASH> 100644 --- a/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java @@ -40,8 +40,6 @@ import org.apache.cassandra.transport.messages.ResultMessage; */ public abstract class ModificationStatement extends CFStatement implements CQLStatement { - public static final ConsistencyLevel defaultConsistency = ConsistencyLevel.ONE; - public static enum Type { LOGGED, UNLOGGED, COUNTER
Remove the unused defaultConsistency from ModificationStatement
Stratio_stratio-cassandra
train
java
1178a63db4f0b921cfdd0773e5f3d16dfc9b59f0
diff --git a/libs/controller.php b/libs/controller.php index <HASH>..<HASH> 100644 --- a/libs/controller.php +++ b/libs/controller.php @@ -356,7 +356,18 @@ class Controller extends Object { $this->pageTitle = $pageTitle; } + + function flash($message, $url, $time=1) + { + $this->autoRender = false; + $this->autoLayout = false; + $this->set('url', $this->base.$url); + $this->set('message', $message); + $this->set('time', $time); + + $this->render(null,false,VIEWS.'layouts'.DS.'flash.thtml'); + } } ?> \ No newline at end of file
Added flash method back to the controller for now Will work on moving this out again at a later time git-svn-id: <URL>
cakephp_cakephp
train
php
ce8c0df6b98aae3545a6cb567059e17c9b625bb6
diff --git a/test/functional.js b/test/functional.js index <HASH>..<HASH> 100644 --- a/test/functional.js +++ b/test/functional.js @@ -652,6 +652,19 @@ describe('Functional tests using webpack', function() { ); webpackAssert.assertOutputFileDoesNotContain('entrypoints.json', sharedEntryTmpName); + // make sure runtime.js is here + // but the _tmp_shared entry is NOT here + webpackAssert.assertOutputJsonFileMatches('entrypoints.json', { + main: { + js: ['runtime.js', 'shared.js', 'main.js'], + css: ['shared.css'] + }, + other: { + js: ['runtime.js', 'shared.js', 'other.js'], + css: ['shared.css'] + }, + }); + testSetup.requestTestPage( path.join(config.getContext(), 'www'), [
Verify that the runtime files are included in entrypoints.json
symfony_webpack-encore
train
js
3229cc75a938a81709a743ebcca417db8be4e4a3
diff --git a/registration/runtests.py b/registration/runtests.py index <HASH>..<HASH> 100644 --- a/registration/runtests.py +++ b/registration/runtests.py @@ -82,5 +82,5 @@ def run_tests(): sys.exit(bool(failures)) -if __name__ == '__main__': # pragma: no cover - run_tests() # pragma: no cover +if __name__ == '__main__': + run_tests()
Don't need those coverage comments anymore.
ubernostrum_django-registration
train
py
618896bb8d879a8365dc359a8949c9d2cad5bec7
diff --git a/lib/Doctrine/ODM/MongoDB/Persisters/BasicDocumentPersister.php b/lib/Doctrine/ODM/MongoDB/Persisters/BasicDocumentPersister.php index <HASH>..<HASH> 100755 --- a/lib/Doctrine/ODM/MongoDB/Persisters/BasicDocumentPersister.php +++ b/lib/Doctrine/ODM/MongoDB/Persisters/BasicDocumentPersister.php @@ -607,7 +607,9 @@ class BasicDocumentPersister $changeset[$mapping['fieldName']] = $value; } if ( ! isset($embeddedMapping['targetDocument'])) { - $changeset['_doctrine_class_name'] = $class->getName(); + $discriminatorField = isset($embeddedMapping['discriminatorField']) ? $embeddedMapping['discriminatorField'] : '_doctrine_class_name'; + $discriminatorValue = isset($embeddedMapping['discriminatorMap']) ? array_search($class->getName(), $embeddedMapping['discriminatorMap']) : $class->getName(); + $changeset[$discriminatorField] = $discriminatorValue; } return $changeset; }
[MODM-<I>] Fixing issue with custom discriminator field on embedded documents
doctrine_mongodb-odm
train
php
3d8a365631eb15ba4efa8263e38d923d7c1f84de
diff --git a/src/ConvergeApi.php b/src/ConvergeApi.php index <HASH>..<HASH> 100644 --- a/src/ConvergeApi.php +++ b/src/ConvergeApi.php @@ -83,9 +83,9 @@ class ConvergeApi // Set request if ($this->live) { - $request_url = 'https://www.myvirtualmerchant.com/VirtualMerchant/process.do'; + $request_url = 'https://api.convergepay.com/VirtualMerchant/process.do'; } else { - $request_url = 'https://demo.myvirtualmerchant.com/VirtualMerchantDemo/process.do'; + $request_url = 'https://api.demo.convergepay.com/VirtualMerchantDemo/process.do'; } // Debugging output
update converge api urls updated urls as reported in <URL>
markroland_converge-api-php
train
php
c75df3a120806af0b86b089a6f410a15368ec314
diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php index <HASH>..<HASH> 100644 --- a/modules/backend/behaviors/RelationController.php +++ b/modules/backend/behaviors/RelationController.php @@ -414,7 +414,7 @@ class RelationController extends ControllerBehavior */ protected function findExistingRelationIds($checkIds = null) { - $foreignKeyName = $this->relationModel->getKeyName(); + $foreignKeyName = $this->relationModel->table . '.' . $this->relationModel->getKeyName(); $results = $this->relationObject ->getBaseQuery() @@ -818,4 +818,4 @@ class RelationController extends ControllerBehavior return $this->sessionKey = FormHelper::getSessionKey(); } -} \ No newline at end of file +}
when building belongsToMany relationships in controllers, the lack of a table name alias causes an sql ambigious Id error
octobercms_october
train
php
309fd56d18de6d69cea8bfa132c6eba024a60390
diff --git a/js/js_test.go b/js/js_test.go index <HASH>..<HASH> 100644 --- a/js/js_test.go +++ b/js/js_test.go @@ -221,6 +221,15 @@ func TestThis(t *testing.T) { dummys.Call("testThis") } +func TestArguments(t *testing.T) { + dummys.Set("testArguments", func() { + if js.Arguments.Length() != 3 || js.Arguments.Index(1).Int() != 1 { + t.Fail() + } + }) + dummys.Call("testArguments", 0, 1, 2) +} + func TestError(t *testing.T) { defer func() { err := recover()
added test for js.Arguments
gopherjs_gopherjs
train
go
bf564ade2287ccc906818da2149929b37508b408
diff --git a/src/mca.py b/src/mca.py index <HASH>..<HASH> 100644 --- a/src/mca.py +++ b/src/mca.py @@ -59,8 +59,8 @@ class MCA(object): self.P, self.s, self.Q = np.linalg.svd(_mul(self.D_r, Z_c, self.D_c)) if benzecri: - self.E = np.array([(K/(K-1)*(_ - 1/K))**2 - if _ > 1/K else 0 for _ in self.s**2]) + self.E = np.array([(K/(K-1.)*(_ - 1./K))**2 + if _ > 1./K else 0 for _ in self.s**2]) self.inertia = self.E.sum() if benzecri else sum(self.s**2) self.rank = np.argmax((self.E if benzecri else self.s**2) < TOL) self.L = (self.E if benzecri else self.s**2)[:self.rank]
Restore lost commit by jakub
esafak_mca
train
py
4c941c7231c88ff04ee620f43495edf5719ab760
diff --git a/src/Protocol/Fetch.php b/src/Protocol/Fetch.php index <HASH>..<HASH> 100644 --- a/src/Protocol/Fetch.php +++ b/src/Protocol/Fetch.php @@ -157,7 +157,7 @@ class Fetch extends Protocol $offset += 4; $ret = $this->decodeMessage(substr($data, $offset), $messageSize); - if (! is_array($ret) && $ret == false) { + if ($ret === null) { return null; }
Fix message decoding verification We forgot to change the verification while adding type declarations, therefore things were not working properly.
weiboad_kafka-php
train
php
92580992c96604dcd90e929c1b35299f007d6c94
diff --git a/ImapClient/IncomingMessageAttachment.php b/ImapClient/IncomingMessageAttachment.php index <HASH>..<HASH> 100644 --- a/ImapClient/IncomingMessageAttachment.php +++ b/ImapClient/IncomingMessageAttachment.php @@ -63,14 +63,14 @@ class IncomingMessageAttachment // Check for different types of inline attachments. if ($this->_incomingObject->structure->ifdparameters) { foreach ($this->_incomingObject->structure->dparameters as $param) { - if (strtolower($param->attribute === 'filename')) { + if (strtolower($param->attribute) === 'filename') { $this->name = $param->value; break; } } } elseif ($this->_incomingObject->structure->ifparameters) { foreach ($this->_incomingObject->structure->parameters as $param) { - if (strtolower($param->attribute === 'name')) { + if (strtolower($param->attribute) === 'name') { $this->name = $param->value; break; }
Fix uncaught typo strlower needs to be called on a string, then compared.
SSilence_php-imap-client
train
php
aae994402b1b16a2bca4a486dad4bb452770eb26
diff --git a/tests/pipeline/test_provider_healthcheck.py b/tests/pipeline/test_provider_healthcheck.py index <HASH>..<HASH> 100644 --- a/tests/pipeline/test_provider_healthcheck.py +++ b/tests/pipeline/test_provider_healthcheck.py @@ -6,6 +6,6 @@ TEST_SETTINGS = {'app': {'eureka_enabled': False}, 'asg': {'provider_healthcheck def test_provider_healthcheck(): """Make sure default Provider Health Check works.""" - provider_healthcheck, has_provider_healthcheck = check_provider_healthcheck(settings=TEST_SETTINGS) - assert provider_healthcheck == [] - assert has_provider_healthcheck == False + health_checks = check_provider_healthcheck(settings=TEST_SETTINGS) + assert health_checks.providers == [] + assert health_checks.has_healthcheck == False
test: Update Provider Health Check sanity See also: PSOBAT-<I>
foremast_foremast
train
py
b8caf9368839f97bf44465e00435366f33d69b9c
diff --git a/json2html/jsonconv.py b/json2html/jsonconv.py index <HASH>..<HASH> 100644 --- a/json2html/jsonconv.py +++ b/json2html/jsonconv.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + ''' JSON 2 HTML convertor ===================== @@ -12,7 +14,6 @@ Michel Müller 2015-1-31: Added bootstrap option, converting table-like JSON LICENSE: MIT -------- ''' -# -*- coding: utf-8 -*- import json import ordereddict
moved the coding hashbang to the top
softvar_json2html
train
py
55ec9113d63a99dab245c04dab6f657c83e1acae
diff --git a/app/lib/Repository.php b/app/lib/Repository.php index <HASH>..<HASH> 100755 --- a/app/lib/Repository.php +++ b/app/lib/Repository.php @@ -38,7 +38,6 @@ class Repository extends EntityRepository public function one(array $criteria = array(), $sort = null, $offset = null) { return $this->query($criteria, $sort, null, $offset) - ->setMaxResults(1) ->getQuery() ->getOneOrNullResult(); }
Remove single result condition on repo->one()
jacksleight_chalk
train
php
53715917558c99a258437cdadd7f1a9f7949c91d
diff --git a/packages/neos-ui/src/manifest.js b/packages/neos-ui/src/manifest.js index <HASH>..<HASH> 100644 --- a/packages/neos-ui/src/manifest.js +++ b/packages/neos-ui/src/manifest.js @@ -297,6 +297,20 @@ manifest('main', {}, globalRegistry => { store.dispatch(actions.UI.ContentCanvas.setSrc($get(['cr', 'nodes', 'byContextPath', newContextPath, 'uri'], newState))); store.dispatch(actions.CR.Nodes.setDocumentNode(newContextPath)); } + + // Remove the node from the old position in the dom + if ($get('cr.nodes.documentNode', state) !== oldContextPath) { + findAllOccurrencesOfNodeInGuestFrame(oldContextPath).forEach(el => { + const closestContentCollection = el.closest('.neos-contentcollection'); + el.remove(); + + createEmptyContentCollectionPlaceholderIfMissing(closestContentCollection); + + dispatchCustomEvent('Neos.NodeRemoved', 'Node was removed.', { + element: el + }); + }); + } }); //
BUGFIX: Remove old instance in dom when moving visible nodes
neos_neos-ui
train
js
c6468c2a6e7a627a9f95b9bb1684e35d71cff9b9
diff --git a/optaplanner-core/src/main/java/org/optaplanner/core/impl/localsearch/decider/acceptor/simulatedannealing/SimulatedAnnealingAcceptor.java b/optaplanner-core/src/main/java/org/optaplanner/core/impl/localsearch/decider/acceptor/simulatedannealing/SimulatedAnnealingAcceptor.java index <HASH>..<HASH> 100644 --- a/optaplanner-core/src/main/java/org/optaplanner/core/impl/localsearch/decider/acceptor/simulatedannealing/SimulatedAnnealingAcceptor.java +++ b/optaplanner-core/src/main/java/org/optaplanner/core/impl/localsearch/decider/acceptor/simulatedannealing/SimulatedAnnealingAcceptor.java @@ -99,7 +99,8 @@ public class SimulatedAnnealingAcceptor extends AbstractAcceptor { @Override public void stepStarted(LocalSearchStepScope stepScope) { - super.stepEnded(stepScope); + super.stepStarted(stepScope); + // TimeGradient only refreshes at the beginning of a step, so this code is in stepStarted instead of stepEnded double timeGradient = stepScope.getTimeGradient(); double reverseTimeGradient = 1.0 - timeGradient; temperatureLevels = new double[levelsLength];
stepStarted should not call stepEnded (thanks Boris & Lukas)
kiegroup_optaplanner
train
java
cfef62e87cb10e793af165090f12e536b188e297
diff --git a/src/Rebing/GraphQL/GraphQL.php b/src/Rebing/GraphQL/GraphQL.php index <HASH>..<HASH> 100644 --- a/src/Rebing/GraphQL/GraphQL.php +++ b/src/Rebing/GraphQL/GraphQL.php @@ -402,7 +402,7 @@ class GraphQL } /** - * @param array|string $schema + * @param array|string|null $schema * @return array */ protected function getSchemaConfiguration($schema): array
Correct declaration of GraphQL::getSchemaConfiguration Reported by phpstan: Parameter #1 $schema of method Rebing\GraphQL\GraphQL::getSchemaConfiguration() expects array|string, array|string|null given
rebing_graphql-laravel
train
php
29eff62147a20d7ed736ad3a4a6512b00a468f7b
diff --git a/porespy/filters/__funcs__.py b/porespy/filters/__funcs__.py index <HASH>..<HASH> 100644 --- a/porespy/filters/__funcs__.py +++ b/porespy/filters/__funcs__.py @@ -70,9 +70,9 @@ def trim_small_clusters(im, size=1): ``size`` removed. """ - if im.dims == 2: + if im.ndim == 2: strel = disk(1) - elif im.ndims == 3: + elif im.ndim == 3: strel = ball(1) else: raise Exception("Only 2D or 3D images are accepted")
Removed dims and ndims, typos
PMEAL_porespy
train
py
3d7766b66e431dc5f810189e10cad26fe6d8daad
diff --git a/lib/ronin/code/symbol_table.rb b/lib/ronin/code/symbol_table.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/code/symbol_table.rb +++ b/lib/ronin/code/symbol_table.rb @@ -53,6 +53,19 @@ module Ronin end # + # Returns a Hash of the symbol names and their values. + # + def symbols + hash = {} + + @table.each do |name,symbol| + hash[name] = symbol.value + end + + return hash + end + + # # Sets the symbol values en-mass using the specified _hash_ of # symbol names and their values. # diff --git a/spec/code/symbol_table_spec.rb b/spec/code/symbol_table_spec.rb index <HASH>..<HASH> 100644 --- a/spec/code/symbol_table_spec.rb +++ b/spec/code/symbol_table_spec.rb @@ -26,6 +26,12 @@ describe Code::SymbolTable do @table.symbol(:two).value.should == {:one => 1, :two => 2} end + it "should be able to retrieve symbols and actual values" do + @table.symbols.each do |name,value| + @table.symbol(name).value.should == value + end + end + it "should be able to set symbols en-mass" do @table.symbols = {:three => 3, :four => 4}
Added SymbolTable#symbols method.
ronin-ruby_ronin
train
rb,rb