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
a14647396feaae5b283de6ceefd42bece14aa005
diff --git a/cgo15.go b/cgo15.go index <HASH>..<HASH> 100644 --- a/cgo15.go +++ b/cgo15.go @@ -4,7 +4,6 @@ package gb import ( "path/filepath" - "strconv" "strings" )
fix missing imports (go <I>)
constabulary_gb
train
go
092e47b01f4413705f346b38f1b4a0315ea3f8fc
diff --git a/packages/jsio.js b/packages/jsio.js index <HASH>..<HASH> 100644 --- a/packages/jsio.js +++ b/packages/jsio.js @@ -118,8 +118,10 @@ relative: function (relativeTo, path) { var len = relativeTo.length; if (path.substring(0, len) == relativeTo) { + // if the relative path now starts with a path separator + // either (/ or \), remove it /* Note: we're casting a boolean to an int by adding len to it */ - return path.slice((path.charAt(len) == ENV.pathSep) + len); + return path.slice(len + /[\/\\]/.test(path.charAt(len))); } var sA = util.removeEndSlash(path).split(ENV.pathSep),
fix (makeRelativePath): strip \ and / when resolving paths After removing a subpath when resolving a relative path, look for a path separator (/ or \, regardless of platform), and remove it if necessary. This prevents mixed paths (eg: c:\initial\folder/added/path) from being resolved with a leftover / on the front on systems with \ as the path separator (windows).
gameclosure_js.io
train
js
9648aec9b114251a60c59607e528b4c81e98d21a
diff --git a/lib/arjdbc/jdbc/type_cast.rb b/lib/arjdbc/jdbc/type_cast.rb index <HASH>..<HASH> 100644 --- a/lib/arjdbc/jdbc/type_cast.rb +++ b/lib/arjdbc/jdbc/type_cast.rb @@ -104,9 +104,10 @@ module ActiveRecord::ConnectionAdapters return nil unless time time -= offset - Base.default_timezone == :utc ? time : time.getlocal + ActiveRecord::Base.default_timezone == :utc ? time : time.getlocal else - Time.public_send(Base.default_timezone, year, mon, mday, hour, min, sec, microsec) rescue nil + timezone = ActiveRecord::Base.default_timezone + Time.public_send(timezone, year, mon, mday, hour, min, sec, microsec) rescue nil end end
DateTime columns are returned always as nil values. The "rescue nil" in the module ActiveRecord::ConnectionAdapters::Jdbc::TypeCast is hiding the error.
jruby_activerecord-jdbc-adapter
train
rb
760ba24c1413d4a0b7f68d8ce2d6a30df8ad8e4a
diff --git a/mothermayi/git.py b/mothermayi/git.py index <HASH>..<HASH> 100644 --- a/mothermayi/git.py +++ b/mothermayi/git.py @@ -16,6 +16,8 @@ def execute(command): @contextlib.contextmanager def stash(): execute(['git', 'stash', '-u', '--keep-index']) - yield - execute(['git', 'reset', '--hard']) - execute(['git', 'stash', 'pop', '--quiet', '--index']) + try: + yield + finally: + execute(['git', 'reset', '--hard']) + execute(['git', 'stash', 'pop', '--quiet', '--index'])
Put un-stash in finally block Without it a failure will lead to us not putting the user back in the state they expect to be in
EliRibble_mothermayi
train
py
7e1b87a555c74fc27a940e2af77ebf8d569af83b
diff --git a/gsh/completion.py b/gsh/completion.py index <HASH>..<HASH> 100644 --- a/gsh/completion.py +++ b/gsh/completion.py @@ -66,8 +66,19 @@ completion_results = None # Commands in $PATH, used for the completion of the first word user_commands_in_path = read_commands_in_path() +try: + import ctypes.util + lib_readline = ctypes.cdll.LoadLibrary(ctypes.util.find_library("readline")) + rl_completion_append_character = ctypes.c_char.in_dll(lib_readline, + "rl_completion_append_character") +except Exception: + class rl_completion_append_character: + pass + + def complete(text, state): """On tab press, return the next possible completion""" + rl_completion_append_character.value = '\0' global completion_results if state == 0: line = readline.get_line_buffer()
Newer readline versions by default add a ' ' after a single choice completion. Revert to the previous behaviour of not doing that.
innogames_polysh
train
py
da1af25af8fc197eab98c598128693e55ef82cf7
diff --git a/xblock/fields.py b/xblock/fields.py index <HASH>..<HASH> 100644 --- a/xblock/fields.py +++ b/xblock/fields.py @@ -8,9 +8,6 @@ storage mechanism is. import copy from collections import namedtuple -UNSET = object() - - class BlockScope(object): """Enumeration defining BlockScopes""" USAGE, DEFINITION, TYPE, ALL = xrange(4) @@ -46,6 +43,9 @@ class Sentinel(object): return self.name +UNSET = Sentinel("fields.UNSET") + + ScopeBase = namedtuple('ScopeBase', 'user block') # pylint: disable=C0103 @@ -96,11 +96,11 @@ ScopeIds = namedtuple('ScopeIds', 'user_id block_type def_id usage_id') # pylin # define a placeholder ('nil') value to indicate when nothing has been stored # in the cache ("None" may be a valid value in the cache, so we cannot use it). -NO_CACHE_VALUE = object() +NO_CACHE_VALUE = Sentinel("fields.NO_CACHE_VALUE") # define a placeholder value that indicates that a value is explicitly dirty, # because it was explicitly set -EXPLICITLY_SET = object() +EXPLICITLY_SET = Sentinel("fields.EXPLICITLY_SET") class Field(object):
Use Sentinels for sentinels, it helps debugging.
edx_XBlock
train
py
3edfd7c6dc36b0f5c2172a91461f36c11fd2d2cc
diff --git a/blueflood-core/src/test/java/com/rackspacecloud/blueflood/io/serializers/IMetricSerializerTest.java b/blueflood-core/src/test/java/com/rackspacecloud/blueflood/io/serializers/IMetricSerializerTest.java index <HASH>..<HASH> 100644 --- a/blueflood-core/src/test/java/com/rackspacecloud/blueflood/io/serializers/IMetricSerializerTest.java +++ b/blueflood-core/src/test/java/com/rackspacecloud/blueflood/io/serializers/IMetricSerializerTest.java @@ -56,7 +56,6 @@ public class IMetricSerializerTest { BluefloodEnumRollup enumDeserialized = mapper.readValue(enumRollupString, BluefloodEnumRollup.class); String enumSerialized = mapper.writeValueAsString(enumDeserialized); - System.out.println(enumSerialized); Assert.assertEquals(enumRollupString, enumSerialized); BluefloodEnumRollup enumReDeserialized = mapper.readValue(enumSerialized, BluefloodEnumRollup.class);
Unnecassary SOP
rackerlabs_blueflood
train
java
70ddd54da517a2663f0aa5d68fbb2b60250f516a
diff --git a/src/client/decorators/MetaDecorator/DiagramDesigner/MetaDecorator.DiagramDesignerWidget.Aspects.js b/src/client/decorators/MetaDecorator/DiagramDesigner/MetaDecorator.DiagramDesignerWidget.Aspects.js index <HASH>..<HASH> 100644 --- a/src/client/decorators/MetaDecorator/DiagramDesigner/MetaDecorator.DiagramDesignerWidget.Aspects.js +++ b/src/client/decorators/MetaDecorator/DiagramDesigner/MetaDecorator.DiagramDesignerWidget.Aspects.js @@ -240,7 +240,7 @@ define([ } //set meta aspect first - client.setMetaAspect(objID, cDesc.name, cDesc); + client.setMetaAspect(objID, cDesc.name, cDesc.items || []); client.createSet(objID, cDesc.name); client.completeTransaction();
Pass correct params when saving spects in MetaDecorator (#<I>) needs to be cherry picked to <I> Former-commit-id: ee6c<I>a<I>fe3e<I>ba7a<I>b<I>dda<I>cdf7
webgme_webgme-engine
train
js
2b59445cdbfd9f06a356398d37dcd563f3217fe6
diff --git a/spec/tournament/single_elimination_spec.rb b/spec/tournament/single_elimination_spec.rb index <HASH>..<HASH> 100644 --- a/spec/tournament/single_elimination_spec.rb +++ b/spec/tournament/single_elimination_spec.rb @@ -16,7 +16,7 @@ describe Tournament::SingleElimination do end describe '#generate' do - context 'initial round' do + context 'first round' do it 'works for 4 teams' do driver = TestDriver.new(teams: [1, 2, 3, 4]) described_class.generate driver, round: 0
CLeaned up single elimination tests
ozfortress_tournament-system
train
rb
2979c23ed8122b7f0039a2f56a7d68c9825ea115
diff --git a/bot/action/core/filter.py b/bot/action/core/filter.py index <HASH>..<HASH> 100644 --- a/bot/action/core/filter.py +++ b/bot/action/core/filter.py @@ -43,6 +43,14 @@ class MessageAction(IntermediateAction): self._continue(event) +class ChosenInlineResultAction(IntermediateAction): + def process(self, event): + chosen_inline_result = event.update.chosen_inline_result + if chosen_inline_result is not None: + event.chosen_result = chosen_inline_result + self._continue(event) + + class InlineQueryAction(IntermediateAction): def process(self, event): inline_query = event.update.inline_query
Add support for ChosenInlineResult with a filter action
alvarogzp_telegram-bot-framework
train
py
44fd9a78f55ece65754b28bde42f2e2669511993
diff --git a/lib/ditty/controllers/component_controller.rb b/lib/ditty/controllers/component_controller.rb index <HASH>..<HASH> 100644 --- a/lib/ditty/controllers/component_controller.rb +++ b/lib/ditty/controllers/component_controller.rb @@ -96,7 +96,7 @@ module Ditty entity = read!(id) authorize entity, :update - flash[:redirect_to] = "#{base_path}/#{entity.display_id}" + flash[:redirect_to] = "#{base_path}/#{entity.display_id}" unless flash.keep(:redirect_to) haml :"#{view_location}/edit", locals: { entity: entity, title: heading(:edit) }, layout: layout
fix: Allow customization of redirect after updating
EagerELK_ditty
train
rb
b4ecdee79994ada46ec4233913f537f2a2df244d
diff --git a/bcbio/install.py b/bcbio/install.py index <HASH>..<HASH> 100644 --- a/bcbio/install.py +++ b/bcbio/install.py @@ -76,7 +76,7 @@ def upgrade_bcbio(args): _symlink_bcbio(args, script="bcbio_prepare_samples.py") upgrade_thirdparty_tools(args, REMOTES) print("Third party tools upgrade complete.") - if args.toolplus and (args.tooldir or args.upgrade != "skip"): + if args.toolplus: print("Installing additional tools") _install_toolplus(args) if args.install_data: @@ -442,6 +442,7 @@ def _install_toolplus(args): toolplus_dir = os.path.join(_get_data_dir(), "toolplus") for tool in args.toolplus: if tool.name in set(["gatk", "mutect"]): + print("Installing %s" % tool.name) _install_gatk_jar(tool.name, tool.fname, toolplus_manifest, system_config, toolplus_dir) else: raise ValueError("Unexpected toolplus argument: %s %s" % (tool.name, tool.fname)) @@ -494,6 +495,7 @@ def _update_system_file(system_file, name, new_kvs): if rname == name: for k, v in new_kvs.iteritems(): r_kvs[k] = v + added = True new_rs[rname] = r_kvs if not added: new_rs[name] = new_kvs
toolplus: don't overwrite existing config keyvals When adding jar locations for GATK and MuTect, leave existing key value specifications in place. Fixes #<I>
bcbio_bcbio-nextgen
train
py
99d54ede06443a50d44edda5e5bc9fbbe4f6a6d9
diff --git a/src/components/player.js b/src/components/player.js index <HASH>..<HASH> 100644 --- a/src/components/player.js +++ b/src/components/player.js @@ -392,7 +392,9 @@ export default class Player extends BaseObject { * @param {Number} volume should be a number between 0 and 100, 0 being mute and 100 the max volume. */ setVolume(volume) { - this.core.mediaControl.container.setVolume(volume); + if (this.core && this.core.mediaControl) { + this.core.mediaControl.setVolume(volume); + } } /** @@ -401,7 +403,7 @@ export default class Player extends BaseObject { * @return {Number} volume should be a number between 0 and 100, 0 being mute and 100 the max volume. */ getVolume() { - return this.core.mediaControl.container.volume; + return this.core && this.core.mediaControl ? this.core.mediaControl.volume : 0; } /**
Refactor player.setVolume to fix #<I>
clappr_clappr
train
js
c9c513b2357405f02a9ad01e13d9f9b2767894b3
diff --git a/test/scenarios/issue_649.py b/test/scenarios/issue_649.py index <HASH>..<HASH> 100755 --- a/test/scenarios/issue_649.py +++ b/test/scenarios/issue_649.py @@ -17,7 +17,7 @@ opts = op.parse(sys.argv) with driver.Metacluster(driver.find_rethinkdb_executable(opts["mode"])) as metacluster: cluster = driver.Cluster(metacluster) print "Starting cluster..." - num_nodes = 1 + num_nodes = 2 files = [driver.Files(metacluster, db_path = "db-%d" % i, log_path = "create-output-%d" % i) for i in xrange(num_nodes)] processes = [driver.Process(cluster, files[i], log_path = "serve-output-%d" % i)
Test with 2 nodes, not just 1.
rethinkdb_rethinkdb
train
py
8d0830a9eb8ed8af5ecd54d78610df88b0cd5764
diff --git a/go/cmd/vt_binlog_server/vt_binlog_server.go b/go/cmd/vt_binlog_server/vt_binlog_server.go index <HASH>..<HASH> 100644 --- a/go/cmd/vt_binlog_server/vt_binlog_server.go +++ b/go/cmd/vt_binlog_server/vt_binlog_server.go @@ -431,7 +431,9 @@ func (blp *Blp) parseXid(line []byte) { func (blp *Blp) parseGroupId(line []byte) { rem := bytes.SplitN(line, mysqlctl.BINLOG_GROUP_ID, 2) - groupId, err := strconv.ParseUint(string(rem[1]), 10, 64) + rem2 := bytes.SplitN(rem[1], mysqlctl.SPACE, 2) + groupIdStr := strings.TrimSpace(string(rem2[0])) + groupId, err := strconv.ParseUint(groupIdStr, 10, 64) if err != nil { panic(NewBinlogParseError(fmt.Sprintf("Error in extracting group_id %v, sql %v", err, string(line)))) }
Fixed group_id parsing.
vitessio_vitess
train
go
f8ed5f7d289f98fd1dbc86366cb63bc5329b8a72
diff --git a/driver/src/main/java/org/kaazing/k3po/driver/internal/netty/bootstrap/http/HttpBootstrapFactorySpi.java b/driver/src/main/java/org/kaazing/k3po/driver/internal/netty/bootstrap/http/HttpBootstrapFactorySpi.java index <HASH>..<HASH> 100644 --- a/driver/src/main/java/org/kaazing/k3po/driver/internal/netty/bootstrap/http/HttpBootstrapFactorySpi.java +++ b/driver/src/main/java/org/kaazing/k3po/driver/internal/netty/bootstrap/http/HttpBootstrapFactorySpi.java @@ -70,11 +70,11 @@ public class HttpBootstrapFactorySpi extends BootstrapFactorySpi { @Override public void shutdown() { - serverChannelFactory.shutdown(); + // ignore, no external resources to shutdown as it always runs on top of another transport (tcp) } @Override public void releaseExternalResources() { - serverChannelFactory.releaseExternalResources(); + // ignore, no external resources to shutdown as it always runs on top of another transport (tcp) } }
ignored calls to shutdown and releaseExternalResources as it has no physical assets to release or shutdown at its transport layer
k3po_k3po
train
java
f1e14ba73befba45d26977bede58811bac4a56c6
diff --git a/pupa/tests/importers/test_event_importer.py b/pupa/tests/importers/test_event_importer.py index <HASH>..<HASH> 100644 --- a/pupa/tests/importers/test_event_importer.py +++ b/pupa/tests/importers/test_event_importer.py @@ -138,11 +138,15 @@ def test_bad_event_time(): @pytest.mark.django_db def test_top_level_media_event(): j = Jurisdiction.objects.create(id='jid', division_id='did') - event = ge() - event.add_media_link( - "fireworks", - "http://example.com/fireworks.mov", - media_type='application/octet-stream' - ) - obj, what = EventImporter('jid').import_item(event.as_dict()) + event1, event2 = ge(), ge() + + event1.add_media_link("fireworks", "http://example.com/fireworks.mov", + media_type='application/octet-stream') + event2.add_media_link("fireworks", "http://example.com/fireworks.mov", + media_type='application/octet-stream') + + obj, what = EventImporter('jid').import_item(event1.as_dict()) assert what == 'insert' + + obj, what = EventImporter('jid').import_item(event2.as_dict()) + assert what == 'noop'
Fix media test to check for dupes
opencivicdata_pupa
train
py
cb0007e275dff28cc63398827c58388820dce56e
diff --git a/lib/em-http-server/response.rb b/lib/em-http-server/response.rb index <HASH>..<HASH> 100644 --- a/lib/em-http-server/response.rb +++ b/lib/em-http-server/response.rb @@ -53,6 +53,7 @@ module EventMachine def initialize @headers = {} + @keep_connection_open = false end def keep_connection_open arg=true
remove warning for uninitialized var (issue #5)
alor_em-http-server
train
rb
f7c2ee80ae6fc9533548934da16865624aac5486
diff --git a/risklib/api.py b/risklib/api.py index <HASH>..<HASH> 100644 --- a/risklib/api.py +++ b/risklib/api.py @@ -264,7 +264,7 @@ class ProbabilisticEventBased(object): def aggregate_losses(set_of_outputs, result=None): for asset_output in set_of_outputs: if result is None: # first time - result = asset_output.losses[:] # take a copy + result = numpy.copy(asset_output.losses) else: result += asset_output.losses # mutate the copy return result
Really fixed the mutation issue in aggregate_losses
gem_oq-engine
train
py
ccb51aee69050e18c2a942c6303a53fe092bb9d7
diff --git a/src/OverlayTrigger.js b/src/OverlayTrigger.js index <HASH>..<HASH> 100644 --- a/src/OverlayTrigger.js +++ b/src/OverlayTrigger.js @@ -31,7 +31,7 @@ class OverlayTrigger extends Overlay { showOverlay (e) { e.preventDefault(); - $(`#${this.overlayID}`).modal(this.props.modalOptions).modal('open'); + $(`#${this.overlayID}`).modal('open', this.props.modalOptions); } }
Update OverlayTrigger.js (#<I>) Modal options only work if the command is sent in with the options.
react-materialize_react-materialize
train
js
6cd7184a6765e010beb3012fe8686d4f4407dfcf
diff --git a/src/Responder/View.php b/src/Responder/View.php index <HASH>..<HASH> 100644 --- a/src/Responder/View.php +++ b/src/Responder/View.php @@ -136,14 +136,15 @@ class View extends AbstractWithViewData public function asFileContents($file_loc, $mime) { if (is_string($file_loc)) { - $stream = fopen($file_loc, 'rb'); + $contents = file_get_contents($file_loc); } elseif (is_resource($file_loc)) { - $stream = $file_loc; + rewind($file_loc); + $contents = stream_get_contents($file_loc); } else { throw new \InvalidArgumentException; } - return $this->asResponse($stream, self::OK, ['Content-Type' => $mime]); + return $this->asResponse($contents, self::OK, ['Content-Type' => $mime]); } /**
convert $file_loc into string as response's body.
TuumPHP_Respond
train
php
dffcf7404be8c217c40388e2a52054eb608fb152
diff --git a/inginious/common/custom_yaml.py b/inginious/common/custom_yaml.py index <HASH>..<HASH> 100644 --- a/inginious/common/custom_yaml.py +++ b/inginious/common/custom_yaml.py @@ -21,7 +21,11 @@ from collections import OrderedDict import yaml as original_yaml - +try: + from yaml import CSafeLoader as SafeLoader + from yaml import CSafeDumper as SafeDumper +except ImportError: + from yaml import SafeLoader, SafeDumper def load(stream): """ @@ -32,7 +36,7 @@ def load(stream): Safe version. """ - class OrderedLoader(original_yaml.SafeLoader): + class OrderedLoader(SafeLoader): pass def construct_mapping(loader, node): @@ -59,7 +63,7 @@ def dump(data, stream=None, **kwds): """ # Display OrderedDicts correctly - class OrderedDumper(original_yaml.SafeDumper): + class OrderedDumper(SafeDumper): pass def _dict_representer(dumper, data):
Improve the speed of the YAML dumper/loader ...when LibYAML is installed on the system. This hopefully fixes the problems with very long generation times of submissions archives. (from 1h+ to less than a minute...) TODO: update the doc to incite to install libyaml.
UCL-INGI_INGInious
train
py
d956efc4e07372fd6e9c9061f770e786a6eb9bad
diff --git a/CrashReport/src/org/acra/HttpUtils.java b/CrashReport/src/org/acra/HttpUtils.java index <HASH>..<HASH> 100644 --- a/CrashReport/src/org/acra/HttpUtils.java +++ b/CrashReport/src/org/acra/HttpUtils.java @@ -95,8 +95,12 @@ class HttpUtils { .getInputStream())); String line; + int linecount = 0; while ((line = rd.readLine()) != null) { - Log.d(LOG_TAG, line); + linecount++; + if(linecount <= 2) { + Log.d(LOG_TAG, line); + } } rd.close(); }
Log only the 2 first lines of the response.
ACRA_acra
train
java
bdf98672ba9a8aba41c1abe71b8e690c21a2be56
diff --git a/generator/classes/propel/engine/builder/sql/pgsql/PgsqlDataSQLBuilder.php b/generator/classes/propel/engine/builder/sql/pgsql/PgsqlDataSQLBuilder.php index <HASH>..<HASH> 100644 --- a/generator/classes/propel/engine/builder/sql/pgsql/PgsqlDataSQLBuilder.php +++ b/generator/classes/propel/engine/builder/sql/pgsql/PgsqlDataSQLBuilder.php @@ -37,6 +37,9 @@ class PgsqlDataSQLBuilder extends DataSQLBuilder { */ protected function getBooleanSql($value) { + if ($value === 'f' || $value === 'false' || $value === "0") { + $value = false; + } return ($value ? "'t'" : "'f'"); }
ticket:<I> - Fix to Postgres generated SQL for BOOLEAN columns.
propelorm_Propel
train
php
6d60c23460b51458839b1f88f83a355e1db2e51d
diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/HttpMessageConvertersAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/HttpMessageConvertersAutoConfiguration.java index <HASH>..<HASH> 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/HttpMessageConvertersAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/HttpMessageConvertersAutoConfiguration.java @@ -144,7 +144,9 @@ public class HttpMessageConvertersAutoConfiguration { @Bean @ConditionalOnMissingBean public StringHttpMessageConverter stringHttpMessageConverter() { - return new StringHttpMessageConverter(this.encodingProperties.getCharset()); + StringHttpMessageConverter converter = new StringHttpMessageConverter(this.encodingProperties.getCharset()); + converter.setWriteAcceptCharset(false); + return converter; } }
Disable Accept-Charset Header in String converter This commit prevents the `Accept-Charset` from being written by the StringHttpMessageConverter. This feature is enabled by default in the framework and writes a *quite long* response header with all charsets supported by the server. Closes gh-<I>, see gh-<I>
spring-projects_spring-boot
train
java
997eecdeb15cb63fc56941b2a1ffe035db56719d
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 @@ -179,14 +179,18 @@ class ControllingPlan { throw new ControllingPlanException('No filter controller to execute.'); } - return $this->executeFilter($nextFilter, $try); + if ($nextFilter->execute()) return true; + + if ($try) return false; + + throw new PageNotFoundException(); } public function executeToMain() { $this->ensureFilterable(); while (null !== ($nextFilter = $this->nextFilter())) { - $this->executeFilter($nextFilter, false); + $nextFilter->execute(); } $this->status = self::STATUS_MAIN;
executeToMain not found exceptions
n2n_n2n-web
train
php
8f4ce8e6898a58d5899700dd5da0d042c6276033
diff --git a/ethtool.go b/ethtool.go index <HASH>..<HASH> 100644 --- a/ethtool.go +++ b/ethtool.go @@ -54,7 +54,7 @@ const ( // MAX_GSTRINGS maximum number of stats entries that ethtool can // retrieve currently. const ( - MAX_GSTRINGS = 100 + MAX_GSTRINGS = 200 ) type ifreq struct {
raised the limit for MAX_GSTRINGS size by <I> percent Was working with solarflare cards and they returned a lot more stats than the old value could handle.
safchain_ethtool
train
go
03e58a28e15de6ef0841de0367daf657cd12617b
diff --git a/src/main/java/com/threerings/crowd/chat/client/MuteDirector.java b/src/main/java/com/threerings/crowd/chat/client/MuteDirector.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/threerings/crowd/chat/client/MuteDirector.java +++ b/src/main/java/com/threerings/crowd/chat/client/MuteDirector.java @@ -82,6 +82,7 @@ public class MuteDirector extends BasicDirector _chatdir.removeChatFilter(this); _chatdir = null; } + _ctx.getClient().removeClientObserver(this); } /**
We register as a client observer when we start up; we need to remove ourselves when we shut down. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1
threerings_narya
train
java
362594f2e4b9cb808870bce2c87012f2ecbf774d
diff --git a/admin/cron.php b/admin/cron.php index <HASH>..<HASH> 100644 --- a/admin/cron.php +++ b/admin/cron.php @@ -430,7 +430,7 @@ if (!empty($CFG->enablestats) and empty($CFG->disablestatsprocessing)) { // check we're not before our runtime - $timetocheck = strtotime("$CFG->statsruntimestarthour:$CFG->statsruntimestartminute today"); + $timetocheck = strtotime("today $CFG->statsruntimestarthour:$CFG->statsruntimestartminute"); if (time() > $timetocheck) { $time = 60*60*20; // set it to 20 here for first run... (overridden by $CFG)
MDL-<I> - stats wasn't paying attention to run time settings as the strtotime arguments were the wrong way round. Thanks to Mark Nielsen
moodle_moodle
train
php
5e1868925b1b7b8eb539cc7f83185cc64acec4a1
diff --git a/src/leaflet-panel-layers.js b/src/leaflet-panel-layers.js index <HASH>..<HASH> 100644 --- a/src/leaflet-panel-layers.js +++ b/src/leaflet-panel-layers.js @@ -19,6 +19,7 @@ L.Control.PanelLayers = L.Control.Layers.extend({ options: { compact: false, + compactOffset: 0, collapsed: false, autoZIndex: true, collapsibleGroups: false, @@ -402,7 +403,7 @@ L.Control.PanelLayers = L.Control.Layers.extend({ h = h || this._map.getSize().y; if (this.options.compact) - this._form.style.maxHeight = h + 'px'; + this._form.style.maxHeight = (h - this.options.compactOffset) + 'px'; else this._form.style.height = h + 'px'; },
Added offset from top of the box
stefanocudini_leaflet-panel-layers
train
js
9acc8a22b3ad5ce565e28dbb246204db54e36f14
diff --git a/target.go b/target.go index <HASH>..<HASH> 100644 --- a/target.go +++ b/target.go @@ -249,6 +249,8 @@ func (t *Target) pageEvent(ev interface{}) { return case *page.EventDownloadWillBegin: return + case *page.EventDownloadProgress: + return default: t.errf("unhandled page event %T", ev)
don't error on downloadProgress events These seem fairly recent, so explicitly ignore them, just like we do with downloadWillBegin.
chromedp_chromedp
train
go
1188d0a67d18430d5c1a11f8dcdc135852fc1e31
diff --git a/src/WebSocket.php b/src/WebSocket.php index <HASH>..<HASH> 100644 --- a/src/WebSocket.php +++ b/src/WebSocket.php @@ -39,7 +39,15 @@ class WebSocket extends \Swlib\Http\Request if ($mock) { $this->withMock($ssl); } - $ret = $this->client->upgrade($uri->getPath() ?: '/'); + + parse_str($this->uri->getQuery(), $query); + $query = $this->getQueryParams() + $query; //attribute value first + $query = http_build_query($query); + + $path = $this->uri->getPath() ?: '/'; + $path = empty($query) ? $path : $path . '?' . $query; + + $ret = $this->client->upgrade($path); if (!$ret) { throw new ConnectException( $this, $this->client->errCode,
Support query in Websocket client.
swlib_saber
train
php
1ee83b18fd226c4b34cb859197a4cf84fbb4aefa
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -21,7 +21,7 @@ var concatStream = require('concat-stream'); function maybeNewExecError(name, args, stderr, code, existingError) { // Returns a new error if all the necessary information is available - if (typeof stderr === 'string' && typeof code === 'number') { + if (typeof stderr === 'string' && typeof code === 'number' && code !== 0) { return new Error('Process `' + name + ' ' + args.join(' ') + '` exited with non-zero exit code ' + code + '; stderr is:\n' + stderr); } else { return undefined; @@ -85,9 +85,7 @@ module.exports = function smartSpawn(name, args, targetCwd, callback) { exitCode = code; - if (code !== 0) { - callbackErr = callbackErr instanceof Error ? callbackErr : maybeNewExecError(name, args, stderr, exitCode, callbackErr); - } + callbackErr = callbackErr instanceof Error ? callbackErr : maybeNewExecError(name, args, stderr, exitCode, callbackErr); wantCallback = true; maybeFireCallback();
Fix an error sometimes being returned upon success
strugee_node-smart-spawn
train
js
c31962b88e7c3367bdb752330dad2a9a4e7355d1
diff --git a/examples/bench/bench.py b/examples/bench/bench.py index <HASH>..<HASH> 100644 --- a/examples/bench/bench.py +++ b/examples/bench/bench.py @@ -27,9 +27,9 @@ class EchoConnection(SockJSConnection): self.clients.remove(self) @classmethod - def dump_stats(self): + def dump_stats(cls): # Print current client count - print 'Clients: %d' % (len(self.clients)) + print 'Clients: %d' % (len(cls.clients)) if __name__ == '__main__': options = dict()
Pedantic fix, 1st arg to classmethod is cls
mrjoes_sockjs-tornado
train
py
1300e18260da0d541d746370cec1f36be12eb013
diff --git a/lib/grasshopper.js b/lib/grasshopper.js index <HASH>..<HASH> 100644 --- a/lib/grasshopper.js +++ b/lib/grasshopper.js @@ -7,6 +7,11 @@ module.exports = (function(){ q = require('q'); /** + * Expose the events that are taking place in grasshopper core. + */ + grasshopper.event = require('./event'); + + /** * Expose the available roles in the system. */ grasshopper.roles = require('./security/roles');
Exposed the event modules through the grasshopper library.
grasshopper-cms_grasshopper-core-nodejs
train
js
a62a18bbbb66b557625a10f901d7df391ec8d8c8
diff --git a/syntax/printer_test.go b/syntax/printer_test.go index <HASH>..<HASH> 100644 --- a/syntax/printer_test.go +++ b/syntax/printer_test.go @@ -256,6 +256,7 @@ func TestFprintWeirdFormat(t *testing.T) { "{\n\tfoo\n\t#a\n} |\n# misplaced\nbar", "# misplaced\n{\n\tfoo\n\t#a\n} \\\n\t| bar", }, + samePrint("foo | bar\n#after"), { "{\nfoo &&\n#a1\n#a2\n$(bar)\n}", "{\n\t#a1\n\t#a2\n\tfoo \\\n\t\t&& $(bar)\n}",
syntax: full test coverage for printer.go again
mvdan_sh
train
go
2839110615bc35bf5c08176560d1acec69c804ae
diff --git a/examples/demo/src/layout/Login.js b/examples/demo/src/layout/Login.js index <HASH>..<HASH> 100644 --- a/examples/demo/src/layout/Login.js +++ b/examples/demo/src/layout/Login.js @@ -79,9 +79,8 @@ const Login = ({ location }) => { const handleSubmit = auth => { setLoading(true); - login(auth, location.state ? location.state.nextPathname : '/') - .then(() => setLoading(false)) - .catch(error => { + login(auth, location.state ? location.state.nextPathname : '/').catch( + error => { setLoading(false); notify( typeof error === 'string' @@ -91,7 +90,8 @@ const Login = ({ location }) => { : error.message, 'warning' ); - }); + } + ); }; const validate = values => {
Fix warning about unmounted component after Login on Demo
marmelab_react-admin
train
js
37ba7aea44f9b219665d6235b6afe4b55052e853
diff --git a/src/utils/services/call.js b/src/utils/services/call.js index <HASH>..<HASH> 100644 --- a/src/utils/services/call.js +++ b/src/utils/services/call.js @@ -17,8 +17,8 @@ export default function callService (methodName, params, options) { // API params = params || {} options = options || {} - var secretApiKey = options.secretApiKey - var publishableApiKey = options.publishableApiKey + var secretApiKey = options.secretApiKey || configs.secretApiKey + var publishableApiKey = options.publishableApiKey || configs.publishableApiKey // try cache // var cacheKey
Get API keys from configs if not provided in options
archilogic-com_3dio-js
train
js
634207b5e1e411e5737e3995c83ebfc98bed0993
diff --git a/mpdf.php b/mpdf.php index <HASH>..<HASH> 100644 --- a/mpdf.php +++ b/mpdf.php @@ -88,14 +88,6 @@ if (!defined('_MPDF_TTFONTDATAPATH')) { $errorlevel = error_reporting(); $errorlevel = error_reporting($errorlevel & ~E_NOTICE); -//error_reporting(E_ALL); - -if (function_exists("date_default_timezone_set")) { - if (ini_get("date.timezone") == "") { - date_default_timezone_set("Europe/London"); - } -} - if (!function_exists('mb_strlen')) { throw new MpdfException('mPDF requires mb_string functions. Ensure that mb_string extension is loaded.'); }
Do not alter timezone even if not set
mpdf_mpdf
train
php
4eaa008aec69fde7f48def68e115c3926bef7497
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/RecordController.php b/lib/Alchemy/Phrasea/Controller/Prod/RecordController.php index <HASH>..<HASH> 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/RecordController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/RecordController.php @@ -86,6 +86,7 @@ class RecordController extends Controller // get field's values $recordCaptions[$field->get_name()] = $field->get_serialized_values(); } + $recordCaptions["technicalInfo"] = $record->getPositionFromTechnicalInfos(); return $this->app->json([ "desc" => $this->render('prod/preview/caption.html.twig', [ diff --git a/lib/classes/record/adapter.php b/lib/classes/record/adapter.php index <HASH>..<HASH> 100644 --- a/lib/classes/record/adapter.php +++ b/lib/classes/record/adapter.php @@ -781,7 +781,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface ]; } - return ['isCoordComplete' => 0, 'latitude' => 0, 'longitude' => 0]; + return ['isCoordComplete' => 0, 'latitude' => 'false', 'longitude' => 'false']; } /**
add technicalInfo in record of detail view
alchemy-fr_Phraseanet
train
php,php
7e53b69a2895a81646dc959142b65266294de67a
diff --git a/lib/david/transmission.rb b/lib/david/transmission.rb index <HASH>..<HASH> 100644 --- a/lib/david/transmission.rb +++ b/lib/david/transmission.rb @@ -31,12 +31,17 @@ module David end def normalize_host(host) - ip = IPAddr.new(Resolv.getaddress(host)) + ip = IPAddr.new(host) if ipv6? && ip.ipv4? ip = ip.ipv4_mapped end - rescue Resolv::ResolvError + rescue ArgumentError + begin + host = Resolv.getaddress(host) + retry + rescue Resolv::ResolvError + end else ip.to_s end
Resolve on send only if no IP address.
nning_david
train
rb
43fec9318266506bd4cd0a59bf032ee42996d2c7
diff --git a/src/App.php b/src/App.php index <HASH>..<HASH> 100644 --- a/src/App.php +++ b/src/App.php @@ -16,7 +16,7 @@ class App // @var array|false Location where to load JS/CSS files public $cdn = [ - 'atk' => 'https://cdn.rawgit.com/atk4/ui/1.2.3/public', + 'atk' => 'https://cdn.rawgit.com/atk4/ui/1.3.0/public', 'jquery' => 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1', 'serialize-object' => 'https://cdnjs.cloudflare.com/ajax/libs/jquery-serialize-object/2.5.0', 'semantic-ui' => 'https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.10', @@ -24,7 +24,7 @@ class App ]; // @var string Version of Agile UI - public $version = '1.2.3'; + public $version = '1.3.0'; // @var string Name of application public $title = 'Agile UI - Untitled Application';
Updated CDN and $version in App.php to <I>
atk4_ui
train
php
b1a7bedc88a4d055befe73343117a52c551bceb3
diff --git a/grunt_tasks/webpack.config.js b/grunt_tasks/webpack.config.js index <HASH>..<HASH> 100644 --- a/grunt_tasks/webpack.config.js +++ b/grunt_tasks/webpack.config.js @@ -190,7 +190,6 @@ module.exports = { alias: { 'girder': paths.web_src }, - extensions: ['.styl', '.css', '.pug', '.jade', '.js', ''], modules: [ paths.clients_web, paths.plugins,
Remove resolve.extensions option from webpack config
girder_girder
train
js
c4aac6c2644f474d5da48e8d2a560653852e00d9
diff --git a/evaluation/evaluate.py b/evaluation/evaluate.py index <HASH>..<HASH> 100644 --- a/evaluation/evaluate.py +++ b/evaluation/evaluate.py @@ -18,25 +18,26 @@ parser.add_argument("-d", "--dataset", help="specify which dataset to use.") parser.add_argument("-b", "--baseline", action="store_true", help="calculates the baselines scores.") args = parser.parse_args() -# Calculate all rouge scores by default. -if args.text_numbers: - text_numbers = [int(x) for x in args.text_numbers] -else: - text_numbers = xrange(1, 25) # Will stop working soon, FIXME - # Use elhadad dataset by default. if args.dataset: dataset = args.dataset else: dataset = 'elhadad' +dataset_path = os.path.join('datasets', dataset) + +# Calculate all rouge scores by default. +if args.text_numbers: + text_numbers = [int(n) for n in args.text_numbers] +else: + text_numbers = sorted(int(n) for n in os.listdir(dataset_path) if os.path.isdir(os.path.join(dataset_path, n))) + # Don't calculate baseline method by default. if args.baseline: method = baseline else: method = textrank - calculator = RougeCalculator(dataset, text_numbers, method) results = calculator.get_rouge_scores() export_results(dataset, results)
Adding support to summarize all files in a dataset directory.
summanlp_textrank
train
py
ecf2f0ce207ca553db7c08179deff48b87bd63b8
diff --git a/src/Task/DeployTasks.php b/src/Task/DeployTasks.php index <HASH>..<HASH> 100644 --- a/src/Task/DeployTasks.php +++ b/src/Task/DeployTasks.php @@ -4,7 +4,7 @@ namespace Droath\ProjectX\Task; use Droath\ProjectX\Project\NullProjectType; use Droath\ProjectX\ProjectX; -use Droath\RoboGitHub\Task\loadTasks as githubTasks; +use Droath\RoboGitHub\Task\loadTasks; use Robo\Contract\TaskInterface; use Robo\Contract\VerbosityThresholdInterface; use Robo\Task\Filesystem\loadTasks as filesystemTasks; @@ -16,7 +16,7 @@ use Symfony\Component\Console\Question\Question; */ class DeployTasks extends TaskBase { - use githubTasks; + use loadTasks; use filesystemTasks; /**
#<I> Update name space to preserve compatibility with php<I>
droath_project-x
train
php
0ac71fdc9d4c94cc39074489d3ab09448981ebcf
diff --git a/src/main/java/org/jamesframework/core/search/SearchListener.java b/src/main/java/org/jamesframework/core/search/SearchListener.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jamesframework/core/search/SearchListener.java +++ b/src/main/java/org/jamesframework/core/search/SearchListener.java @@ -18,7 +18,7 @@ import org.jamesframework.core.problems.solutions.Solution; /** * Interface of a listener which may be attached to any search with the specified solution type (or a more specific solution type). - * It will be informed when the search has started, stopped, found a new best solution, or fired a search messages. + * It will be informed when the search has started, stopped, found a new best solution, completed a step or fired a search message. * * @param <SolutionType> solution type of the search to which the listener may be attached, required to extend {@link Solution} * @author Herman De Beukelaer <herman.debeukelaer@ugent.be> @@ -55,5 +55,13 @@ public interface SearchListener<SolutionType extends Solution> { * @param newBestSolutionEvaluation evaluation of the new best solution */ public void newBestSolution(Search<? extends SolutionType> search, SolutionType newBestSolution, double newBestSolutionEvaluation); + + /** + * Called when the search has completed a step. + * + * @param search search which has completed a step + * @param numSteps number of steps completed so far + */ + public void stepCompleted(Search<? extends SolutionType> search, long numSteps); }
added stepCompleted callback to search listener
hdbeukel_james-core
train
java
0566e7b99ba90ecd1da16b81dfbf7a5bb201edbf
diff --git a/src/Sylius/Bundle/CoreBundle/EventListener/OrderPaymentListener.php b/src/Sylius/Bundle/CoreBundle/EventListener/OrderPaymentListener.php index <HASH>..<HASH> 100644 --- a/src/Sylius/Bundle/CoreBundle/EventListener/OrderPaymentListener.php +++ b/src/Sylius/Bundle/CoreBundle/EventListener/OrderPaymentListener.php @@ -71,6 +71,8 @@ class OrderPaymentListener { if (false === $this->getOrder($event)->getLastPayment()) { $this->paymentProcessor->createPayment($this->getOrder($event)); + } else { + $this->getOrder($event)->getLastPayment()->setDetails(array()); } }
Fixed bug in payment flow I noticed that if you are using CreditCard for payment and if you change your mind on page where you need to enter your credit card, jump back to payment methods and pick something else for example offline that there is bug and you cannot complete payment. This PR fix it
Sylius_Sylius
train
php
868966cd9dbb96ce3635d884e67e738b18658140
diff --git a/sos/archive.py b/sos/archive.py index <HASH>..<HASH> 100644 --- a/sos/archive.py +++ b/sos/archive.py @@ -421,7 +421,7 @@ class FileCacheArchive(Archive): (source, link_name, dest)) source_dir = os.path.dirname(link_name) - host_path_name = os.path.normpath(os.path.join(source_dir, source)) + host_path_name = os.path.realpath(os.path.join(source_dir, source)) dest_path_name = self.dest_path(host_path_name) if not os.path.exists(dest_path_name):
[archive] canonicalise paths for link follow up Ensure that the canonical path is used when processing link follow up actions: the actual link path may contain one or more levels of symbolic links, leading to broken links if the link target path is assumed to be relative to the containing directory.
sosreport_sos
train
py
19824345e2139ed22804da6ddcea97486fb90412
diff --git a/lib/Parser.js b/lib/Parser.js index <HASH>..<HASH> 100644 --- a/lib/Parser.js +++ b/lib/Parser.js @@ -533,7 +533,7 @@ Parser.prototype.execute = function(b, start, end) { uint32 data_type_code string data */ - this.emit('CHANNEL_DATA:' + payload.readUInt32BE(1, true), + this.emit('CHANNEL_EXTENDED_DATA:' + payload.readUInt32BE(1, true), payload.readUInt32BE(5, true), readString(payload, 9)); break;
parser: fix CHANNEL_EXTENDED_DATA event
mscdex_ssh2
train
js
3dae667d8fd6e959a80d8b6ba825f7b82a36d251
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -390,6 +390,14 @@ module ActionView # # hidden_field(:user, :token) # # => <input type="hidden" id="user_token" name="user[token]" value="#{@user.token}" /> + # + # If you have a form object f that is using an object @client: + # <%= f.hidden_field :user_id, :value => current_user.id %> + # # => <input id="client_user_id" name="client[user_id]" type="hidden" value="12345" /> + # + # This passes a hidden variable user_id with the value of current_user.id, it can be accessed in the controller as: + # params[:client][:user_id] + def hidden_field(object_name, method, options = {}) InstanceTag.new(object_name, method, self, options.delete(:object)).to_input_field_tag("hidden", options) end
Simple example added for using hidden_field tag used in a form
rails_rails
train
rb
154b7507448448de903f3d28423bb7438e89c540
diff --git a/packages/basic-component-mixins/KeyboardDirection.js b/packages/basic-component-mixins/KeyboardDirection.js index <HASH>..<HASH> 100644 --- a/packages/basic-component-mixins/KeyboardDirection.js +++ b/packages/basic-component-mixins/KeyboardDirection.js @@ -30,6 +30,8 @@ export default (base) => class KeyboardDirection extends base { keydown(event) { let handled; + // Ignore Left/Right keys when metaKey or altKey modifier is also pressed, + // as the user may be trying to navigate back or forward in the browser. switch (event.keyCode) { case 35: // End handled = this.goEnd(); @@ -38,13 +40,17 @@ export default (base) => class KeyboardDirection extends base { handled = this.goStart(); break; case 37: // Left - handled = this.goLeft(); + if (!event.metaKey && !event.altKey) { + handled = this.goLeft(); + } break; case 38: // Up handled = event.altKey ? this.goStart() : this.goUp(); break; case 39: // Right - handled = this.goRight(); + if (!event.metaKey && !event.altKey) { + handled = this.goRight(); + } break; case 40: // Down handled = event.altKey ? this.goEnd() : this.goDown();
Ignore Left/Right key events if meta or alt key is also pressed; user may be trying to navigate Back/Forward in browser.
basic-web-components_basic-web-components
train
js
1717e88cfb4b75afb5d282263cbd71e214f408cd
diff --git a/json-engine.js b/json-engine.js index <HASH>..<HASH> 100644 --- a/json-engine.js +++ b/json-engine.js @@ -33,7 +33,7 @@ module.exports = function (file, engineOptions) { // Handle id increment function getNextId() { var dataIds = Object.keys(idIndexData) - + dataIds.sort(function (a, b) { return b - a }) @@ -137,6 +137,11 @@ module.exports = function (file, engineOptions) { var updateData = overwrite ? updateObject : _.extend(idIndexData[id], updateObject) idIndexData[id] = updateData + // update our data + var find = {} + find[options.idProperty] = id + data.splice(_.findIndex(data, find), 1, updateData); + saveFile('afterUpdate', updateData, callback) } @@ -215,7 +220,7 @@ module.exports = function (file, engineOptions) { function count(query, callback) { self.emit('count', query) - + self.find(query, function (error, objects) { callback(null, objects ? objects.length : 0) })
Update function will modify the file on filesystem
confuser_save-json
train
js
4d85b3a1dddf499b7277066e9bac9d7206429ac5
diff --git a/auth/jwt.go b/auth/jwt.go index <HASH>..<HASH> 100644 --- a/auth/jwt.go +++ b/auth/jwt.go @@ -144,7 +144,13 @@ func TokenGenerator(h http.Handler, auth Authenticator, secret []byte, opts ...T o.apply(opts) return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if err := r.ParseForm(); err != nil { + var err error + if strings.HasPrefix(r.Header.Get("Content-Type"), "multipart/form-data") { + err = r.ParseMultipartForm(0) + } else { + err = r.ParseForm() + } + if err != nil { o.logger.Print("Invalid request form: ", err) http.Error(w, err.Error(), http.StatusBadRequest) @@ -152,7 +158,8 @@ func TokenGenerator(h http.Handler, auth Authenticator, secret []byte, opts ...T } user := r.FormValue(o.user) - if !auth.Authenticate(user, r.FormValue(o.password)) { + password := r.FormValue(o.password) + if user == "" || password == "" || !auth.Authenticate(user, password) { w.WriteHeader(http.StatusUnauthorized) return }
Handle multipart forms as well as regular ones.
urandom_handler
train
go
9b9ca4a66559d833a84541e2606cfa05c7440583
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '1.1a1' +version = '1.1a2' LONG_DESCRIPTION = """ Using django-avatar
Bumped to <I>a2.
GeoNode_geonode-avatar
train
py
8457c31b928abd50014efc473eea50db1fc62386
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ setup( download_url='https://github.com/tomduck/pandoc-tablenos/tarball/' + \ __version__, - install_requires=['pandoc-xnos >= 2.1.2, < 3.0'], + install_requires=['pandoc-xnos >= 2.4.0, < 3.0'], py_modules=['pandoc_tablenos'], entry_points={'console_scripts':['pandoc-tablenos = pandoc_tablenos:main']},
Bumped pandoc-xnos requirement.
tomduck_pandoc-tablenos
train
py
87ea3a4ffb9e910c16f1c48444cad41be1dc6a3d
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py index <HASH>..<HASH> 100644 --- a/alot/commands/envelope.py +++ b/alot/commands/envelope.py @@ -239,7 +239,14 @@ class EditCommand(Command): value = re.sub('[ \t\r\f\v]*\n[ \t\r\f\v]*', ' ', value) headertext += '%s: %s\n' % (key, value) + # determine editable content bodytext = self.envelope.body + if headertext: + content = '%s\n%s' % (headertext, bodytext) + self.edit_only_body = False + else: + content = bodytext + self.edit_only_body = True # call pre-edit translate hook translate = settings.get_hook('pre_edit_translate') @@ -248,11 +255,6 @@ class EditCommand(Command): #write stuff to tempfile tf = tempfile.NamedTemporaryFile(delete=False, prefix='alot.') - content = bodytext - if headertext: - content = '%s\n%s' % (headertext, content) - else: - self.edit_only_body = True tf.write(content.encode('utf-8')) tf.flush() tf.close()
determine editable content before pre-edit-hook this moves the construction of the tempfile content and edit_only_body flag before the call to the pre-translate-hook. Also make the setter more explicit, code readability.
pazz_alot
train
py
0426ccbffc2c1c31b227959e390447ebee7b73b4
diff --git a/devices/philips.js b/devices/philips.js index <HASH>..<HASH> 100644 --- a/devices/philips.js +++ b/devices/philips.js @@ -1628,6 +1628,15 @@ module.exports = [ ota: ota.zigbeeOTA, }, { + zigbeeModel: ['1742830P7'], + model: '1742830P7', + vendor: 'Philips', + description: 'Hue Lily outdoor spot light', + meta: {turnsOffAtBrightness1: true}, + extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}), + ota: ota.zigbeeOTA, + }, + { zigbeeModel: ['1741530P7', '1741430P7'], model: '1741530P7', vendor: 'Philips',
Add <I>P7 (#<I>) added <I>P7, similar to device <I>P7, so copied <I>P7 over to <I>P7
Koenkk_zigbee-shepherd-converters
train
js
2fa6eb092363bf9f0cec7d81a2dbdaad67178623
diff --git a/src/Cache_Command.php b/src/Cache_Command.php index <HASH>..<HASH> 100644 --- a/src/Cache_Command.php +++ b/src/Cache_Command.php @@ -158,6 +158,7 @@ class Cache_Command extends WP_CLI_Command { } /** This filter is documented in wp-includes/class-wp-embed.php */ + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound if ( ! in_array( $post->post_type, apply_filters( 'embed_cache_oembed_types', $post_types ), true ) ) { WP_CLI::warning( sprintf( "Cannot cache oEmbed results for '%s' post type", $post->post_type ) ); diff --git a/src/Fetch_Command.php b/src/Fetch_Command.php index <HASH>..<HASH> 100644 --- a/src/Fetch_Command.php +++ b/src/Fetch_Command.php @@ -135,6 +135,7 @@ class Fetch_Command extends WP_CLI_Command { ); // Allow `wp_filter_pre_oembed_result()` to provide local URLs (WP >= 4.5.3). + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound $data = apply_filters( 'pre_oembed_result', null, $url, $oembed_args ); if ( null === $data ) {
PHPCS: ignore error about prefixing hook names
wp-cli_embed-command
train
php,php
63c5ab5656527b6bb0019879d1a48528ac5f4fbd
diff --git a/client/my-sites/controller.js b/client/my-sites/controller.js index <HASH>..<HASH> 100644 --- a/client/my-sites/controller.js +++ b/client/my-sites/controller.js @@ -116,8 +116,6 @@ function renderSelectedSiteIsDomainOnly( reactContext, selectedSite ) { const EmptyContentComponent = require( 'components/empty-content' ); const { store: reduxStore } = reactContext; - removeSidebar( reactContext ); - renderWithReduxStore( React.createElement( EmptyContentComponent, { title: i18n.translate( 'Add a site to start using this feature.' ), @@ -130,6 +128,12 @@ function renderSelectedSiteIsDomainOnly( reactContext, selectedSite ) { document.getElementById( 'primary' ), reduxStore ); + + renderWithReduxStore( + createNavigation( reactContext ), + document.getElementById( 'secondary' ), + reduxStore + ); } function isPathAllowedForDomainOnlySite( pathname, domainName ) {
My Sites: Bring back the sidebar for all My Sites pages for domain-only sites
Automattic_wp-calypso
train
js
b52b8b9a67d2c5f8b805de4d80eab6f9b420fe93
diff --git a/src/easy-autocomplete.js b/src/easy-autocomplete.js index <HASH>..<HASH> 100644 --- a/src/easy-autocomplete.js +++ b/src/easy-autocomplete.js @@ -30,6 +30,9 @@ function init(Survey, $) { obj.choicesByUrl.setData(value); } }); + Array.prototype.push.apply( + Survey.matrixDropdownColumnTypes.text.properties, + ["choices", "choicesOrder", "choicesByUrl", "otherText"]); }, afterRender: function(question, el) { var $el = $(el).is("input") ? $(el) : $(el).find("input");
Fix #<I> Easyautocomplete not working on MatrixDynamic questions
surveyjs_widgets
train
js
efd567005b2acd74785c7c60648fd5ff7ba58d4f
diff --git a/src/slider.js b/src/slider.js index <HASH>..<HASH> 100644 --- a/src/slider.js +++ b/src/slider.js @@ -624,7 +624,7 @@ function slider(orientation, scale) { } var toArray = Array.isArray(_) ? _ : [_]; - toArray.sort((a, b) => a - b); + toArray.sort(function (a, b) { return a - b; }); var pos = toArray.map(scale).map(identityClamped); var newValue = pos.map(scale.invert).map(alignedValue); @@ -644,7 +644,7 @@ function slider(orientation, scale) { } var toArray = Array.isArray(_) ? _ : [_]; - toArray.sort((a, b) => a - b); + toArray.sort(function (a, b) { return a - b; }); var pos = toArray.map(scale).map(identityClamped); var newValue = pos.map(scale.invert).map(alignedValue); @@ -665,7 +665,7 @@ function slider(orientation, scale) { var toArray = Array.isArray(_) ? _ : [_]; - toArray.sort((a, b) => a - b); + toArray.sort(function (a, b) { return a - b; }); defaultValue = toArray; value = toArray;
Changes to support IE <I> Thanks for creating this package, I find it very useful. This small changes gets my example working in an older version of Internet Explorer.
johnwalley_d3-simple-slider
train
js
48f6cf93b770cf531f84e00b5373d302842b10ab
diff --git a/spec/helper.rb b/spec/helper.rb index <HASH>..<HASH> 100644 --- a/spec/helper.rb +++ b/spec/helper.rb @@ -15,6 +15,12 @@ require 'congress' require 'rspec' require 'webmock/rspec' +RSpec.configure do |config| + config.expect_with :rspec do |c| + c.syntax = :expect + end +end + WebMock.disable_net_connect!(:allow => 'coveralls.io') def a_get(path)
Enforce use of expect syntax (no "should"s)
codeforamerica_congress
train
rb
8e7f6d0eb58bc8bcbb8f346260659dfc5c797a9b
diff --git a/rules-java/api/src/main/resources/reports/resources/js/windup-overview.js b/rules-java/api/src/main/resources/reports/resources/js/windup-overview.js index <HASH>..<HASH> 100644 --- a/rules-java/api/src/main/resources/reports/resources/js/windup-overview.js +++ b/rules-java/api/src/main/resources/reports/resources/js/windup-overview.js @@ -13,7 +13,6 @@ $(document).on('click', '.panel-heading', function(e){ expandSelected(this); } }) -$('#collapseAll').toggle(); function expandSelected(e) { var $this = $(e); @@ -49,6 +48,7 @@ function expandMemory(){ }); } + // function expandAll(){ $('.panel-body').slideDown(); @@ -68,4 +68,13 @@ function collapseAll(){ $('#collapseAll').toggle(); } -expandMemory(); \ No newline at end of file +expandMemory(); + +// show properly the Collapse/Expand All link +if ( $('.panel-heading').find('.glyphicon-chevron-up').length > 0) { + $('#collapseAll').toggle(); +} +else { + $('#expandAll').toggle(); +} +
WINDUP-<I> addition to the change to fix Expand/Collapse All links
windup_windup
train
js
e99f1cdc779814250f3fafe13c9dd5d788936b31
diff --git a/app/lib/actions/katello/repository/destroy.rb b/app/lib/actions/katello/repository/destroy.rb index <HASH>..<HASH> 100644 --- a/app/lib/actions/katello/repository/destroy.rb +++ b/app/lib/actions/katello/repository/destroy.rb @@ -18,17 +18,11 @@ module Actions end plan_action(ContentViewPuppetModule::Destroy, repository) if repository.puppet? - - pulp2_destroy_action = - sequence do - create_action = plan_action( - PulpSelector, + plan_action(PulpSelector, [Pulp::Repository::Destroy, Pulp3::Orchestration::Repository::Delete], repository, SmartProxy.pulp_master, repository_id: repository.id) - end - plan_self(:user_id => ::User.current.id) sequence do if repository.redhat?
Fixes #<I> - cleaned up rubocop warnings
Katello_katello
train
rb
66383456ae62516ac3c6e34d620d8bab1ac528dc
diff --git a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php +++ b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php @@ -31,7 +31,7 @@ use Webmozart\Assert\Assert; class Kernel extends HttpKernel { - public const VERSION = '1.7.0-DEV'; + public const VERSION = '1.7.0'; public const VERSION_ID = '10700'; @@ -41,7 +41,7 @@ class Kernel extends HttpKernel public const RELEASE_VERSION = '0'; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public function __construct(string $environment, bool $debug) {
Change application's version to <I>
Sylius_Sylius
train
php
568484ff4b117cd5b6119c92b903b518ab88ef4d
diff --git a/protokube/pkg/protokube/volume_mounter.go b/protokube/pkg/protokube/volume_mounter.go index <HASH>..<HASH> 100644 --- a/protokube/pkg/protokube/volume_mounter.go +++ b/protokube/pkg/protokube/volume_mounter.go @@ -119,11 +119,11 @@ func (k *VolumeMountController) safeFormatAndMount(volume *Volume, mountpoint st return fmt.Errorf("error building ns-enter object: %v", err) } - // When used with kubelet, rootDir is supposed to be /var/lib/kubelet - rootDir := "/" + // This is a directory that is mounted identically on the container and the host; we don't have that. + sharedDir := "/no-shared-directories" // Build mount & exec implementations that execute in the host namespaces - safeFormatAndMount.Interface = mount.NewNsenterMounter(rootDir, ne) + safeFormatAndMount.Interface = mount.NewNsenterMounter(sharedDir, ne) safeFormatAndMount.Exec = NewNsEnterExec() // Note that we don't use pathFor for operations going through safeFormatAndMount,
Fix nsenter mounter in protokube We don't have any shared directories, and certainly not root!
kubernetes_kops
train
go
c952ef1a880e271303bdcc7887b293fb5130eac6
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -57,7 +57,7 @@ setup( install_requires=[ 'six>=1.10.0', - 'graphene>=2.0,<3', + 'graphene>=2.0.1,<3', 'Django>=1.8.0', 'iso8601', 'singledispatch>=3.4.0.3',
Date Scalar only added in graphene <I>
graphql-python_graphene-django
train
py
68fccccefb58b1992b0377351cf447f95cd003d5
diff --git a/dbussy.py b/dbussy.py index <HASH>..<HASH> 100644 --- a/dbussy.py +++ b/dbussy.py @@ -3064,7 +3064,7 @@ class Connection : iface = DBUS.INTERFACE_MONITORING, method = "BecomeMonitor" ) - message.append_objects("asi", (list(format_rule(rule) for rule in rules)), 0) + message.append_objects("asu", (list(format_rule(rule) for rule in rules)), 0) self.send(message) #end become_monitor
correct signature for BecomeMonitor call
ldo_dbussy
train
py
996035397b19777fde4f1e34ccb18c1a937a958c
diff --git a/curdling/services/dependencer.py b/curdling/services/dependencer.py index <HASH>..<HASH> 100644 --- a/curdling/services/dependencer.py +++ b/curdling/services/dependencer.py @@ -11,8 +11,8 @@ class Dependencer(Service): self.dependency_found = Signal() def handle(self, requester, data): - requirement = data.get('requirement') - wheel = Wheel(data.get('wheel')) + requirement = data['requirement'] + wheel = Wheel(data['wheel']) run_time_dependencies = wheel.metadata.requires_dist for spec in run_time_dependencies: diff --git a/tests/unit/test_services_dependencer.py b/tests/unit/test_services_dependencer.py index <HASH>..<HASH> 100644 --- a/tests/unit/test_services_dependencer.py +++ b/tests/unit/test_services_dependencer.py @@ -16,7 +16,7 @@ def test_dependencer(Wheel): Wheel.return_value = Mock(metadata=Mock(requires_dist=['forbiddenfruit (0.1.1)'])) # When I queue a package and a sentinel and then call the worker - dependencer.queue('tests', requirement='sure') + dependencer.queue('tests', requirement='sure', wheel='forbiddenfruit-0.1-cp27.whl') dependencer.queue(None) dependencer._worker()
Both `requirement` and `wheel` are required parameters for the Dependencer
clarete_curdling
train
py,py
f8f8f801ff3149753525d293296015a90934bc48
diff --git a/promise.js b/promise.js index <HASH>..<HASH> 100644 --- a/promise.js +++ b/promise.js @@ -7,6 +7,7 @@ function Promise(resolver) { var _value; var promise = this; + this.then = function(onFulfilled, onRejected) { var deferred = Promise.deferred(); return handler.call(deferred, onFulfilled, onRejected); @@ -56,8 +57,6 @@ }, function(reason) { reject(reason); }); - - return promise; } /**************************** diff --git a/test/promise.js b/test/promise.js index <HASH>..<HASH> 100644 --- a/test/promise.js +++ b/test/promise.js @@ -9,6 +9,13 @@ chai.use(require('sinon-chai')); require('mocha-as-promised')(); describe('PJs', function() { + + describe('constructor', function() { + it('returns an instance of the Promise class', function() { + expect(new Promise(function() {})).to.be.instanceOf(Promise); + }); + }); + describe('#throw', function() { xit('figure out how to test this...'); });
No need to return from a contructor.
jridgewell_PJs
train
js,js
11ea058cba00d40a0fb34fb94ac71f39be7a6f68
diff --git a/readme/markdown.py b/readme/markdown.py index <HASH>..<HASH> 100644 --- a/readme/markdown.py +++ b/readme/markdown.py @@ -21,5 +21,8 @@ from .clean import clean def render(raw): rendered = markdown.markdown( raw, - extensions=['markdown.extensions.fenced_code']) + extensions=[ + 'markdown.extensions.fenced_code', + 'markdown.extensions.smart_strong', + ]) return clean(rendered or raw), bool(rendered) diff --git a/tests/test_markdown.py b/tests/test_markdown.py index <HASH>..<HASH> 100755 --- a/tests/test_markdown.py +++ b/tests/test_markdown.py @@ -81,6 +81,14 @@ def read(fn): assert out == expected_html +def test_smart_strong(): + markdown_markup = 'Text with double__underscore__words.' + out, rendered = render(markdown_markup) + expected_html = '<p>Text with double__underscore__words.</p>' + assert rendered + assert out == expected_html + + def test_headings_and_paragraphs(): _do_test_with_files('headings_and_paragraphs')
Add support for markdown.extensions.smart_strong Allows markup like: Text with double__underscore__words. And it will render the double underscores within the words instead of taking them to mean to format as strong.
pypa_readme_renderer
train
py,py
0a539722f42cc5ccefb794c0619b2057678cf6b8
diff --git a/eureka-client/src/main/java/com/netflix/appinfo/ApplicationInfoManager.java b/eureka-client/src/main/java/com/netflix/appinfo/ApplicationInfoManager.java index <HASH>..<HASH> 100644 --- a/eureka-client/src/main/java/com/netflix/appinfo/ApplicationInfoManager.java +++ b/eureka-client/src/main/java/com/netflix/appinfo/ApplicationInfoManager.java @@ -56,7 +56,7 @@ public class ApplicationInfoManager { } @Inject - ApplicationInfoManager(EurekaInstanceConfig config, InstanceInfo instanceInfo) { + public ApplicationInfoManager(EurekaInstanceConfig config, InstanceInfo instanceInfo) { this.config = config; this.instanceInfo = instanceInfo;
make constructor public so other DI systems can create instances
Netflix_eureka
train
java
0db3d9d9ed11b1f099dcfb197822ecf4007abcd8
diff --git a/protempa-framework/src/main/java/org/protempa/proposition/Context.java b/protempa-framework/src/main/java/org/protempa/proposition/Context.java index <HASH>..<HASH> 100644 --- a/protempa-framework/src/main/java/org/protempa/proposition/Context.java +++ b/protempa-framework/src/main/java/org/protempa/proposition/Context.java @@ -50,12 +50,12 @@ public final class Context extends TemporalProposition implements Serializable { @Override public void accept(PropositionVisitor propositionVisitor) { - throw new UnsupportedOperationException("Unimplemented"); + propositionVisitor.visit(this); } @Override public void acceptChecked(PropositionCheckedVisitor propositionCheckedVisitor) throws ProtempaException { - throw new UnsupportedOperationException("Unimplemented"); + propositionCheckedVisitor.visit(this); } private void writeObject(ObjectOutputStream s) throws IOException {
Implemented accept and acceptChecked.
eurekaclinical_protempa
train
java
db89b1d94f649a07230f4a2900add9f601187842
diff --git a/pysolr.py b/pysolr.py index <HASH>..<HASH> 100644 --- a/pysolr.py +++ b/pysolr.py @@ -608,6 +608,9 @@ class Solr(object): continue if boost and v in boost: + if not isinstance(boost, basestring): + boost[v] = str(boost[v]) + f = ET.Element('field', name=key, boost=boost[v]) else: f = ET.Element('field', name=key) @@ -620,6 +623,9 @@ class Solr(object): continue if boost and key in boost: + if not isinstance(boost, basestring): + boost[v] = str(boost[v]) + f = ET.Element('field', name=key, boost=boost[key]) else: f = ET.Element('field', name=key)
Boost values are now coerced into a string. Thanks to notanumber for the patch!
django-haystack_pysolr
train
py
20dc3f7e291034bb5375524c0e6346243bbc5f35
diff --git a/lib/lanes/api/sprockets_extension.rb b/lib/lanes/api/sprockets_extension.rb index <HASH>..<HASH> 100644 --- a/lib/lanes/api/sprockets_extension.rb +++ b/lib/lanes/api/sprockets_extension.rb @@ -4,6 +4,8 @@ require 'sinatra/sprockets-helpers' require_relative 'javascript_processor' require 'compass/import-once/activate' require 'sprockets-helpers' +require 'tilt/erb' +require 'compass/import-once/activate' module Lanes module API
require tilt/erb and import-once
argosity_hippo
train
rb
30eecad512e786b3fcbaa2e235d470a394f4d963
diff --git a/cli/index.js b/cli/index.js index <HASH>..<HASH> 100755 --- a/cli/index.js +++ b/cli/index.js @@ -12,9 +12,6 @@ process.env.VERBOSE = let cmd = process.argv[2] switch(cmd) { - case '.': // Watch current root - watch(process.cwd()) - break case 'start': // Start the daemon let starting = wch.start() if (starting) { @@ -65,6 +62,10 @@ switch(cmd) { v: true, // verbose errors }) + // Watch the current directory. + if (args._ == '.') + return watch(process.cwd()) + if (Array.isArray(args.x) && !args.w) fatal('Cannot use -x without -w')
fix(cli): fail if wch . has any flags
aleclarson_wch
train
js
2a9ba36679428462f15bc826f8880b4dab89f9b9
diff --git a/lib/dalli/server.rb b/lib/dalli/server.rb index <HASH>..<HASH> 100644 --- a/lib/dalli/server.rb +++ b/lib/dalli/server.rb @@ -59,7 +59,7 @@ module Dalli end connect - @sock + !!@sock rescue Dalli::NetworkError false end
make server#alive? always return a boolean value
petergoldstein_dalli
train
rb
7183ca6f0cb9436e3a9788e7d808c7f07bd89188
diff --git a/src/dpt/index.js b/src/dpt/index.js index <HASH>..<HASH> 100644 --- a/src/dpt/index.js +++ b/src/dpt/index.js @@ -22,7 +22,7 @@ class DPT extends EventEmitter { this._kbucket = new KBucket(this._id) this._kbucket.on('added', (peer) => this.emit('peer:added', peer)) - this._kbucket.on('remove', (peer) => this.emit('peer:removed', peer)) + this._kbucket.on('removed', (peer) => this.emit('peer:removed', peer)) this._kbucket.on('ping', (...args) => this._onKBucketPing(...args)) this._server = new DPTServer(this, this._privateKey, {
Fix bug not forwarding k-bucket remove event through DPT
ethereumjs_ethereumjs-vm
train
js
c67cdfd283212aff8e18f9a486b81e99159b5297
diff --git a/lib/run/index.js b/lib/run/index.js index <HASH>..<HASH> 100644 --- a/lib/run/index.js +++ b/lib/run/index.js @@ -132,10 +132,15 @@ Runner.prototype.initFramework = function() { testProcess.stderr.setEncoding('utf8'); testProcess.stdout.on('data', data => { + if (typeof data === 'string') { + data = data.replace(/\r?\n|\r$/, ''); + } this.emit('data', data); }); - testProcess.stderr.on('data', data => { + if (typeof data === 'string') { + data = data.replace(/\r?\n|\r$/, ''); + } this.emit('data', data); });
fix(logging): fix empty links between test cases (#<I>)
macacajs_macaca-cli
train
js
99e620c51f1c8532c520af1073751a9e71bd1bca
diff --git a/src/objects/message.aspec.js b/src/objects/message.aspec.js index <HASH>..<HASH> 100644 --- a/src/objects/message.aspec.js +++ b/src/objects/message.aspec.js @@ -283,4 +283,21 @@ describe("./objects/message.js", function () { }); + it("msngr().persist().cease().on() - registers a payload, unregisters a payload then registers a handler", function (done) { + var handledCount = 0; + + var msg = msngr("MyTestingTopic"); + msg.persist("MyPayload"); + msg.cease(); + msg.on(function (payload) { + ++handledCount; + }); + + setTimeout(function () { + expect(handledCount).to.equal(0); + done(); + }, 250); + + }); + });
Added unit test to cover cease correctly
KrisSiegel_msngr.js
train
js
8b61c947928b50167b1448c4bc1fda68064b51e7
diff --git a/src/Slim/Handlers/Strategies/ActionStrategy.php b/src/Slim/Handlers/Strategies/ActionStrategy.php index <HASH>..<HASH> 100644 --- a/src/Slim/Handlers/Strategies/ActionStrategy.php +++ b/src/Slim/Handlers/Strategies/ActionStrategy.php @@ -1,4 +1,5 @@ <?php + namespace Eukles\Slim\Handlers\Strategies; use Eukles\Action; @@ -76,14 +77,13 @@ class ActionStrategy implements InvocationStrategyInterface ServerRequestInterface $request, ResponseInterface $response, array $routeArguments - ) - { - + ) { + try { return call_user_func_array($callable, $this->buildParams($callable, $request, $routeArguments)); } catch (\Exception $e) { $handler = $this->container->getActionErrorHandler(); - + return $handler($e, $request, $response); } } @@ -158,6 +158,8 @@ class ActionStrategy implements InvocationStrategyInterface $buildParams[] = $cleaner->cleanArray($paramValue); } elseif (is_scalar($paramValue)) { $buildParams[] = $cleaner->cleanString($paramValue); + } else { + $buildParams[] = $paramValue; } } }
fix error, no scalar/array/object parameter was not injected in function since XssCleaner
wollanup_php-api-rest
train
php
a830539478d35777f411551d485ddf6ffb0beff3
diff --git a/lxd/main.go b/lxd/main.go index <HASH>..<HASH> 100644 --- a/lxd/main.go +++ b/lxd/main.go @@ -833,7 +833,7 @@ they otherwise would. } // Unset all storage keys, core.https_address and core.trust_password - for _, key := range []string{"core.https_address", "core.trust_password"} { + for _, key := range []string{"storage.zfs_pool_name", "core.https_address", "core.trust_password"} { _, err = c.SetServerConfig(key, "") if err != nil { return err
init: actually unset the storage keys
lxc_lxd
train
go
24671bd8b41b420d4586ed5c5cffbdcd91653ba7
diff --git a/course/edit.php b/course/edit.php index <HASH>..<HASH> 100644 --- a/course/edit.php +++ b/course/edit.php @@ -145,7 +145,6 @@ } else { // Add current teacher and send to course // find a role with legacy:edittingteacher - if ($teacherroles = get_roles_with_capability('moodle/legacy:editingteacher', CAP_ALLOW, $context)) { // assign the role to this user $teachereditrole = array_shift($teacherroles); @@ -306,11 +305,11 @@ function validate_form($course, &$form, &$err) { if (empty($form->summary)) $err["summary"] = get_string("missingsummary"); - if (empty($form->teacher)) - $err["teacher"] = get_string("missingteacher"); + //if (empty($form->teacher)) + // $err["teacher"] = get_string("missingteacher"); - if (empty($form->student)) - $err["student"] = get_string("missingstudent"); + //if (empty($form->student)) + // $err["student"] = get_string("missingstudent"); if (! $form->category) $err["category"] = get_string("missingcategory");
validation should not watch out for teacher and students string anymore
moodle_moodle
train
php
0acbbb206a6663a73adb9ad2e8e5dd710f520b66
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 @@ -697,9 +697,12 @@ class BaseEditMixin(object): characters. """ text = self.toPlainText() + lines = text.splitlines() linesep = self.get_line_separator() - text.replace('\n', linesep) - return text + text_with_eol = linesep.join(lines) + if text.endswith('\n'): + text_with_eol += linesep + return text_with_eol #------Positions, coordinates (cursor, EOF, ...) def get_position(self, subject):
Editor: Fix getting text with end-of-lines
spyder-ide_spyder
train
py
a93cbbd40c22821336953647e43ae5a8771b7886
diff --git a/activeresource/test/cases/base_test.rb b/activeresource/test/cases/base_test.rb index <HASH>..<HASH> 100644 --- a/activeresource/test/cases/base_test.rb +++ b/activeresource/test/cases/base_test.rb @@ -473,17 +473,6 @@ class BaseTest < ActiveSupport::TestCase assert_equal nil, fruit.headers['key2'] end - def test_header_inheritance_should_not_leak_upstream - fruit = Class.new(ActiveResource::Base) - apple = Class.new(fruit) - fruit.site = 'http://market' - - fruit.headers['key'] = 'value' - - apple.headers['key2'] = 'value2' - assert_equal nil, fruit.headers['key2'] - end - ######################################################################## # Tests for setting up remote URLs for a given model (including adding # parameters appropriately)
Remove double test for header inheritance leaks
rails_rails
train
rb
6e8827d6457e9fc862be910c38bd37f8d327f728
diff --git a/SingularityBase/src/main/java/com/hubspot/singularity/SingularityState.java b/SingularityBase/src/main/java/com/hubspot/singularity/SingularityState.java index <HASH>..<HASH> 100644 --- a/SingularityBase/src/main/java/com/hubspot/singularity/SingularityState.java +++ b/SingularityBase/src/main/java/com/hubspot/singularity/SingularityState.java @@ -1,5 +1,6 @@ package com.hubspot.singularity; +import java.util.Collections; import java.util.List; import com.fasterxml.jackson.annotation.JsonCreator; @@ -121,7 +122,7 @@ public class SingularityState { this.cleaningTasks = cleaningTasks; this.hostStates = hostStates; this.lateTasks = lateTasks; - this.listLateTasks = listLateTasks; + this.listLateTasks = listLateTasks == null ? Collections.emptyList() : listLateTasks; this.finishedRequests = finishedRequests; this.futureTasks = futureTasks; this.maxTaskLag = maxTaskLag;
handle when list of late tasks is not in json yet
HubSpot_Singularity
train
java
fe33b0c55d4d6d4a4e78a0ceed55123af60799b7
diff --git a/break_break_infinity.js b/break_break_infinity.js index <HASH>..<HASH> 100644 --- a/break_break_infinity.js +++ b/break_break_infinity.js @@ -1299,6 +1299,16 @@ var padEnd = function (string, maxLength, fillString) { tanh() { return this.sinh().div(this.cosh()); } + asinh() { + return Decimal.ln(this.add(this.sqr().add(1).sqrt())); + } + acosh() { + return Decimal.ln(this.add(this.sqr().sub(1).sqrt())); + } + atanh() { + if (this.abs().gte(1)) return Number.NaN; + return Decimal.ln(this.add(1).div(new Decimal(1).sub(this))).div(2); + } //If you're willing to spend 'resourcesAvailable' and want to buy something with exponentially increasing cost each purchase (start at priceStart, multiply by priceRatio, already own currentOwned), how much of it can you buy? Adapted from Trimps source code. static affordGeometricSeries(resourcesAvailable, priceStart, priceRatio, currentOwned)
the other hyperbolic trig functions
Patashu_break_infinity.js
train
js
5ba2722d774b4c293ffd2b7d128dc5eeb28f1e55
diff --git a/components/web.js b/components/web.js index <HASH>..<HASH> 100644 --- a/components/web.js +++ b/components/web.js @@ -5,6 +5,11 @@ var Crypto = require('crypto'); var SteamCrypto = require('@doctormckay/steam-crypto'); SteamUser.prototype.webLogOn = function() { + // Verify logged on + if (!this.steamID) { + throw new Error("Cannot log onto steamcommunity.com without first being connected to Steam network"); + } + // Verify not anonymous user if (this.steamID.type === SteamID.Type.ANON_USER) { throw new Error('Must not be anonymous user to use webLogOn (check to see you passed in valid credentials to logOn)')
Throw an Error if we try to webLogOn without being connected
DoctorMcKay_node-steam-user
train
js
4ef1270e71409c86a9c20edc21d13bdfd99ea1c5
diff --git a/src/controllers/MoveController.php b/src/controllers/MoveController.php index <HASH>..<HASH> 100644 --- a/src/controllers/MoveController.php +++ b/src/controllers/MoveController.php @@ -12,9 +12,9 @@ namespace hipanel\modules\stock\controllers; use hipanel\actions\Action; +use hipanel\actions\ComboSearchAction; use hipanel\actions\IndexAction; use hipanel\actions\OrientationAction; -use hipanel\actions\SearchAction; use hipanel\actions\SmartPerformAction; use hipanel\base\CrudController; use Yii; @@ -41,11 +41,11 @@ class MoveController extends CrudController }, ], 'directions-list' => [ - 'class' => SearchAction::class, + 'class' => ComboSearchAction::class, 'on beforeSave' => function ($event) { /** @var Action $action */ $action = $event->sender; - $action->dataProvider->query->options['scenario'] = 'get-directions'; + $action->dataProvider->query->action('get-directions'); }, ], 'delete' => [
MoveController - updated directions-list action to use ComboSearchAction
hiqdev_hipanel-module-stock
train
php
355d7d4f57c3bf3db5819f7096fe91593fb6ebee
diff --git a/cfg/dist.js b/cfg/dist.js index <HASH>..<HASH> 100644 --- a/cfg/dist.js +++ b/cfg/dist.js @@ -31,7 +31,11 @@ const commonJsConfig = Object.assign( {}, baseConfig, { index : path.join( __dirname, '../src/index.js' ), componentDriver : path.join( __dirname, '../src/Testing/index.js' ), driverSuite : path.join( __dirname, '../src/drivers.js' ), - addons : path.join( __dirname, '../src/addons.js' ) + addons : path.join( __dirname, '../src/addons.js' ), + css : [ + path.join( __dirname, '../src/index.js' ), + path.join( __dirname, '../src/addons.js' ), + ], }, output : { path : path.join( __dirname, '/../dist' ),
Hack webpack/ExtractTextPlugin to combine CSS from different entrypoints #<I>
sociomantic-tsunami_nessie-ui
train
js
cdb278f81e0015956b102aeee06355dc6cbb8331
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ setup( url='http://www.metametricsinc.com/', license='GPLv3', install_requires=[ - 'boto3>=1.4,<1.5', + 'boto3>=1.4,<1.5','PyJWT==1.4.2','envs>=0.3.0' ], extras_require={ 'django': [
Added envs and pyjwt to the setup.py
capless_warrant
train
py
9704b7760ecfd5f9b1df31ef90afb53b56e69316
diff --git a/src/main/java/com/j256/ormlite/android/apptools/OrmLiteSqliteOpenHelper.java b/src/main/java/com/j256/ormlite/android/apptools/OrmLiteSqliteOpenHelper.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/j256/ormlite/android/apptools/OrmLiteSqliteOpenHelper.java +++ b/src/main/java/com/j256/ormlite/android/apptools/OrmLiteSqliteOpenHelper.java @@ -268,7 +268,7 @@ public abstract class OrmLiteSqliteOpenHelper extends SQLiteOpenHelper { * Get a DAO for our class. This uses the {@link DaoManager} to cache the DAO for future gets. * * <p> - * NOTE: This routing does not return Dao<T, ID> because of casting issues if we are assigning it to a custom DAO. + * NOTE: This routing does not return Dao&lt;T, ID&gt; because of casting issues if we are assigning it to a custom DAO. * Grumble. * </p> */ @@ -284,7 +284,7 @@ public abstract class OrmLiteSqliteOpenHelper extends SQLiteOpenHelper { * Get a RuntimeExceptionDao for our class. This uses the {@link DaoManager} to cache the DAO for future gets. * * <p> - * NOTE: This routing does not return RuntimeExceptionDao<T, ID> because of casting issues if we are assigning it to + * NOTE: This routing does not return RuntimeExceptionDao&lt;T, ID&gt; because of casting issues if we are assigning it to * a custom DAO. Grumble. * </p> */
Fixed some javadocs issues.
j256_ormlite-android
train
java
728331fa28871264d24e96ef57c734837b70a1c9
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -44,6 +44,7 @@ export default function extractAbbreviation(line, pos, lookAhead) { let c; const stream = new StreamReader(line); + stream.pos = pos; const stack = []; while (!stream.sol()) { diff --git a/test/extract.js b/test/extract.js index <HASH>..<HASH> 100644 --- a/test/extract.js +++ b/test/extract.js @@ -33,6 +33,7 @@ describe('Extract abbreviation', () => { it('abbreviation with attributes', () => { assert.deepEqual(extract('a foo[bar|]'), result('foo[bar]', 2)); assert.deepEqual(extract('a foo[bar="baz" a b]'), result('foo[bar="baz" a b]', 2)); + assert.deepEqual(extract('foo bar[a|] baz'), result('bar[a]', 4)); }); it('tag test', () => {
💩 Set proper initial stream reader position
emmetio_extract-abbreviation
train
js,js
bd1bebbd41c618a117472d1d23eafe63cfb944b3
diff --git a/docker_squash/cli.py b/docker_squash/cli.py index <HASH>..<HASH> 100644 --- a/docker_squash/cli.py +++ b/docker_squash/cli.py @@ -62,6 +62,7 @@ class CLI(object): from_layer=args.from_layer, tag=args.tag, output_path=args.output_path, tmp_dir=args.tmp_dir, development=args.development).run() except KeyboardInterrupt: self.log.error("Program interrupted by user, exiting...") + sys.exit(1) except: e = sys.exc_info()[1]
added sys.exit(1) on KeyboardInterrupt
goldmann_docker-squash
train
py
6683ada3964bd3d45486a28aa09a4f43ca12aede
diff --git a/source/rafcon/mvc/utils/constants.py b/source/rafcon/mvc/utils/constants.py index <HASH>..<HASH> 100644 --- a/source/rafcon/mvc/utils/constants.py +++ b/source/rafcon/mvc/utils/constants.py @@ -28,7 +28,7 @@ CREATION_CURSOR = gtk.gdk.CROSS MAX_VALUE_LABEL_TEXT_LENGTH = 7 -MINIMUM_SIZE_FOR_DISPLAY = 5 +MINIMUM_SIZE_FOR_DISPLAY = 2 GRID_SIZE = 10 BORDER_WIDTH_STATE_SIZE_FACTOR = 25.
Reduce limit under which elements are being hidden
DLR-RM_RAFCON
train
py
9ead1f6f01c8769b91e08c66938cf5fd630996ea
diff --git a/src/components/d-front-matter.js b/src/components/d-front-matter.js index <HASH>..<HASH> 100644 --- a/src/components/d-front-matter.js +++ b/src/components/d-front-matter.js @@ -30,7 +30,6 @@ export function _moveLegacyAffiliationFormatIntoArray(frontMatter) { author.affiliations = [newAffiliation]; } } - console.log(frontMatter) return frontMatter }
Remove stray console.log(frontmatter) call
distillpub_template
train
js
a78a0af1b2dd5350e990d2609fc5c83425b64c02
diff --git a/lib/module.js b/lib/module.js index <HASH>..<HASH> 100644 --- a/lib/module.js +++ b/lib/module.js @@ -60,10 +60,11 @@ const report = _.curry(function(options, results) { }); function makeLinter(options) { - const parser = options.directories ? pathParsers.fullPathParser : pathParsers.fileNameParser; + const regexp = new RegExp('(' + options.extensionName + ')$'); + const parser = options.extensions ? pathParsers.fileExtensionParser : (options.directories ? pathParsers.fullPathParser : pathParsers.fileNameParser); return new Linter({ pathParser: parser, - matcher: matchers[options.format] + matcher: options.extensions ? matchers.makeRegexStringTest(regexp) : matchers[options.format] }); }
feat(file-extension-parser): added parsing condition
usabilla_fnlint
train
js
c2a1246f59430d046195238c719af44b76facb0b
diff --git a/spec/acceptance/simple_get_filter_spec.rb b/spec/acceptance/simple_get_filter_spec.rb index <HASH>..<HASH> 100644 --- a/spec/acceptance/simple_get_filter_spec.rb +++ b/spec/acceptance/simple_get_filter_spec.rb @@ -18,7 +18,7 @@ RSpec.describe 'exercising simple_get_filter' do end context 'when using `get` to access a specific resource' do - it 'returns resource' do + it '`puppet resource` uses `instances` and does the filtering' do stdout_str, status = Open3.capture2e("puppet resource #{common_args} test_simple_get_filter foo") expect(stdout_str.strip).to match %r{test_string\s*=>\s*'default'} @@ -27,7 +27,7 @@ RSpec.describe 'exercising simple_get_filter' do end context 'when using `get` to remove a specific resource' do - it 'receives names array' do + it 'the `retrieve` function does the lookup' do stdout_str, status = Open3.capture2e("puppet resource #{common_args} test_simple_get_filter foo ensure=absent") expect(stdout_str.strip).to match %r{undefined 'ensure' from 'present'}
Improve the wording of the tests to reflect what's happening
puppetlabs_puppet-resource_api
train
rb
90d3fea335a932adf4254529598b61610409457f
diff --git a/src/client/components/MenuDropdownGrid/MenuDropdownGrid.react.js b/src/client/components/MenuDropdownGrid/MenuDropdownGrid.react.js index <HASH>..<HASH> 100644 --- a/src/client/components/MenuDropdownGrid/MenuDropdownGrid.react.js +++ b/src/client/components/MenuDropdownGrid/MenuDropdownGrid.react.js @@ -2,6 +2,8 @@ /* eslint-disable no-script-url */ import React, { Component } from 'react'; import Types from 'prop-types'; +import chunk from 'lodash/chunk'; +import flatten from 'lodash/flatten'; import './MenuDropdownGrid.less'; import { SVG } from '@opuscapita/react-svg'; @@ -29,7 +31,12 @@ class MenuDropdownGrid extends Component { items } = this.props; - const itemsElement = items.map((item, i) => { + // Hide row if all items in the row are disabled + const filteredItems = flatten( + chunk(items, ITEMS_PER_ROW).filter((itemsChunk) => itemsChunk.some(item => item.href)) + ); + + const itemsElement = filteredItems.map((item, i) => { if (!item) { return ( <div
Hide row if all items in the row are disabled
OpusCapita_react-navigation
train
js
f8dd54145392ee015df9a9cb8e5b46520e2f6002
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -9,6 +9,7 @@ module.exports = ddescribeIit; function ddescribeIit(opt) { 'use strict'; opt = opt || { allowDisabledTests: true, noColor: false }; + // istanbul ignore next --- To many variables to cover in testing var supports_colors = (function() { if (opt.noColor) return false; if (process.argv.indexOf('--no-color') !== -1) return false; @@ -185,7 +186,7 @@ function ddescribeIit(opt) { } if (len === 1) x = '000' + x; else if (len === 2) x = '00' + x; - else if (len === 3) x = '0' + x; + // TODO(@caitp): Add support for > 8bit codepoints if ever needed return x; }
chore(ddescribe-iit): get that <I>% coverage report
caitp_gulp-ddescribe-iit
train
js