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
f972715a45a2212bd81dacd3dc3f4f9722eb9f46
diff --git a/salt/modules/win_service.py b/salt/modules/win_service.py index <HASH>..<HASH> 100644 --- a/salt/modules/win_service.py +++ b/salt/modules/win_service.py @@ -444,8 +444,9 @@ def stop(name): try: win32serviceutil.StopService(name) except pywintypes.error as exc: - raise CommandExecutionError( - 'Failed To Stop {0}: {1}'.format(name, exc[2])) + if exc[0] != 1062: + raise CommandExecutionError( + 'Failed To Stop {0}: {1}'.format(name, exc[2])) attempts = 0 while info(name)['Status'] in ['Running', 'Stop Pending'] \
fixes issue #<I> The method stop() in the state module win_service fails if the service has already been stopped.
saltstack_salt
train
py
a07b87eb8b695206914b6387082883fcce6f9913
diff --git a/pgtype/line_test.go b/pgtype/line_test.go index <HASH>..<HASH> 100644 --- a/pgtype/line_test.go +++ b/pgtype/line_test.go @@ -13,6 +13,16 @@ func TestLineTranscode(t *testing.T) { t.Skip("Skipping due to no line type") } + // line may exist but not be usable on 9.3 :( + var isPG93 bool + err := conn.QueryRow("select version() ~ '9.3'").Scan(&isPG93) + if err != nil { + t.Fatal(err) + } + if isPG93 { + t.Skip("Skipping due to unimplemented line type in PG 9.3") + } + testutil.TestSuccessfulTranscode(t, "line", []interface{}{ &pgtype.Line{ A: 1.23, B: 4.56, C: 7.89,
Skip line test of PG <I>
jackc_pgx
train
go
d7a7937855e24bf8fcb154a6b0ce796c3ab4135d
diff --git a/lib/arjdbc/postgresql/adapter.rb b/lib/arjdbc/postgresql/adapter.rb index <HASH>..<HASH> 100644 --- a/lib/arjdbc/postgresql/adapter.rb +++ b/lib/arjdbc/postgresql/adapter.rb @@ -379,7 +379,8 @@ module ArJdbc def extension_enabled?(name) if supports_extensions? rows = select_rows("SELECT EXISTS(SELECT * FROM pg_available_extensions WHERE name = '#{name}' AND installed_version IS NOT NULL)", 'SCHEMA') - rows.first.first + available = rows.first.first # true/false or 't'/'f' + available == true || available == 't' end end
[postgres] fix `extension_enabled?` to work with raw boolean values
jruby_activerecord-jdbc-adapter
train
rb
4eabeb9ae7e3b96a3a9490aa12f9016ea9ecc768
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobMaster.java b/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobMaster.java index <HASH>..<HASH> 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobMaster.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobMaster.java @@ -1098,6 +1098,7 @@ public class JobMaster extends FencedRpcEndpoint<JobMasterId> implements JobMast try { resourceManagerLeaderRetriever.stop(); + resourceManagerAddress = null; } catch (Throwable t) { log.warn("Failed to stop resource manager leader retriever when suspending.", t); }
[hotfix] Null resourceManagerAddress when suspending JobMaster Nulling the resourceManagerAddress when suspending the JobMaster prevents that the JobMaster tries to reconnect to the ResourceManager if it receives a disconnectResourceManager message.
apache_flink
train
java
7d4b7fb67d7ca832291c8d37a7c2b9b7766321f7
diff --git a/search/collectors/collector_heap.go b/search/collectors/collector_heap.go index <HASH>..<HASH> 100644 --- a/search/collectors/collector_heap.go +++ b/search/collectors/collector_heap.go @@ -63,7 +63,10 @@ func (hc *HeapCollector) Collect(ctx context.Context, searcher search.Searcher) default: } } - hc.collectSingle(next) + err = hc.collectSingle(next) + if err != nil { + break + } if hc.facetsBuilder != nil { err = hc.facetsBuilder.Update(next) if err != nil {
Adding sort to SearchRequest.
blevesearch_bleve
train
go
6f9ec602d9a07f0c1db9f184059161b54d89e04f
diff --git a/mousedb/settings.py b/mousedb/settings.py index <HASH>..<HASH> 100644 --- a/mousedb/settings.py +++ b/mousedb/settings.py @@ -19,11 +19,8 @@ USE_TZ = True SECRET_KEY = 'ci%^08ig-0qu*&b(kz_=n6lvbx*puyx6=8!yxzm0+*z)w@7+%6' # List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.load_template_source', - 'django.template.loaders.app_directories.load_template_source', -# 'django.template.loaders.eggs.load_template_source', -) +TEMPLATE_LOADERS = ('django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader') MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware',
Updated TEMPLATE_LOADERS setting. Part of issue # <I>.
davebridges_mousedb
train
py
a343c353a72faa0851fc4f45b5f64025df1ce68d
diff --git a/docs/source/conf.py b/docs/source/conf.py index <HASH>..<HASH> 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -43,6 +43,7 @@ extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.coverage', + 'sphinx.ext.intersphinx', 'sphinx.ext.mathjax', 'sphinx.ext.napoleon', 'notebook_gen_sphinxext' @@ -51,6 +52,12 @@ extensions = [ mathjax_path = 'https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' #autosummary_generate = True +# Set up mapping for other projects' docs +intersphinx_mapping = { + 'python': ('http://docs.python.org/3/', None), + 'numpy': ('http://docs.scipy.org/doc/numpy/', None), + } + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates']
Add intersphinx mapping for other docs.
Unidata_siphon
train
py
726a102894054273ad23fee716b410aa1b14086f
diff --git a/lib/dpl/provider/gcs.rb b/lib/dpl/provider/gcs.rb index <HASH>..<HASH> 100644 --- a/lib/dpl/provider/gcs.rb +++ b/lib/dpl/provider/gcs.rb @@ -22,8 +22,10 @@ module DPL end def push_app + glob_args = ["**/*"] + glob_args << File::FNM_DOTMATCH if options[:dot_match] Dir.chdir(options.fetch(:local_dir, Dir.pwd)) do - Dir.glob("**/*") do |filename| + Dir.glob(*glob_args) do |filename| next if File.directory?(filename) log "Push: #{filename}" diff --git a/spec/provider/gcs_spec.rb b/spec/provider/gcs_spec.rb index <HASH>..<HASH> 100644 --- a/spec/provider/gcs_spec.rb +++ b/spec/provider/gcs_spec.rb @@ -32,6 +32,13 @@ describe DPL::Provider::GCS do expect(Dir).to receive(:chdir).with('BUILD') provider.push_app end + + example "With dot_match" do + provider.options.update(:dot_match => true) + + expect(Dir).to receive(:glob).with('**/*', File::FNM_DOTMATCH) + provider.push_app + end end describe '#client' do
Add dot_match option to gcs provider When collecting files to upload, optionally include dot files
travis-ci_dpl
train
rb,rb
3270baebf653303e625c98436d2af81a2802bae0
diff --git a/system/Database/BaseConnection.php b/system/Database/BaseConnection.php index <HASH>..<HASH> 100644 --- a/system/Database/BaseConnection.php +++ b/system/Database/BaseConnection.php @@ -1216,6 +1216,11 @@ abstract class BaseConnection implements ConnectionInterface return $this->dataCache['field_names'][$table]; } + if (empty($this->connID)) + { + $this->initialize(); + } + if (FALSE === ($sql = $this->_listColumns($table))) { if ($this->DBDebug)
Ensuring we have a valid connection when hitting getFieldNames. fixes #<I>
codeigniter4_CodeIgniter4
train
php
55f8df214180c9c74ad784152512a0b07d8516ba
diff --git a/test/test_dns.py b/test/test_dns.py index <HASH>..<HASH> 100644 --- a/test/test_dns.py +++ b/test/test_dns.py @@ -39,6 +39,7 @@ class TestDNS(unittest.TestCase): def create_test(test_case): + @unittest.skipIf(sys.version_info[0] < 3, "PYTHON-2002 fails on python 2") @client_context.require_replica_set @client_context.require_ssl def run_test(self):
PYTHON-<I> Skip failing dnspython seedlist tests on Python 2
mongodb_mongo-python-driver
train
py
1b04964702776844f58f8e1d8aec413a3a01255e
diff --git a/lib/errawr/version.rb b/lib/errawr/version.rb index <HASH>..<HASH> 100644 --- a/lib/errawr/version.rb +++ b/lib/errawr/version.rb @@ -1,3 +1,3 @@ module Errawr - VERSION = '1.1.2' + VERSION = '1.1.3' end
Bumped to version <I>.
anthonator_errawr
train
rb
97b883ebee8efbb5de6d69787e4d97ea3a997c27
diff --git a/api.php b/api.php index <HASH>..<HASH> 100644 --- a/api.php +++ b/api.php @@ -643,7 +643,7 @@ class REST_CRUD_API { protected function processFiltersParameter($tables,$filters) { $result = array(); - foreach ($filters as &$filter) { + foreach ($filters as $filter) { if ($filter) { $filter = explode(',',$filter,3); if (count($filter)==3) { @@ -666,7 +666,7 @@ class REST_CRUD_API { } } } - return $filters; + return $result; } protected function processPageParameter($page) {
Fixed a bug introduced during refactoring
mevdschee_php-crud-api
train
php
cd7b4aab23d6fbb0d14e3bb77335bd7fefe79d9f
diff --git a/lib/ruote/engine.rb b/lib/ruote/engine.rb index <HASH>..<HASH> 100644 --- a/lib/ruote/engine.rb +++ b/lib/ruote/engine.rb @@ -244,6 +244,8 @@ module Ruote @context.storage.get_many('schedules', nil, options) : @context.storage.get_many('schedules', /!#{wfid}-\d+$/) + return scheds if options[:count] + scheds.collect { |sched| Ruote.schedule_to_h(sched) } end diff --git a/test/functional/ft_1_process_status.rb b/test/functional/ft_1_process_status.rb index <HASH>..<HASH> 100644 --- a/test/functional/ft_1_process_status.rb +++ b/test/functional/ft_1_process_status.rb @@ -556,6 +556,7 @@ digraph "process wfid wfid" { @engine.wait_for(:alpha) assert_equal 1, @engine.schedules.size + assert_equal 1, @engine.schedules(:count => true) end def test_ps_and_schedules
fixed issue with engine.schedules(:count => true)
jmettraux_ruote
train
rb,rb
0b5c5169ee8532bd41c49a466cdbe470f25b675f
diff --git a/packages/perspective-viewer-d3fc/src/js/d3fcChart.js b/packages/perspective-viewer-d3fc/src/js/d3fcChart.js index <HASH>..<HASH> 100644 --- a/packages/perspective-viewer-d3fc/src/js/d3fcChart.js +++ b/packages/perspective-viewer-d3fc/src/js/d3fcChart.js @@ -61,7 +61,7 @@ function renderBar(config, container, horizontal, hiddenElements, update) { let orientation = horizontal ? "horizontal" : "vertical"; let labels = interpretLabels(config); - let isSplitBy = labels.splitLabel != null; + let isSplitBy = labels.splitLabel != ""; let [dataset, stackedBarData, color] = interpretDataset(isSplitBy, config, hiddenElements);
corrected isSplitBy assessment logic.
finos_perspective
train
js
aa6c4eadd557c0de7c4e1c02997749ebc9d3307f
diff --git a/postcss.config.js b/postcss.config.js index <HASH>..<HASH> 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -15,8 +15,9 @@ let environment = { } // Only run PurgeCSS in production (you can also add staging here) -console.log("PURGECSS", process.env.NODE_ENV) -if (process.env.NODE_ENV === "production" || process.env.NODE_ENV === "staging") { + +if (["production", "staging", "uat"].indexOf(process.env.NODE_ENV) > -1) { + console.log("PURGECSS", process.env.NODE_ENV) environment.plugins.push( require("@fullhuman/postcss-purgecss")({ content: [
Purce CSS in a UAT environment
airslie_renalware-core
train
js
fca3834e1645a0d516748987398fde5b64fbcf83
diff --git a/src/frontend/org/voltdb/ProcedureRunner.java b/src/frontend/org/voltdb/ProcedureRunner.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/ProcedureRunner.java +++ b/src/frontend/org/voltdb/ProcedureRunner.java @@ -401,15 +401,15 @@ public class ProcedureRunner { * @return true if the txn hashes to the current partition, false otherwise */ public boolean checkPartition(TransactionState txnState, TheHashinator hashinator) { - TheHashinator.HashinatorType hashinatorType = hashinator.getConfigurationType(); - if (hashinatorType == TheHashinator.HashinatorType.LEGACY) { - // Legacy hashinator is not used for elastic, no need to check partitioning. In fact, - // since SP sysprocs all pass partitioning parameters as bytes, - // they will hash to different partitions using the legacy hashinator. So don't do it. - return true; - } - if (m_catProc.getSinglepartition()) { + TheHashinator.HashinatorType hashinatorType = hashinator.getConfigurationType(); + if (hashinatorType == TheHashinator.HashinatorType.LEGACY) { + // Legacy hashinator is not used for elastic, no need to check partitioning. In fact, + // since SP sysprocs all pass partitioning parameters as bytes, + // they will hash to different partitions using the legacy hashinator. So don't do it. + return true; + } + StoredProcedureInvocation invocation = txnState.getInvocation(); int parameterType; Object parameterAtIndex;
For ENG-<I>, fix NPE at MP RO site that doesn't have a hashinator set
VoltDB_voltdb
train
java
4909b20403a1751a31fb4dd41703335003fcbb31
diff --git a/lib/sprockets/asset.rb b/lib/sprockets/asset.rb index <HASH>..<HASH> 100644 --- a/lib/sprockets/asset.rb +++ b/lib/sprockets/asset.rb @@ -66,7 +66,7 @@ module Sprockets # # Returns String. def digest_path - logical_path.sub(/\.(\w+)$/) { |ext| "-#{digest}#{ext}" } + logical_path.sub(/\.(\w+)$/) { |ext| "-#{etag}#{ext}" } end # Public: Returns String MIME type of asset. Returns nil if type is unknown. @@ -176,7 +176,7 @@ module Sprockets alias_method :digest, :hexdigest # Pubic: ETag String of Asset. - alias_method :etag, :digest + alias_method :etag, :hexdigest # Public: Returns String base64 digest of source. def base64digest
fingerprint is always the same as etag
rails_sprockets
train
rb
000334ea2a717a2b5bf2a61f021aad85bb79d9cb
diff --git a/nd4j/nd4j-tensorflow/src/main/java/org/nd4j/tensorflow/conversion/TensorflowConversion.java b/nd4j/nd4j-tensorflow/src/main/java/org/nd4j/tensorflow/conversion/TensorflowConversion.java index <HASH>..<HASH> 100644 --- a/nd4j/nd4j-tensorflow/src/main/java/org/nd4j/tensorflow/conversion/TensorflowConversion.java +++ b/nd4j/nd4j-tensorflow/src/main/java/org/nd4j/tensorflow/conversion/TensorflowConversion.java @@ -296,7 +296,7 @@ public class TensorflowConversion { * @return */ public static String defaultDeviceForThread() { - Integer deviceForThread = Nd4j.getAffinityManager().getDeviceForThread(Thread.currentThread()); + Integer deviceForThread = Nd4j.getAffinityManager().getDeviceForCurrentThread(); String deviceName = null; //gpu if(Nd4j.getBackend().getClass().getName().contains("JCublasBackend")) {
affinity fix for tensorflow conversion
deeplearning4j_deeplearning4j
train
java
bcbf340ced5acd867aa5cb3905434f998efa1829
diff --git a/lib/switch_user.rb b/lib/switch_user.rb index <HASH>..<HASH> 100644 --- a/lib/switch_user.rb +++ b/lib/switch_user.rb @@ -2,7 +2,7 @@ module SwitchUser if defined? Rails::Engine class Engine < Rails::Engine config.to_prepare do - ApplicationController.helper(SwitchUserHelper) + ActionView::Base.send :include, SwitchUserHelper end end else
Update Helper Initializer to prevent app start failure due to Helper naming errors from app helpers being initialized too early
flyerhzm_switch_user
train
rb
aad87133e4a8457bf3486751dacd02165fa8c4f8
diff --git a/src/pywws/__init__.py b/src/pywws/__init__.py index <HASH>..<HASH> 100644 --- a/src/pywws/__init__.py +++ b/src/pywws/__init__.py @@ -1,3 +1,3 @@ __version__ = '18.4.2' -_release = '1478' -_commit = 'f0e59a2' +_release = '1479' +_commit = '2763574' diff --git a/src/pywws/totwitter.py b/src/pywws/totwitter.py index <HASH>..<HASH> 100644 --- a/src/pywws/totwitter.py +++ b/src/pywws/totwitter.py @@ -194,9 +194,10 @@ def main(argv=None): pywws.logger.setup_handler(1) with pywws.storage.pywws_context(args[0]) as context: pywws.localisation.set_application_language(context.params) - if ToTwitter(context).upload_file(args[1]): - return 0 - return 3 + uploader = ToTwitter(context) + uploader.upload_file(args[1]) + uploader.shutdown() + return 0 if __name__ == "__main__":
Ensure totwitter finishes when run as a command
jim-easterbrook_pywws
train
py,py
6c562cf0e8959133a16a4ccfe1bc712be6fe9355
diff --git a/src/EntityAttacher.php b/src/EntityAttacher.php index <HASH>..<HASH> 100644 --- a/src/EntityAttacher.php +++ b/src/EntityAttacher.php @@ -32,8 +32,10 @@ class EntityAttacher implements EntityAttacherInterface $metadata = $this->em->getClassMetadata($class); // Return the item if it's already in the database. - if ($item = $this->em->find($class, $metadata->getIdentifierValues($object))) { - return $item; + if ($ids = $metadata->getIdentifierValues($object)) { + if ($item = $this->em->find($class, $ids)) { + return $item; + } } $mappings = $metadata->getAssociationMappings();
Cannot query for an entity if there are no identifying values
geosocio_entity-attacher
train
php
03874a0222c223454ec54597efdf3f835de0e463
diff --git a/spec/parser_spec.rb b/spec/parser_spec.rb index <HASH>..<HASH> 100644 --- a/spec/parser_spec.rb +++ b/spec/parser_spec.rb @@ -131,4 +131,13 @@ describe PDF::Reader::Parser do parse_string("[ 10 0 R 12 0 R ]").parse_token.size.should eql(2) end + it "should parse numbers correctly" do + parser = parse_string("1 2 -3 4.5 -5") + parser.parse_token.should == 1 + parser.parse_token.should == 2 + parser.parse_token.should == -3 + parser.parse_token.should == 4.5 + parser.parse_token.should == -5 + end + end
spec parser behaviour with ints and floats
yob_pdf-reader
train
rb
79b663bded84923ad19c715718dcdd38e831e663
diff --git a/yandextank/plugins/JMeter/plugin.py b/yandextank/plugins/JMeter/plugin.py index <HASH>..<HASH> 100644 --- a/yandextank/plugins/JMeter/plugin.py +++ b/yandextank/plugins/JMeter/plugin.py @@ -24,7 +24,7 @@ class Plugin(GeneratorPlugin): SECTION = 'jmeter' SHUTDOWN_TEST = 'Shutdown' STOP_TEST_NOW = 'Stop Test' - DISCOVER_PORT_PATTERN = 'Waiting for possible shutdown message on port (?P<port>\d+)' + DISCOVER_PORT_PATTERN = 'Waiting for possible .* message on port (?P<port>\d+)' def __init__(self, core, cfg): super(Plugin, self).__init__(core, cfg) @@ -171,7 +171,7 @@ class Plugin(GeneratorPlugin): Waiting for possible shutdown message on port 4445 """ r = re.compile(self.DISCOVER_PORT_PATTERN) - with open(self.jmeter_log) as f: + with open(self.process_stderr.name,'r') as f: cnt = 0 while self.process.pid and cnt < 10: line = f.readline()
__discover_jmeter_udp_port fix process_stderr file is searched for port number pattern for searching is unified to be acceptable for both <I> and <I> jmeter versions
yandex_yandex-tank
train
py
442c6cefd4b2c7663a2781c41a1653a24996b948
diff --git a/src/test/java/io/reactivex/internal/util/OpenHashSetTest.java b/src/test/java/io/reactivex/internal/util/OpenHashSetTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/io/reactivex/internal/util/OpenHashSetTest.java +++ b/src/test/java/io/reactivex/internal/util/OpenHashSetTest.java @@ -25,6 +25,10 @@ public class OpenHashSetTest { return 1; } + @Override + public boolean equals(Object o) { + return this == o; + } } @Test
Add equals() to the unit test to satisfy checkstyle
ReactiveX_RxJava
train
java
76898b0028c49f94f44c7e798b9d51889ff68a2f
diff --git a/src/mork/__init__.py b/src/mork/__init__.py index <HASH>..<HASH> 100644 --- a/src/mork/__init__.py +++ b/src/mork/__init__.py @@ -3,6 +3,6 @@ from __future__ import absolute_import, unicode_literals from .virtualenv import VirtualEnv -__version__ = '0.1.1' +__version__ = '0.1.2.dev0' __all__ = ["VirtualEnv"]
Prebump to <I>.dev0
sarugaku_mork
train
py
4e9eb794899bb2d096385e6df01714194c36e29c
diff --git a/tests/PHPUnit/Integration/ReleaseCheckListTest.php b/tests/PHPUnit/Integration/ReleaseCheckListTest.php index <HASH>..<HASH> 100644 --- a/tests/PHPUnit/Integration/ReleaseCheckListTest.php +++ b/tests/PHPUnit/Integration/ReleaseCheckListTest.php @@ -271,6 +271,7 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase strpos($file, '/lang/') !== false || strpos($file, 'yuicompressor') !== false || strpos($file, '/libs/bower_components') !== false || + (strpos($file, '/vendor') !== false && strpos($file, '/vendor/piwik') === false) || strpos($file, '/tmp/') !== false ) { continue;
fix test by excluding this check for all vendor repos that are not piwik
matomo-org_matomo
train
php
8cc9352c62e48b388ab177aa501747977eed327d
diff --git a/src/binwalk/modules/signature.py b/src/binwalk/modules/signature.py index <HASH>..<HASH> 100644 --- a/src/binwalk/modules/signature.py +++ b/src/binwalk/modules/signature.py @@ -123,6 +123,9 @@ class Signature(Module): if r.jump and (r.jump + r.offset) > r.file.size: r.valid = False + if hasattr(r, "location") and (r.location != r.offset): + r.valid = False + if r.valid: # Don't keep displaying signatures that repeat a bunch of times # (e.g., JFFS2 nodes)
Added support for the 'location' signature keyword
ReFirmLabs_binwalk
train
py
87d7d75a5fa7374a007de8345a6742e90f6a51cf
diff --git a/undertow/src/main/java/org/wildfly/extension/undertow/filters/ModClusterDefinition.java b/undertow/src/main/java/org/wildfly/extension/undertow/filters/ModClusterDefinition.java index <HASH>..<HASH> 100644 --- a/undertow/src/main/java/org/wildfly/extension/undertow/filters/ModClusterDefinition.java +++ b/undertow/src/main/java/org/wildfly/extension/undertow/filters/ModClusterDefinition.java @@ -82,6 +82,7 @@ public class ModClusterDefinition extends AbstractHandlerDefinition { .setAllowExpression(true) .setRequired(true) .addAccessConstraint(SensitiveTargetAccessConstraintDefinition.SOCKET_BINDING_REF) + .setCapabilityReference(Capabilities.REF_SOCKET_BINDING) .setRestartAllServices() .build();
WFLY-<I> Management socket binding in Undertow mod_cluster filter is missing capability reference
wildfly_wildfly
train
java
6cd2226cd640148707fa1ed03b821d091724af04
diff --git a/go/vt/wrangler/keyspace.go b/go/vt/wrangler/keyspace.go index <HASH>..<HASH> 100644 --- a/go/vt/wrangler/keyspace.go +++ b/go/vt/wrangler/keyspace.go @@ -829,6 +829,12 @@ func (wr *Wrangler) RefreshTabletsByShard(ctx context.Context, si *topo.ShardInf if tabletTypes != nil && !topoproto.IsTypeInList(ti.Type, tabletTypes) { continue } + if ti.Hostname == "" { + // The tablet is not running, we don't have the host + // name to connect to, so we just skip this tablet. + wr.Logger().Infof("Tablet %v has no hostname, skipping its RefreshState", ti.AliasString()) + continue + } wg.Add(1) go func(ti *topo.TabletInfo) {
Not refreshing tablets that are not running. When a tablet shuts down, it now clears its Hostname in the topo. Do not call RefreshState at all on such tablets. This avoids a possible <I>s timeout on these. BUG=<I>
vitessio_vitess
train
go
449cc60c7d2124320816cf0f5d08ee7a0769c31f
diff --git a/ocrd/ocrd/cli/workspace.py b/ocrd/ocrd/cli/workspace.py index <HASH>..<HASH> 100644 --- a/ocrd/ocrd/cli/workspace.py +++ b/ocrd/ocrd/cli/workspace.py @@ -51,14 +51,14 @@ def workspace_cli(ctx, directory, mets_basename, backup): @click.option('--page-textequiv-consistency', '--page-strictness', help="How strict to check PAGE multi-level textequiv consistency", type=click.Choice(['strict', 'lax', 'fix', 'off']), default='strict') @click.option('--page-coordinate-consistency', help="How fierce to check PAGE multi-level coordinate consistency", type=click.Choice(['poly', 'baseline', 'both', 'off']), default='poly') @click.argument('mets_url') -def validate_workspace(ctx, mets_url, download, skip, page_strictness, page_coordinate_consistency): +def validate_workspace(ctx, mets_url, download, skip, page_textequiv_consistency, page_coordinate_consistency): report = WorkspaceValidator.validate( ctx.resolver, mets_url, src_dir=ctx.directory, skip=skip, download=download, - page_strictness=page_strictness, + page_strictness=page_textequiv_consistency, page_coordinate_consistency=page_coordinate_consistency ) print(report.to_xml())
workspace validator: fix CLI param name in 5ca8f<I>
OCR-D_core
train
py
861601a4329089266158d1c8011d3a8c2a5ab36a
diff --git a/neo.py b/neo.py index <HASH>..<HASH> 100755 --- a/neo.py +++ b/neo.py @@ -300,7 +300,6 @@ class Hg(object): f.write('[ui]\n') f.write(hook + '\n') - file = '^%s/' % file exclude = os.path.join(repo.path, '.hg/hgignore') try: with open(exclude) as f: @@ -313,7 +312,6 @@ class Hg(object): f.write(file + '\n') def unignore(repo, file): - file = '^%s/' % file exclude = os.path.join(repo.path, '.hg/hgignore') try: with open(exclude) as f:
Fixed Mercurial ignores to use non-regex format (since ignores now use glob, not regex)
ARMmbed_mbed-cli
train
py
8ccea007ea74326bb5f981ab8de49db506b3fc0c
diff --git a/lib/Response.php b/lib/Response.php index <HASH>..<HASH> 100644 --- a/lib/Response.php +++ b/lib/Response.php @@ -2,7 +2,7 @@ namespace Aerys; -interface Response { +interface Response extends \Amp\ByteStream\OutputStream { const NONE = 0b000; const STARTED = 0b001; const STREAMING = 0b010;
Extend OutputStream with Response
amphp_http-server
train
php
c1c9a2c96ce3d017bec3bd8478a205dbad90de8c
diff --git a/etcdserver/server.go b/etcdserver/server.go index <HASH>..<HASH> 100644 --- a/etcdserver/server.go +++ b/etcdserver/server.go @@ -450,6 +450,15 @@ func NewServer(cfg *ServerConfig) (srv *EtcdServer, err error) { plog.Warningf("consistent index never saved (snapshot index=%d)", snapshot.Metadata.Index) } } + newSrv := srv // since srv == nil in defer if srv is returned as nil + defer func() { + // closing backend without first closing kv can cause + // resumed compactions to fail with closed tx errors + if err != nil { + newSrv.kv.Close() + } + }() + srv.consistIndex.setConsistentIndex(srv.kv.ConsistentIndex()) tp, err := auth.NewTokenProvider(cfg.AuthToken, func(index uint64) <-chan struct{} {
etcdserver: close mvcc.KV on init error path Scheduled compaction will panic if KV is not stopped before closing the backend.
etcd-io_etcd
train
go
447e953bd1722522a4b442dbc6b1433467bfb892
diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index <HASH>..<HASH> 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -674,7 +674,7 @@ class Debugger extends Object { trigger_error(__('Please change the value of \'Security.salt\' in app/config/core.php to a salt value specific to your application', true), E_USER_NOTICE); } - if (Configure::read('Security.cipherSeed') == '76859309657453542496749683645') { + if (Configure::read('Security.cipherSeed') === '76859309657453542496749683645') { trigger_error(__('Please change the value of \'Security.cipherSeed\' in app/config/core.php to a numeric (digits only) seed value specific to your application', true), E_USER_NOTICE); } }
Add exact comparison to Debugger::checkSecurityKeys(). Fixes issues with modifying the value by one digit. Fixes #<I>
cakephp_cakephp
train
php
ee834e16b50f6d0d9360425216f658b930390a02
diff --git a/metpy/calc/thermo.py b/metpy/calc/thermo.py index <HASH>..<HASH> 100644 --- a/metpy/calc/thermo.py +++ b/metpy/calc/thermo.py @@ -772,7 +772,8 @@ def relative_humidity_from_mixing_ratio(mixing_ratio, temperature, pressure): Notes ----- - Formula from [Hobbs 1977]_ pg. 74. + Formula from [Hobbs1977]_ pg. 74. + .. math:: RH = 100 \frac{w}{w_s} * :math:`RH` is relative humidity @@ -806,6 +807,7 @@ def mixing_ratio_from_specific_humidity(specific_humidity): Notes ----- Formula from [Salby1996]_ pg. 118. + .. math:: w = \frac{q}{1-q} * :math:`w` is mxing ratio @@ -840,7 +842,8 @@ def relative_humidity_from_specific_humidity(specific_humidity, temperature, pre Notes ----- - Formula from [Hobbs 1977]_ pg. 74. and [Salby1996]_ pg. 118. + Formula from [Hobbs1977]_ pg. 74. and [Salby1996]_ pg. 118. + .. math:: RH = 100 \frac{q}{(1-q)w_s} * :math:`RH` is relative humidity
[MNT]: Fix equation and reference rendering issues introduced in #<I>.
Unidata_MetPy
train
py
217befdc28b36eee41a37474124ea6438081091b
diff --git a/mongo/mongo.go b/mongo/mongo.go index <HASH>..<HASH> 100644 --- a/mongo/mongo.go +++ b/mongo/mongo.go @@ -713,7 +713,7 @@ func packagesForSeries(series string) ([]string, []string) { switch series { case "precise", "quantal", "raring", "saucy", "centos7": return []string{"mongodb-server"}, []string{} - case "trusty", "wily", "xenial": + case "trusty", "wily": return []string{JujuMongoPackage, JujuMongoToolsPackage}, []string{"juju-mongodb"} default: // y and onwards diff --git a/mongo/mongo_test.go b/mongo/mongo_test.go index <HASH>..<HASH> 100644 --- a/mongo/mongo_test.go +++ b/mongo/mongo_test.go @@ -434,7 +434,8 @@ func (s *MongoSuite) TestInstallMongodFallsBack(c *gc.C) { {"precise", "mongodb-server"}, {"trusty", "juju-mongodb3.2\njuju-mongodb"}, {"wily", "juju-mongodb3.2\njuju-mongodb"}, - {"xenial", "juju-mongodb3.2\njuju-mongodb"}, + {"xenial", "juju-mongodb3.2"}, + {"bionic", "juju-mongodb3.2"}, } dataDir := c.MkDir()
On Xenial, we don't actually want to fall back to juju-mongodb. There was probably a transition period where this was useful, but we actually don't want to be running juju-mongodb on Xenial. See <URL>
juju_juju
train
go,go
02c5985a747463ec7d3fd670ddd8d3e08dbbb216
diff --git a/src/web/Menu.php b/src/web/Menu.php index <HASH>..<HASH> 100755 --- a/src/web/Menu.php +++ b/src/web/Menu.php @@ -27,6 +27,7 @@ class Menu protected $_data = []; protected $_current_item; + protected $_current_item_url; protected $_current_uri; @@ -70,11 +71,13 @@ class Menu } elseif (is_object($current)) { - $this->_current_item = $current->url(); + $this->_current_item = $current; + $this->_current_item_url = $current->url(); } elseif (is_array($current)) { - $this->_current_item = $current['url']; + $this->_current_item = $current; + $this->_current_item_url = $current['url']; } else {
current_item saves full object
levmorozov_mii
train
php
ae132643c7daf2d1d8fc63491bcf1ab25cef2355
diff --git a/examples/overviewmap-custom.js b/examples/overviewmap-custom.js index <HASH>..<HASH> 100644 --- a/examples/overviewmap-custom.js +++ b/examples/overviewmap-custom.js @@ -6,6 +6,8 @@ import TileLayer from '../src/ol/layer/Tile.js'; import OSM from '../src/ol/source/OSM.js'; +const rotateWithView = document.getElementById('rotateWithView'); + const overviewMapControl = new OverviewMap({ // see in overviewmap-custom.html to see the custom CSS used className: 'ol-overviewmap ol-custom-overviewmap', @@ -22,6 +24,10 @@ const overviewMapControl = new OverviewMap({ collapsed: false }); +rotateWithView.addEventListener('change', function() { + overviewMapControl.setRotateWithView(this.checked); +}); + const map = new Map({ controls: defaultControls().extend([ overviewMapControl
Add Rotate with view option Use a checkbox to demonstrate the rotateWithView option
openlayers_openlayers
train
js
ed34f450f1fb49ee7b5806b1d8d405424b062656
diff --git a/lib/client.js b/lib/client.js index <HASH>..<HASH> 100644 --- a/lib/client.js +++ b/lib/client.js @@ -357,10 +357,15 @@ Client.prototype = { detectFileFormat: function(path) { var format = path.match(/\.([^\.]+)$/i); + var supportedFormats = ['xml', 'json']; if (!format) - this.raiseFatalError('Unknown format'); + this.raiseFatalError("Couldn't detect format"); format = format[1].toLowerCase(); + + if (supportedFormats.indexOf(format) < 0) + this.raiseFatalError('Unknown format'); + return format; }, readSDFBatch: function(path, format) {
Detect only known (supported) formats
groonga_gcs
train
js
4057da930e93fd7fa39e8c32192f4dad50c3a07a
diff --git a/app/assets/javascripts/template_invocation.js b/app/assets/javascripts/template_invocation.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/template_invocation.js +++ b/app/assets/javascripts/template_invocation.js @@ -30,22 +30,17 @@ function refresh_search_query(value){ } function show_preview_hosts_modal() { - var modal_window = $('#previewHostsModal'); - var form = $('form#job_invocation_form'); var data = form.serializeArray(); - request = $.ajax({ data: data, type: 'GET', - url: modal_window.attr('data-url'), - success: function(request) { - modal_window.find('.modal-body').html(request); - }, - complete: function() { - modal_window.modal({'show': true}); - modal_window.find('a[rel="popover-modal"]').popover(); - } + url: $('#previewHostsModal').attr('data-url') + }).then(function(result){ + var modal_window = $('#previewHostsModal'); + modal_window.find('.modal-body').html(result); + modal_window.modal({'show': true}); + modal_window.find('a[rel="popover-modal"]').popover(); }); }
Fixes #<I> - Preview in job invocation works without refresh
theforeman_foreman_remote_execution
train
js
4c759040e7f24a489ea0a94bdbcced0f2627c244
diff --git a/Metadata/FormTypeMetadataLoader.php b/Metadata/FormTypeMetadataLoader.php index <HASH>..<HASH> 100644 --- a/Metadata/FormTypeMetadataLoader.php +++ b/Metadata/FormTypeMetadataLoader.php @@ -135,8 +135,8 @@ class FormTypeMetadataLoader implements FormMetadataLoaderInterface $form = new FormMetadata(); $configuration = $type->getConfiguration(); $properties = $this->propertiesXmlLoader->load($configuration->getXmlPath()); - $this->formMetadataMapper->mapChildren($properties->getProperties(), $form, $locale); + $form->setItems($this->formMetadataMapper->mapChildren($properties->getProperties(), $locale)); $form->setName($typeKey); $form->setTitle($this->translator->trans($configuration->getTitle(), [], 'admin'));
Adapted metadata loader slightly
sulu_SuluFormBundle
train
php
bc043064ba61848c32a55620291dd4d8a4253ae3
diff --git a/gpflow/quadrature/deprecated.py b/gpflow/quadrature/deprecated.py index <HASH>..<HASH> 100644 --- a/gpflow/quadrature/deprecated.py +++ b/gpflow/quadrature/deprecated.py @@ -188,10 +188,10 @@ def ndiag_mc(funcs, S: int, Fmu, Fvar, logspace: bool = False, epsilon=None, **Y Fmu, Fvar, Ys should all have same shape, with overall size `N` :return: shape is the same as that of the first Fmu """ - N, D = Fmu.shape[0], Fvar.shape[1] + N, D = tf.shape(Fmu)[0], tf.shape(Fvar)[1] if epsilon is None: - epsilon = tf.random.normal((S, N, D), dtype=default_float()) + epsilon = tf.random.normal(shape=[S, N, D], dtype=default_float()) mc_x = Fmu[None, :, :] + tf.sqrt(Fvar[None, :, :]) * epsilon mc_Xr = tf.reshape(mc_x, (S * N, D))
Quickfix dynamic shapes in quadrature (#<I>)
GPflow_GPflow
train
py
8e1f524153df6aa864611f7c6a016287e9dcb63e
diff --git a/modules/ngMeteor-collections.js b/modules/ngMeteor-collections.js index <HASH>..<HASH> 100644 --- a/modules/ngMeteor-collections.js +++ b/modules/ngMeteor-collections.js @@ -71,7 +71,8 @@ AngularMeteorCollection.prototype.save = function save(docs) { function upsertObject(item, $q) { var deferred = $q.defer(); - item = angular.copy(item); // Makes a deep copy without the $$hashKeys. + item = angular.copy(item); + delete item.$$hashKeys; if (item._id) { // Performs an update if the _id property is set. var item_id = item._id; // Store the _id in temporary variable
Remove $$hashKeys when upserting $$hashKeys will sometimes cause upserting to fail with the below error: > Error: key $$hashKey must not start with '$'
Urigo_angular-meteor
train
js
496e2544f45600484d2d7fd08b5fd37fa4de5e00
diff --git a/tests/test_web_request.py b/tests/test_web_request.py index <HASH>..<HASH> 100644 --- a/tests/test_web_request.py +++ b/tests/test_web_request.py @@ -101,3 +101,10 @@ class TestWebRequest(unittest.TestCase): ret = self.loop.run_until_complete(req.POST()) self.assertEqual(MultiDict(), ret) + + def test_call_POST_twice(self): + req = self.make_request('GET', '/') + + ret1 = self.loop.run_until_complete(req.POST()) + ret2 = self.loop.run_until_complete(req.POST()) + self.assertIs(ret1, ret2)
Add test on getting request.POST twice
aio-libs_aiohttp
train
py
be3c6827883d3726beb2b8d361987f0efb0e8950
diff --git a/kconfiglib.py b/kconfiglib.py index <HASH>..<HASH> 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -1038,12 +1038,13 @@ class Kconfig(object): 'strerror', and 'filename' are available). Note that IOError can be caught as OSError on Python 3. - filename: + filename (default: None): Path to load configuration from (a string). Respects $srctree if set (see the class documentation). - If 'filename' is None, the configuration file to load (if any) is - calculated automatically, giving the behavior you'd usually want: + If 'filename' is None (the default), the configuration file to load + (if any) is calculated automatically, giving the behavior you'd + usually want: 1. If the KCONFIG_CONFIG environment variable is set, it gives the path to the configuration file to load. Otherwise, ".config" is @@ -1311,8 +1312,8 @@ class Kconfig(object): filename (default: None): Filename to save configuration to (a string). - If None, the filename in the the environment variable KCONFIG_CONFIG - is used if set, and ".config" otherwise. See + If None (the default), the filename in the the environment variable + KCONFIG_CONFIG is used if set, and ".config" otherwise. See standard_config_filename(). header (default: "# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)\n"):
Clarify that load_config()'s filename argument defaults to None Had missed the '(default: None)', and it doesn't hurt to point it out in the description either. Point out that filename=None is the default in the write_config() 'filename' description too, though it already had the '(default: None)'.
ulfalizer_Kconfiglib
train
py
13b9027836f909a1b61f521f5735c08d828cf5f0
diff --git a/Reflection/Factory.php b/Reflection/Factory.php index <HASH>..<HASH> 100644 --- a/Reflection/Factory.php +++ b/Reflection/Factory.php @@ -17,6 +17,20 @@ class Factory { public function createMethod($objectOrClass, $methodName) { - return new \ReflectionMethod($objectOrClass, $methodName); + $class = is_object($objectOrClass) ? get_class($objectOrClass) : (string) $objectOrClass; + + $class = $this->getUserClass($class); + + return new \ReflectionMethod($class, $methodName); + } + + private function getUserClass($class) + { + if(class_exists('CG\Core\ClassUtils', true)) + { + return \CG\Core\ClassUtils::getUserClass($class); + } + + return $class; } } \ No newline at end of file
[#3] fix compatibility to new versions of JMS bundles
psliwa_PdfBundle
train
php
ea3700199cbeaed0445b69b8c868113ade66041b
diff --git a/cmd/shfmt/json.go b/cmd/shfmt/json.go index <HASH>..<HASH> 100644 --- a/cmd/shfmt/json.go +++ b/cmd/shfmt/json.go @@ -30,6 +30,9 @@ func recurse(val reflect.Value) (interface{}, string) { } return recurse(elem) case reflect.Interface: + if val.IsNil() { + return nil, "" + } v, tname := recurse(val.Elem()) m := v.(map[string]interface{}) m["Type"] = tname
cmd/shfmt: fix panic on Stmts without Command in -exp.tojson Don't recurse into nil interfaces.
mvdan_sh
train
go
390101d763bd93488d7f6595f3de45b9527fcbe4
diff --git a/src/EventDispatcher/Dispatcher.php b/src/EventDispatcher/Dispatcher.php index <HASH>..<HASH> 100644 --- a/src/EventDispatcher/Dispatcher.php +++ b/src/EventDispatcher/Dispatcher.php @@ -1,4 +1,5 @@ <?php +declare(strict_types = 1); namespace SimpleCrud\EventDispatcher; diff --git a/src/EventDispatcher/ListenerProvider.php b/src/EventDispatcher/ListenerProvider.php index <HASH>..<HASH> 100644 --- a/src/EventDispatcher/ListenerProvider.php +++ b/src/EventDispatcher/ListenerProvider.php @@ -1,4 +1,5 @@ <?php +declare(strict_types = 1); namespace SimpleCrud\EventDispatcher;
strict types in eventDispatcher #<I>
oscarotero_simple-crud
train
php,php
af678b6688d925b287f67359b3721bb19a05e079
diff --git a/src/js/core.js b/src/js/core.js index <HASH>..<HASH> 100644 --- a/src/js/core.js +++ b/src/js/core.js @@ -70,7 +70,7 @@ this.options.editor.serialize = this.editorSerialize; this.options.editor.destroy = this.editorDestroy; this.options.editor.setup = this.editorSetup; - this.options.editor.activatePlaceholder = this.editorActivatePlaceholder; + this.options.editor.placeholders.updatePlaceholder = this.editorUpdatePlaceholder; } } @@ -191,12 +191,12 @@ }; /** - * Extend editor's activatePlaceholder function to activate placeholder dispite of the plugin buttons + * Extend editor's placeholder.updatePlaceholder function to show placeholder dispite of the plugin buttons * * @return {void} */ - Core.prototype.editorActivatePlaceholder = function (el) { + Core.prototype.editorUpdatePlaceholder = function (el) { var $clone = $(el).clone(), cloneHtml; @@ -207,8 +207,10 @@ !(el.querySelector('blockquote')) && cloneHtml === '') { - el.classList.add('medium-editor-placeholder'); - this._hideInsertButtons($(el)); + this.showPlaceholder(el); + this.base._hideInsertButtons($(el)); + } else { + this.hidePlaceholder(el); } };
fix removed activatePlaceholder method in editor
orthes_medium-editor-insert-plugin
train
js
5bb3ffead9aa04578c921e064a6eeddf43276ecd
diff --git a/lib/h3/bindings/private.rb b/lib/h3/bindings/private.rb index <HASH>..<HASH> 100644 --- a/lib/h3/bindings/private.rb +++ b/lib/h3/bindings/private.rb @@ -8,6 +8,7 @@ module H3 extend H3::Bindings::Base attach_function :compact, [H3IndexesIn, H3IndexesOut, :size], :bool + attach_function :destroy_linked_polygon, :destroyLinkedPolygon, [LinkedGeoPolygon], :void attach_function :geo_to_h3, :geoToH3, [GeoCoord, Resolution], :h3_index attach_function :h3_indexes_from_unidirectional_edge, :getH3IndexesFromUnidirectionalEdge, diff --git a/lib/h3/regions.rb b/lib/h3/regions.rb index <HASH>..<HASH> 100644 --- a/lib/h3/regions.rb +++ b/lib/h3/regions.rb @@ -142,6 +142,8 @@ module H3 Bindings::Private.h3_set_to_linked_geo(h3_set, h3_indexes.size, linked_geo_polygon) extract_linked_geo_polygon(linked_geo_polygon).first + ensure + Bindings::Private.destroy_linked_polygon(linked_geo_polygon) end private
Free the linked polygon. After reading the FFI literature closely, it may be wise to use the built-in function from H3 to destroy linked polygons. We may avoid a memory leak this way.
StuartApp_h3_ruby
train
rb,rb
b2f650848340378b6484dc40bbe0a84bae6f94e3
diff --git a/quarkc/_metadata.py b/quarkc/_metadata.py index <HASH>..<HASH> 100644 --- a/quarkc/_metadata.py +++ b/quarkc/_metadata.py @@ -19,7 +19,7 @@ __all__ = [ "__license__", "__copyright__", ] -__title__ = 'datawire-quark' +__title__ = 'datawire-quarkdev' __version__ = '1.0.70' __summary__ = "Quark: an IDL for high level (micro)service interfaces"
Changed version to datawire-quarkdev, <I> (doc 1). [ci skip]
datawire_quark
train
py
38b23416709cdd361ce8054763ebd100cb7157c9
diff --git a/spyder/plugins/projects.py b/spyder/plugins/projects.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/projects.py +++ b/spyder/plugins/projects.py @@ -199,12 +199,14 @@ class Projects(ProjectExplorerWidget, SpyderPluginMixin): @Slot() def create_new_project(self): """Create new project""" + active_project = self.current_active_project dlg = ProjectDialog(self) dlg.sig_project_creation_requested.connect(self._create_project) dlg.sig_project_creation_requested.connect(self.sig_project_created) if dlg.exec_(): pass - self.show_explorer() + if active_project is None: + self.show_explorer() def _create_project(self, path, ptype, packages): """Create a new project."""
Projects: Show explorer when creating a new project if there's no active project
spyder-ide_spyder
train
py
1c073cb8d8cbcd41d96c810ea5401175483bb748
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -65,7 +65,7 @@ def read(*parts): return codecs.open(os.path.join(os.path.abspath(os.path.dirname(__file__)), *parts), 'r').read() setup(name="faketime", - version="0.9.6.5", + version="0.9.6.6", description="Libfaketime wrapper.", long_description=read('README.rst'), classifiers=[
RELEASE : Bumped version.
crdoconnor_faketime
train
py
d35c36f30895bbcef275b1416a1842e8f3172882
diff --git a/fedmsg_atomic_composer/composer.py b/fedmsg_atomic_composer/composer.py index <HASH>..<HASH> 100644 --- a/fedmsg_atomic_composer/composer.py +++ b/fedmsg_atomic_composer/composer.py @@ -151,14 +151,18 @@ class AtomicComposer(object): datetime.utcnow() - start) def call(self, cmd, **kwargs): + """A simple subprocess wrapper""" self.log.info('Running %s', cmd) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs) out, err = p.communicate() + if out: + self.log.info(out) if err: self.log.error(err) if p.returncode != 0: self.log.error('returncode = %d' % p.returncode) + raise Exception return out, err, p.returncode def update_ostree_summary(self, release):
composer: Error handling and stdout logging in our subprocess wrapper
fedora-infra_fedmsg-atomic-composer
train
py
04e54c0d898b6a0bdb6ab9b91663b9094425cb9f
diff --git a/lib/Model.js b/lib/Model.js index <HASH>..<HASH> 100644 --- a/lib/Model.js +++ b/lib/Model.js @@ -523,17 +523,18 @@ function Model(opts) { is_new : true, autoSave : opts.autoSave, autoFetch : false - }); - Instances[idx].save(function (err) { - if (err) { - err.index = idx; - err.instance = Instances[idx]; + }, function () { + Instances[idx].save(function (err) { + if (err) { + err.index = idx; + err.instance = Instances[idx]; - return cb(err); - } + return cb(err); + } - idx += 1; - createNext(); + idx += 1; + createNext(); + }); }); };
Changes Model.create() to wait for createInstance callback instead of using the returned value
dresende_node-orm2
train
js
e2e72a275d47fc4ce3dabcb65373412f9e458900
diff --git a/core/src/main/java/com/google/bitcoin/store/WalletProtobufSerializer.java b/core/src/main/java/com/google/bitcoin/store/WalletProtobufSerializer.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/bitcoin/store/WalletProtobufSerializer.java +++ b/core/src/main/java/com/google/bitcoin/store/WalletProtobufSerializer.java @@ -457,7 +457,7 @@ public class WalletProtobufSerializer { } if (txProto.hasLockTime()) { - tx.setLockTime(txProto.getLockTime()); + tx.setLockTime(0xffffffffL & txProto.getLockTime()); } // Transaction should now be complete.
Fix deserialization of wallet transactions with a far-out locktime.
bitcoinj_bitcoinj
train
java
8a549022f9604d3a41441c0d07cd32facba07ead
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -127,7 +127,7 @@ additions for Django projects. See the project page for more information: packages=packages, cmdclass=cmdclasses, package_data=package_data, - install_requires=['six>=1.2'], + install_requires=['six>=1.2', 'typing'], tests_require=[ 'Django', 'shortuuid',
add typing to install_requires
django-extensions_django-extensions
train
py
f6bbe463e01950e82866cac45487bbea2f29e50c
diff --git a/commands/XmlSoccerController.php b/commands/XmlSoccerController.php index <HASH>..<HASH> 100644 --- a/commands/XmlSoccerController.php +++ b/commands/XmlSoccerController.php @@ -272,7 +272,11 @@ class XmlSoccerController extends Controller $this->stdout("Team '{$dbTeam->name}' saved", Console::FG_GREEN); $this->stdout("\n"); - $players = array_merge($players, $client->getPlayersByTeam(ArrayHelper::getValue($team, 'Team_Id'))); + $teamPlayers = $client->getPlayersByTeam(ArrayHelper::getValue($team, 'Team_Id')); + if (ArrayHelper::isAssociative($teamPlayers) && ArrayHelper::keyExists('Name', $teamPlayers)) { + $teamPlayers = [$teamPlayers]; + } + $players = array_merge($players, $teamPlayers); } }
ensure numeric array (players by team)
drsdre_yii2-xmlsoccer
train
php
7a7b8624b2f671d2310e959034dd84207412e85f
diff --git a/airflow/bin/cli.py b/airflow/bin/cli.py index <HASH>..<HASH> 100755 --- a/airflow/bin/cli.py +++ b/airflow/bin/cli.py @@ -212,9 +212,9 @@ def clear(args): dag = dagbag.dags[args.dag_id] if args.start_date: - args.start_date = datetime.strptime(args.start_date, '%Y-%m-%d') + args.start_date = dateutil.parser.parse(args.start_date) if args.end_date: - args.end_date = datetime.strptime(args.end_date, '%Y-%m-%d') + args.end_date = dateutil.parser.parse(args.end_date) if args.task_regex: dag = dag.sub_dag(
[cli] improved datetime parsing for the "clear" command
apache_airflow
train
py
166e6b9921e92a57b40799bba41c18dc1484a0da
diff --git a/modules/@apostrophecms/schema/index.js b/modules/@apostrophecms/schema/index.js index <HASH>..<HASH> 100644 --- a/modules/@apostrophecms/schema/index.js +++ b/modules/@apostrophecms/schema/index.js @@ -1937,6 +1937,7 @@ module.exports = { } else if (field.type === 'array') { if (doc[field.name]) { doc[field.name].forEach(item => { + item._id = self.apos.launder.id(item._id) || self.apos.util.generateId(); item.metaType = 'arrayItem'; item.scopedArrayName = field.scopedArrayName; forSchema(field.schema, item);
Ensure array field items have valid _id prop before storing
apostrophecms_apostrophe
train
js
1b0bac3d63330a742f8a57e5b61fc3f989577b59
diff --git a/sim/evol.py b/sim/evol.py index <HASH>..<HASH> 100644 --- a/sim/evol.py +++ b/sim/evol.py @@ -58,7 +58,7 @@ pNames.append('cmdmaxrate'); pRanges.append([10,30]) num_inputs = len(pNames) # Set bounds and allowed ranges for params -def bound_params(candidate, args): +def bound_params(candidate, args = []): cBound = [] for i,p in enumerate(candidate): cBound.append(max(min(p, max(pRanges[i])), min(pRanges[i])))
<I>mar<I>_Evol krichmar_v3 - with sams mutator - further debugging - added boudner to mutator
Neurosim-lab_netpyne
train
py
aa061008f558888679ac954b352889598c8856ce
diff --git a/js/itbit.js b/js/itbit.js index <HASH>..<HASH> 100644 --- a/js/itbit.js +++ b/js/itbit.js @@ -266,9 +266,9 @@ module.exports = class itbit extends Exchange { let walletIdInParams = ('walletId' in params); if (!walletIdInParams) throw new ExchangeError (this.id + ' fetchOrder requires a walletId parameter'); - return await this.privateGetWalletsWalletIdOrdersId (this.extend ({ - 'id': id, - }, params)); + let response = await this.privateGetWalletsWalletIdOrdersId (this.extend ({ + 'id': id,}, params)); + return (this.parseOrder(response)); } async cancelOrder (id, symbol = undefined, params = {}) {
Updated fetchOrder to provide unified response via parseOrder
ccxt_ccxt
train
js
be061e74db34de2c3ef6a26dad814d4c5198ba8a
diff --git a/toothpick-compiler/src/main/java/toothpick/compiler/factory/FactoryProcessor.java b/toothpick-compiler/src/main/java/toothpick/compiler/factory/FactoryProcessor.java index <HASH>..<HASH> 100644 --- a/toothpick-compiler/src/main/java/toothpick/compiler/factory/FactoryProcessor.java +++ b/toothpick-compiler/src/main/java/toothpick/compiler/factory/FactoryProcessor.java @@ -317,7 +317,7 @@ public class FactoryProcessor extends ToothpickProcessor { if (!isInjectableWarningSuppressed(typeElement)) { warning(typeElement, // - "The class %s has injected fields but has no injected constructor, and no public default constructor." // + "The class %s has injected fields but has no injected constructor, and no non-private default constructor." // + " Toothpick can't create a factory for it.", typeElement.getQualifiedName().toString()); } return null;
change visibility of required constructor in error message. TP supports all non private constructors
stephanenicolas_toothpick
train
java
e355275c57812af0f4c795f229382afdda4bca86
diff --git a/git/test/performance/lib.py b/git/test/performance/lib.py index <HASH>..<HASH> 100644 --- a/git/test/performance/lib.py +++ b/git/test/performance/lib.py @@ -3,7 +3,6 @@ import os from git.test.lib import ( TestBase ) -from gitdb.test.lib import skip_on_travis_ci import tempfile import logging @@ -43,8 +42,6 @@ class TestBigRepoR(TestBase): #} END invariants def setUp(self): - # This will raise on travis, which is what we want to happen early as to prevent us to do any work - skip_on_travis_ci(lambda *args: None)(self) try: super(TestBigRepoR, self).setUp() except AttributeError:
imp(performance): execute performance tests on travis Fixes #<I>
gitpython-developers_GitPython
train
py
71fb7ad41dedf7d92853f929048621d51e000ac8
diff --git a/lfsapi/auth.go b/lfsapi/auth.go index <HASH>..<HASH> 100644 --- a/lfsapi/auth.go +++ b/lfsapi/auth.go @@ -49,10 +49,10 @@ func (c *Client) DoWithAuth(remote string, req *http.Request) (*http.Response, e c.Endpoints.SetAccess(apiEndpoint.Url, newAccess) } - if access == NoneAccess || creds != nil { + if creds != nil || (access == NoneAccess && len(req.Header.Get("Authorization")) == 0) { tracerx.Printf("api: http response indicates %q authentication. Resubmitting...", newAccess) - req.Header.Del("Authorization") if creds != nil { + req.Header.Del("Authorization") credHelper.Reject(creds) } return c.DoWithAuth(remote, req)
lfsapi: retry requests changing access from none IF Auth header is empty
git-lfs_git-lfs
train
go
38f297b0611a546b2dea5e9e4d0f6d94268427f2
diff --git a/features/support/hooks.rb b/features/support/hooks.rb index <HASH>..<HASH> 100644 --- a/features/support/hooks.rb +++ b/features/support/hooks.rb @@ -3,6 +3,7 @@ require 'phuture' Before('@sudo') do system 'sudo -v' + @aruba_timeout_seconds = 5 end After('@sudo') do
Increase aruba timeout 3 to 5.
trema_phut
train
rb
7bdea5954a537245ecb5b9bb6cb446805f7e2578
diff --git a/pylru.py b/pylru.py index <HASH>..<HASH> 100644 --- a/pylru.py +++ b/pylru.py @@ -534,19 +534,7 @@ def lruwrap(store, size, writeback=False): class lrudecorator(object): def __init__(self, size): - self.cache = lrucache(size) + self.size = size def __call__(self, func): - def wrapped(*args, **kwargs): - kwtuple = tuple((key, kwargs[key]) for key in sorted(kwargs.keys())) - key = (args, kwtuple) - try: - return self.cache[key] - except KeyError: - pass - - value = func(*args, **kwargs) - self.cache[key] = value - return value - wrapped.cache = self.cache - return wrapped + return FunctionCacheManager(func, self.size)
Refactored lrudecorator using FunctionCacheManager.
jlhutch_pylru
train
py
57f33b08dd7c46873630ceef35170c6bfd328007
diff --git a/src/uppy-react/DashboardModal.js b/src/uppy-react/DashboardModal.js index <HASH>..<HASH> 100644 --- a/src/uppy-react/DashboardModal.js +++ b/src/uppy-react/DashboardModal.js @@ -17,6 +17,8 @@ class DashboardModal extends React.Component { const uppy = this.props.uppy uppy.use(ReactDashboardPlugin, { target: this.container, + disableInformer: true, + disableStatusBar: true, locale: this.props.locale, maxWidth: this.props.maxWidth, maxHeight: this.props.maxHeight,
react: Fix duplicate Informer and StatusBar in DashboardModal component
transloadit_uppy
train
js
aba588a72635d8da9f6789052daed62e60ca6702
diff --git a/lib/filelib.php b/lib/filelib.php index <HASH>..<HASH> 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -561,9 +561,9 @@ function byteserving_send_file($filename, $mimetype, $ranges) { } else { // multiple ranges requested - not tested much $totallength = 0; foreach($ranges as $range) { - $totallength .= strlen($range[0]) + $range[2] - $range[1] + 1; + $totallength += strlen($range[0]) + $range[2] - $range[1] + 1; } - $totallength .= strlen("\r\n--".BYTESERVING_BOUNDARY."--\r\n"); + $totallength += strlen("\r\n--".BYTESERVING_BOUNDARY."--\r\n"); @header('HTTP/1.1 206 Partial content'); @header('Content-Length: '.$totallength); @header('Content-Type: multipart/byteranges; boundary='.BYTESERVING_BOUNDARY);
Bug #<I> - Incorrect length in http partial content (<I>) packets.; merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
a91848142d6b299f76b5242c1c7474dd7dc94be2
diff --git a/src/RequestHandler.php b/src/RequestHandler.php index <HASH>..<HASH> 100644 --- a/src/RequestHandler.php +++ b/src/RequestHandler.php @@ -65,7 +65,7 @@ class RequestHandler /** * Timer that handles stopping the worker if script has excceed the max execution time * - * @var TimerInterface + * @var TimerInterface|null */ private $maxExecutionTimer; @@ -292,6 +292,8 @@ class RequestHandler $this->incoming->end(); if ($this->maxExecutionTime > 0) { $this->loop->cancelTimer($this->maxExecutionTimer); + //Explicitly null the property to avoid a cyclic memory reference + $this->maxExecutionTimer = null; } if ($this->slave->getStatus() === Slave::LOCKED) {
Fix a small memory leak with the RequestHandler (#<I>)
php-pm_php-pm
train
php
585e7a6a11514afd5a75c25fcae98d780699bea3
diff --git a/modules/custom/d_p/src/Plugin/Field/FieldWidget/SettingsWidget.php b/modules/custom/d_p/src/Plugin/Field/FieldWidget/SettingsWidget.php index <HASH>..<HASH> 100644 --- a/modules/custom/d_p/src/Plugin/Field/FieldWidget/SettingsWidget.php +++ b/modules/custom/d_p/src/Plugin/Field/FieldWidget/SettingsWidget.php @@ -69,7 +69,7 @@ class SettingsWidget extends WidgetBase { * Get configuration options for fields in paragraph settings. */ private static function getConfigOptions() { - return [ + $form = [ self::CSS_CLASS_SETTING_NAME => [ 'title' => t('Additional classes for the paragraph'), 'description' => t('Please separate multiple classes by spaces.'), @@ -434,6 +434,8 @@ class SettingsWidget extends WidgetBase { ], ], ]; + + return \Drupal::moduleHandler()->alter('d_settings', $form); } /**
Add alter to d_settings
droptica_droopler
train
php
c7756e2f578439041eff23feccb0edd21f8d570a
diff --git a/lib/engineyard/cli.rb b/lib/engineyard/cli.rb index <HASH>..<HASH> 100644 --- a/lib/engineyard/cli.rb +++ b/lib/engineyard/cli.rb @@ -39,16 +39,7 @@ module EY desc "rebuild [ENV]", "Rebuild environment (ensure configuration is up-to-date)" def rebuild(name = nil) - env = if name - env = api.environments.match_one!(name) - end - - unless env - repo = Repo.new - app = api.fetch_app_for_repo(repo) - env = app.one_and_only_environment or raise NoSingleEnvironmentError.new(app) - end - + env = fetch_environment(name) EY.ui.debug("Rebuilding #{env.name}") env.rebuild end
Refactor "ey rebuild" to use CLI's helper methods. Change-Id: I0a<I>def<I>bf<I>a<I>cefe<I>d<I>c<I>c3c Reviewed-on: <URL>
engineyard_engineyard
train
rb
259734e16c48ad16720b25f207406c6a933a8bde
diff --git a/elifetools/parseJATS.py b/elifetools/parseJATS.py index <HASH>..<HASH> 100644 --- a/elifetools/parseJATS.py +++ b/elifetools/parseJATS.py @@ -559,13 +559,16 @@ def format_contributor(contrib_tag, soup, detail="brief"): # Brief format only allows one aff and it must be within the contrib tag aff_tag = first(extract_nodes(contrib_tag, "aff")) if aff_tag: - contributor['affiliation'] = {} + contributor['affiliation'] = [] + contrib_affs = {} (none_return, aff_detail) = format_aff(aff_tag) if len(aff_detail) > 0: aff_attributes = ['dept', 'institution', 'country', 'city'] for aff_attribute in aff_attributes: if aff_attribute in aff_detail and aff_detail[aff_attribute] is not None: - copy_attribute(aff_detail, aff_attribute, contributor['affiliation']) + copy_attribute(aff_detail, aff_attribute, contrib_affs) + if len(contrib_affs) > 0: + contributor['affiliation'].append(contrib_affs) elif detail == "full": # person_id
Turn simple inline affiliations to a list.
elifesciences_elife-tools
train
py
73e604cb8304a11857639755c70ea5769465b4e2
diff --git a/tests/tests/test_cluster.py b/tests/tests/test_cluster.py index <HASH>..<HASH> 100644 --- a/tests/tests/test_cluster.py +++ b/tests/tests/test_cluster.py @@ -356,7 +356,7 @@ class ClusterTest(TestCase): # queried instance is more specific self.assertEqual( - list(beatles.members.filter(favourite_restaurant=the_yellow_submarine)), + list(beatles.members.filter(favourite_restaurant=self.the_yellow_submarine)), [ringo] ) @@ -605,11 +605,11 @@ class ClusterTest(TestCase): ) # Using an exact proprietor comparisson self.assertEqual( - tuple(band.members.filter(favourite_restaurant__proprietor=gordon)), + tuple(band.members.filter(favourite_restaurant__proprietor=self.gordon_ramsay)), (band.members.get(name="John Lennon"),) ) self.assertEqual( - tuple(band.members.filter(favourite_restaurant__proprietor=marco)), + tuple(band.members.filter(favourite_restaurant__proprietor=self.marco_pierre_white)), (band.members.get(name="Ringo Starr"),) )
Fix a couple of references to shared chefs/restuarants
wagtail_django-modelcluster
train
py
4ecf393f5029e1cd03b05fe59ac484c28448dee6
diff --git a/autofit/mapper/prior/abstract.py b/autofit/mapper/prior/abstract.py index <HASH>..<HASH> 100644 --- a/autofit/mapper/prior/abstract.py +++ b/autofit/mapper/prior/abstract.py @@ -9,6 +9,9 @@ from autofit.mapper.prior.deferred import DeferredArgument from autofit.mapper.variable import Variable +epsilon = 1e-14 + + class Prior(Variable, ABC, ArithmeticMixin): __database_args__ = ( "lower_limit", @@ -45,7 +48,7 @@ class Prior(Variable, ABC, ArithmeticMixin): def assert_within_limits(self, value): if not ( - self.lower_limit <= value <= self.upper_limit + self.lower_limit - epsilon <= value <= self.upper_limit + epsilon ): raise exc.PriorLimitException( "The physical value {} for a prior " diff --git a/autofit/mapper/prior/prior.py b/autofit/mapper/prior/prior.py index <HASH>..<HASH> 100644 --- a/autofit/mapper/prior/prior.py +++ b/autofit/mapper/prior/prior.py @@ -5,8 +5,7 @@ from autofit import exc from autofit.messages.normal import NormalMessage, UniformNormalMessage from autofit.messages.transform import log_10_transform from autofit.messages.transform_wrapper import TransformedWrapperInstance - -epsilon = 1e-14 +from .abstract import epsilon class Limits:
allow epsilon either side of limit during value for prior assertion
rhayes777_PyAutoFit
train
py,py
7985e72a885792df70a2bad5e33a5a12790d5224
diff --git a/tests/JSUglifyTest.php b/tests/JSUglifyTest.php index <HASH>..<HASH> 100644 --- a/tests/JSUglifyTest.php +++ b/tests/JSUglifyTest.php @@ -31,8 +31,8 @@ class JSUglifyTest extends \PHPUnit_Framework_TestCase /** - * Tests to see if it fails with the expected exception on a non file - * @expectedException UglifyJSException + * Tests to see if it fails with the expected exception when ran on a non file + * @expectedException \Chewett\UglifyJs\UglifyJSException */ public function testFileNotReadable() { $ug = new JSUglify(); @@ -58,6 +58,16 @@ class JSUglifyTest extends \PHPUnit_Framework_TestCase } /** + * Test to make sure that an exception is thrown when uglify is ran when the exe is missing + * @expectedException \Chewett\UglifyJs\UglifyJSException + */ + public function testRunningUglifyJsWhenMissingExe() { + $ug = new JSUglify(); + $ug->setUglifyBinaryPath("not_uglifyjs"); + $ug->uglify([__DIR__ . '/../vendor/components/jquery/jquery.js'], self::$buildDir . 'jquery.min.js'); + } + + /** * Tests to see if minifying multiple files throws an error */ public function testRunningOnTwitterBootstrap() {
Added new tests for the new version to allow header files
chewett_php-uglifyjs
train
php
868252ae40855793616a11ee4317c599215b2f5b
diff --git a/src/main/java/org/redmine/ta/internal/logging/LoggerFactory.java b/src/main/java/org/redmine/ta/internal/logging/LoggerFactory.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/redmine/ta/internal/logging/LoggerFactory.java +++ b/src/main/java/org/redmine/ta/internal/logging/LoggerFactory.java @@ -100,7 +100,8 @@ public final class LoggerFactory { } // valid properties loaded? If not, we will use the default configuration. if ((properties == null) || (!properties.containsKey(PROPERTY_KEY_LOGLEVEL))) { - System.err.println("No valid logging configuration could be loaded [" + PROPERTIES_FILE_NAME + "] => using default configuration"); + System.out.println("Using default logging configuration. You can add \"" + PROPERTIES_FILE_NAME + "\" file to the classpath to override." + + " See http://code.google.com/p/redmine-java-api/issues/detail?id=95"); properties = createDefaultConfiguration(); } // inspect properties for log level to use
Issue <I>: No valid logging configuration could be loaded [redmine.log.properties] => using default configuration. improved the warning message shown when no log file is provided
taskadapter_redmine-java-api
train
java
a27573e6d0eed357736c51fad6e2abdd4ebafc85
diff --git a/concrete/src/Attribute/Category/AbstractCategory.php b/concrete/src/Attribute/Category/AbstractCategory.php index <HASH>..<HASH> 100644 --- a/concrete/src/Attribute/Category/AbstractCategory.php +++ b/concrete/src/Attribute/Category/AbstractCategory.php @@ -401,9 +401,8 @@ abstract class AbstractCategory implements CategoryInterface, StandardSearchInde $genericValue = $attributeValue->getGenericValue(); if ($genericValue !== null) { - $genericValues = $this->getAttributeValueRepository()->findBy(['generic_value' => $genericValue]); - if (count($genericValues) == 1) { - + $genericValues = $this->getAttributeValueRepository()->count(['generic_value' => $genericValue]); + if ($genericValues == 1) { // Handle legacy attributes with these three lines. $controller = $attributeValue->getAttributeKey()->getController(); $controller->setAttributeValue($attributeValue);
improve the performance of the deleteValue method by using count instead of findBy (time time exceeded for a site with thousands of pages and more than <I> versions per page)
concrete5_concrete5
train
php
16decd041c30098ed3bf3f70df8ba0d3eecf61d8
diff --git a/src/RestClient/SalesforceRestClient.php b/src/RestClient/SalesforceRestClient.php index <HASH>..<HASH> 100644 --- a/src/RestClient/SalesforceRestClient.php +++ b/src/RestClient/SalesforceRestClient.php @@ -125,7 +125,11 @@ class SalesforceRestClient $isAuthorized = $this->isResponseAuthorized($response); if (!$isAuthorized) { + + // Back off the token refresh retry to combat rapid + // requests to salesforce not allowing the token to refresh. usleep(self::ONE_TENTH_SECOND * pow(2, $attempts)); + $this->refreshAccessToken(); }
Add a comment for context into the usleep loop.
eventfarm_restforcephp
train
php
5a183fd9b74267606c0dd143d60a1d5f3467593d
diff --git a/angr/knowledge_plugins/labels.py b/angr/knowledge_plugins/labels.py index <HASH>..<HASH> 100644 --- a/angr/knowledge_plugins/labels.py +++ b/angr/knowledge_plugins/labels.py @@ -10,6 +10,8 @@ class Labels(KnowledgeBasePlugin): for obj in kb._project.loader.all_objects: for k, v in obj.symbols_by_addr.iteritems(): if v.name: + if v.is_import: + continue self._labels[v.rebased_addr] = v.name self._reverse_labels[v.name] = v.rebased_addr try:
Don't use labels that are imports They are undefined, and have an address of 0 in the symbol table.
angr_angr
train
py
0d0b7f1ef05b56d509d7af4ffeb79d57c68dd775
diff --git a/Collection.php b/Collection.php index <HASH>..<HASH> 100644 --- a/Collection.php +++ b/Collection.php @@ -1115,6 +1115,20 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate } /** + * Combines the collection as keys together with items as values + * + * e.g. new Collection([1, 2, 3])->combine([4, 5, 6]); + * => [1=>4, 2=>5, 3->6] + * + * @param mixed $items + * @return static + */ + public function combine($items) + { + return new static(array_combine($this->all(), $this->getArrayableItems($items))); + } + + /** * Convert the collection to its string representation. * * @return string
Added Collection::combine() This commit also includes tests for Collection::combine()
illuminate_support
train
php
6df4458d5cefe66696ccc6d2a1b1921b403cd5f9
diff --git a/app/models/receipt.rb b/app/models/receipt.rb index <HASH>..<HASH> 100644 --- a/app/models/receipt.rb +++ b/app/models/receipt.rb @@ -4,6 +4,7 @@ class Receipt < ActiveRecord::Base belongs_to :message, :foreign_key => "notification_id" validates_presence_of :receiver + attr_accessible :trashed, :is_read scope :recipient, lambda { |recipient| where(:receiver_id => recipient.id,:receiver_type => recipient.class.base_class.to_s)
Update app/models/receipt.rb Fix for #<I>
mailboxer_mailboxer
train
rb
4fbf2e60967b8b38ab60bc754f22654efdd2a788
diff --git a/src/Interface.py b/src/Interface.py index <HASH>..<HASH> 100755 --- a/src/Interface.py +++ b/src/Interface.py @@ -6,6 +6,20 @@ class Interface: os.popen("ifconfig "+ifname+":1 "+ip_address+" netmask "+netmask) def check_interface (self, ifname): - output = os.popen("ifconfig "+ifname+":1") - print output - raise NotImplementedError("This is not ready yet!") + ipaddress= self.get_ip_address(ifname) + if ipaddress == None: + raise Exception("No interface found!") + else: + return True + + def get_ip_address(self, ifname): + """ + Returns ip address from local machine. interface name is given as an parameter. + get_ip_address | <interface> + e.g. get_ip_address | eth0 + """ + ipAddressList = os.popen("/sbin/ifconfig "+ifname+" | grep inet | awk '{print $2}' | sed -e s/.*://").readlines() + ipAddress = "".join(ipAddressList) + ipAddress = ipAddress.strip() + print ipAddress + return ipAddress
first version of implementation is ready for Creating Virtual Interface test case
robotframework_Rammbock
train
py
6a80b6652df17fd1e8bf3af1937146326af51cc2
diff --git a/tests/test_swagger.py b/tests/test_swagger.py index <HASH>..<HASH> 100644 --- a/tests/test_swagger.py +++ b/tests/test_swagger.py @@ -107,7 +107,9 @@ class TestMarshmallowFieldToSwagger: assert 'field2' in res[0]['schema']['properties'] assert 'field3' in res[0]['schema']['properties'] assert 'required' in res[0]['schema'] - assert res[0]['schema']['required'] == ['field1', 'field2'] + assert len(res[0]['schema']['required']) == 2 + assert 'field1' in res[0]['schema']['required'] + assert 'field2' in res[0]['schema']['required'] assert res == swagger.fields2parameters(field_dict, default_in='body') def test_fields2parameters_does_not_modify_metadata(self):
Don't assume the dict iteration order in the test
marshmallow-code_apispec
train
py
e6d3557cf2d6467c548ed9f08992763bb0ba9384
diff --git a/src/Analyser/NodeScopeResolver.php b/src/Analyser/NodeScopeResolver.php index <HASH>..<HASH> 100644 --- a/src/Analyser/NodeScopeResolver.php +++ b/src/Analyser/NodeScopeResolver.php @@ -857,7 +857,10 @@ class NodeScopeResolver $scope = $this->ensureNonNullability($scope, $subNode, true); } - $nodeScope = $scope->exitFirstLevelStatements(); + $nodeScope = $scope; + if (!$node instanceof ErrorSuppress) { + $nodeScope = $nodeScope->exitFirstLevelStatements(); + } if ($scope->isInFirstLevelStatement()) { if ($node instanceof Ternary && $subNodeName !== 'cond') { $nodeScope = $scope->enterFirstLevelStatements(); diff --git a/tests/PHPStan/Rules/Methods/data/call-methods.php b/tests/PHPStan/Rules/Methods/data/call-methods.php index <HASH>..<HASH> 100644 --- a/tests/PHPStan/Rules/Methods/data/call-methods.php +++ b/tests/PHPStan/Rules/Methods/data/call-methods.php @@ -98,7 +98,7 @@ class Bar extends Foo */ private function returnsVoid() { - + @$this->returnsVoid(); } }
ErrorSuppress - stay in first level statements
phpstan_phpstan
train
php,php
026269eba6eea386eff91d12cdd95418eae374cc
diff --git a/lib/upnp/control_point/service.rb b/lib/upnp/control_point/service.rb index <HASH>..<HASH> 100644 --- a/lib/upnp/control_point/service.rb +++ b/lib/upnp/control_point/service.rb @@ -236,7 +236,8 @@ module UPnP end.size =end @action_list << action - define_method_from_action(action[:name].to_sym, action[:argumentList][:argument]) + args = action[:argumentList] ? action[:argumentList][:argument] : {} + define_method_from_action(action[:name].to_sym, args) end else log "<#{self.class}> Got actionList that's not an Array or Hash."
Fix for when an action doesn't provide an argumentList. Relates to gh-5.
turboladen_playful
train
rb
2525d43223f58af16c627536d5d87b7b5abd9c21
diff --git a/debugger/debuggerPanel.js b/debugger/debuggerPanel.js index <HASH>..<HASH> 100644 --- a/debugger/debuggerPanel.js +++ b/debugger/debuggerPanel.js @@ -168,7 +168,7 @@ define(function (require, exports) { }); //add show callback stack button - var $callback_stack_link = $('<a>').attr('href', '#').attr('title', 'Console').html('<i class="fa fa-indent"></i>'); + var $callback_stack_link = $('<a>').attr('href', '#').attr('title', 'Callback stack').html('<i class="fa fa-indent"></i>'); this.addControlElement($callback_stack_link, false, function () { var $domain = $('#' + domain_id); var $callback_stack = $domain.find('.brackets-nodejs-integration-debugger-callback-stack'); @@ -185,7 +185,6 @@ define(function (require, exports) { $content.hide(); } }); - }; /**
fixed wrong title on callback stack button
yacut_brackets-nodejs-integration
train
js
c72a0e35a5e64a70af6afb3a1c5eb30026373d7a
diff --git a/test/filter.js b/test/filter.js index <HASH>..<HASH> 100644 --- a/test/filter.js +++ b/test/filter.js @@ -2,11 +2,13 @@ describe("filter", function () { - var array = [{id: 0, num: 5, str: "e", group: 1, search: "first"}, - {id: 1, num: 1, str: "b", group: 0, search: "second"}, - {id: 2, num: 4, str: "a", group: 1, search: "third"}, - {id: 3, num: 2, str: "d", group: 0, search: "fourth"}, - {id: 4, num: 3, str: "c", group: 1, search: "fifth"}]; + var array = [ + {id: 0, num: 5, str: "e", group: 1, search: "first"}, + {id: 1, num: 1, str: "b", group: 0, search: "second"}, + {id: 2, num: 4, str: "a", group: 1, search: "third"}, + {id: 3, num: 2, str: "d", group: 0, search: "fourth"}, + {id: 4, num: 3, str: "c", group: 1, search: "fifth"} + ]; function checkFilteringResult (result, ids) { assert(result.length === ids.length);
Fix linter issues (#<I>)
ArnaudBuchholz_gpf-js
train
js
214ca8c9d29d14d7751a2a1bb1d7c1e1c6fe48dc
diff --git a/devices.js b/devices.js index <HASH>..<HASH> 100755 --- a/devices.js +++ b/devices.js @@ -1839,6 +1839,7 @@ const devices = [ }, { zigbeeModel: ['ZB-RGBCW'], + fingerprint: [{modelID: 'ZB-CL01', manufacturerName: 'eWeLight'}], model: 'ZB-RGBCW', vendor: 'Lonsonho', description: 'Zigbee 3.0 LED-bulb, RGBW LED',
Added Lonsonho eWeLight/ZB-CL<I> fingerprint to Lonsonho ZB-RGBCW (#<I>)
Koenkk_zigbee-shepherd-converters
train
js
8fcceceb92f35df67e8cfb03bd10c75f81e5eceb
diff --git a/sigh/lib/sigh/commands_generator.rb b/sigh/lib/sigh/commands_generator.rb index <HASH>..<HASH> 100644 --- a/sigh/lib/sigh/commands_generator.rb +++ b/sigh/lib/sigh/commands_generator.rb @@ -68,9 +68,9 @@ module Sigh c.option '-d', '--display_name STRING', String, 'Display name to use' c.option '-e', '--entitlements PATH', String, 'The path to the entitlements file to use.' c.option '--short_version STRING', String, 'Short version string to force binary and all nested binaries to use (CFBundleShortVersionString).' - c.option '--bundle_version STRING', String, 'Bundle version to force binary and all nested binaries to use (CFBundleIdentifier).' + c.option '--bundle_version STRING', String, 'Bundle version to force binary and all nested binaries to use (CFBundleVersion).' c.option '--use_app_entitlements', 'Extract app bundle codesigning entitlements and combine with entitlements from new provisionin profile.' - c.option '-g', '--new_bundle_id STRING', String, 'New application bundle ID' + c.option '-g', '--new_bundle_id STRING', String, 'New application bundle ID (CFBundleIdentifier)' c.option '--keychain_path STRING', String, 'Path to the keychain that /usr/bin/codesign should use' c.action do |args, options|
Fix Info.plist key in option description (#<I>)
fastlane_fastlane
train
rb
8306e6510038d76cfca5aaf38353f81a97ffaa76
diff --git a/lib/epubinfo/models/date.rb b/lib/epubinfo/models/date.rb index <HASH>..<HASH> 100644 --- a/lib/epubinfo/models/date.rb +++ b/lib/epubinfo/models/date.rb @@ -12,7 +12,7 @@ module EPUBInfo # Should never be called directly, go through EPUBInfo.get def initialize(node) - self.time = Time.parse(node.content) + self.time = Time.parse(node.content) rescue nil self.event = node.attribute('event').content rescue nil end
Wrapped time parsing in a rescue to prevent error when parsing out-of-range dates
chdorner_epubinfo
train
rb
06da36e1ffeef61499cdca8262149585826dbe8c
diff --git a/lib/ghtorrent/commands/ght_get_more_commits.rb b/lib/ghtorrent/commands/ght_get_more_commits.rb index <HASH>..<HASH> 100644 --- a/lib/ghtorrent/commands/ght_get_more_commits.rb +++ b/lib/ghtorrent/commands/ght_get_more_commits.rb @@ -90,9 +90,7 @@ Retrieves more commits for the provided repository break end - head = commits.sort{|a,b| - Time.parse(a['commit']['author']['date']) <=> Time.parse(b['commit']['author']['date']) - }.last['sha'] + head = commits.last['sha'] commits.map do |c| total_commits += 1
Trust Github's commit ordering for going back
gousiosg_github-mirror
train
rb
bb6888885e872293a6f563181401653b3c683275
diff --git a/pkg/models/alert.go b/pkg/models/alert.go index <HASH>..<HASH> 100644 --- a/pkg/models/alert.go +++ b/pkg/models/alert.go @@ -24,7 +24,7 @@ type Alert struct { } func (alert *Alert) ValidToSave() bool { - return alert.DashboardId != 0 + return alert.DashboardId != 0 && alert.OrgId != 0 && alert.PanelId != 0 } func (this *Alert) ContainsUpdates(other *Alert) bool {
fix(alerting): makes valid to save more explicit
grafana_grafana
train
go
bdd087c5fb81c619c24394f75b62db8465c6de99
diff --git a/tests/test_dictimporter.py b/tests/test_dictimporter.py index <HASH>..<HASH> 100644 --- a/tests/test_dictimporter.py +++ b/tests/test_dictimporter.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from copy import deepcopy from nose.tools import eq_
Fix py<I> issue.
c0fec0de_anytree
train
py
e280f4f711b91aafe3e0b0e9baa39e40e0810051
diff --git a/SpiffWorkflow/bpmn/PythonScriptEngine.py b/SpiffWorkflow/bpmn/PythonScriptEngine.py index <HASH>..<HASH> 100644 --- a/SpiffWorkflow/bpmn/PythonScriptEngine.py +++ b/SpiffWorkflow/bpmn/PythonScriptEngine.py @@ -350,7 +350,9 @@ class PythonScriptEngine(object): data.update({'task':task}) # one of our legacy tests is looking at task. # this may cause a problem down the road if we # actually have a variable named 'task' + globals.update(data) # dict comprehensions cause problems when the variables are not viable. exec(script,globals,data) + del(data['task'])
Update globals with locals so that dict comprehensions don't crash
knipknap_SpiffWorkflow
train
py
5ed8511075ba12dd2a8ed9f533890c6e35fafca8
diff --git a/pandas/stats/moments.py b/pandas/stats/moments.py index <HASH>..<HASH> 100644 --- a/pandas/stats/moments.py +++ b/pandas/stats/moments.py @@ -97,7 +97,7 @@ ignore_na : boolean, default False _ewm_notes = r""" Notes ----- -Either center of mass or span must be specified +Either center of mass, span or halflife must be specified EWMA is sometimes specified using a "span" parameter `s`, we have that the decay parameter :math:`\alpha` is related to the span as
DOC: Included halflife as one 3 optional params that must be specified
pandas-dev_pandas
train
py
f3eb611c227ddeafb64dcef4d9d1f1093f46526a
diff --git a/org.eclipse.xtext.ide/src/org/eclipse/xtext/ide/server/LanguageServerImpl.java b/org.eclipse.xtext.ide/src/org/eclipse/xtext/ide/server/LanguageServerImpl.java index <HASH>..<HASH> 100644 --- a/org.eclipse.xtext.ide/src/org/eclipse/xtext/ide/server/LanguageServerImpl.java +++ b/org.eclipse.xtext.ide/src/org/eclipse/xtext/ide/server/LanguageServerImpl.java @@ -516,6 +516,7 @@ public class LanguageServerImpl implements LanguageServer, WorkspaceService, Tex protected Diagnostic toDiagnostic(Issue issue) { Diagnostic result = new Diagnostic(); result.setCode(issue.getCode()); + result.setData(issue.getData()); result.setMessage(issue.getMessage()); result.setSeverity(toDiagnosticSeverity(issue.getSeverity()));
Propagate the Issue Data to the Diagnostic Data so that it can be used by quickfixes.
eclipse_xtext-core
train
java
b795c0326825805ce904b655d811ff51e274266e
diff --git a/app/models/file_download_stat.rb b/app/models/file_download_stat.rb index <HASH>..<HASH> 100644 --- a/app/models/file_download_stat.rb +++ b/app/models/file_download_stat.rb @@ -13,7 +13,8 @@ class FileDownloadStat < Hyrax::Statistic end profile.hyrax__download(sort: 'date', start_date: start_date, - end_date: Date.yesterday) + end_date: Date.yesterday, + limit: 10_000) .for_file(file.id) end diff --git a/app/models/hyrax/statistic.rb b/app/models/hyrax/statistic.rb index <HASH>..<HASH> 100644 --- a/app/models/hyrax/statistic.rb +++ b/app/models/hyrax/statistic.rb @@ -33,7 +33,11 @@ module Hyrax Rails.logger.error("Google Analytics profile has not been established. Unable to fetch statistics.") return [] end - profile.hyrax__pageview(sort: 'date', start_date: start_date).for_path(path) + profile.hyrax__pageview(sort: 'date', + start_date: start_date, + end_date: Date.yesterday, + limit: 10_000) + .for_path(path) end private
increase limit for google analytics stats downloads
samvera_hyrax
train
rb,rb
03693378c7e472f086befcd702d55ff627b5efb1
diff --git a/src/main/java/org/efaps/ui/wicket/components/table/filter/FormFilterPanel.java b/src/main/java/org/efaps/ui/wicket/components/table/filter/FormFilterPanel.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/efaps/ui/wicket/components/table/filter/FormFilterPanel.java +++ b/src/main/java/org/efaps/ui/wicket/components/table/filter/FormFilterPanel.java @@ -58,6 +58,7 @@ public class FormFilterPanel try { final Command cmd = Command.get(cmdName); final UIForm uiform = new UIForm(cmd.getUUID(), null); + uiform.setCallingCommandUUID(_model.getObject().getUiHeaderObject().getCommand().getUUID()); final FormContainer form = new FormContainer("form"); add(form); FormPage.updateFormContainer(_pageReference.getPage(), form, uiform);
- adding calling command for form opened by filter
eFaps_eFaps-WebApp
train
java
c00a1fcb7fc6a063725229c267a63b35dbf48d1a
diff --git a/commands/server.go b/commands/server.go index <HASH>..<HASH> 100644 --- a/commands/server.go +++ b/commands/server.go @@ -71,6 +71,10 @@ func server(cmd *cobra.Command, args []string) { viper.Set("Watch", true) } + if viper.GetBool("watch") { + serverWatch = true + } + l, err := net.Listen("tcp", net.JoinHostPort(serverInterface, strconv.Itoa(serverPort))) if err == nil { l.Close()
Add a check for the setting of watch flag in config file Fixes #<I>
gohugoio_hugo
train
go