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
8fd3ce035c71573b843a742258f060730b92f7a4
diff --git a/lib/Importer.js b/lib/Importer.js index <HASH>..<HASH> 100644 --- a/lib/Importer.js +++ b/lib/Importer.js @@ -72,8 +72,8 @@ class Importer { this.reloadConfig(); const variableName = this.editor.currentWord(); if (!variableName) { - this.message(`No variable to import. Place your cursor on a variable, - then try again.`); + this.message('No variable to import. Place your cursor on a variable, ' + + 'then try again.'); return; }
Fix incorrect message string The indentation was kept, which led to a test failure. I thought about finding a module that would automatically dedent, but since I only have one case of this issue right now I decided it was yagni.
Galooshi_import-js
train
js
d2e7444a04520e11afa9122df39a92651839dea5
diff --git a/nitpycker/main.py b/nitpycker/main.py index <HASH>..<HASH> 100644 --- a/nitpycker/main.py +++ b/nitpycker/main.py @@ -1,6 +1,6 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- -from unittest import TestProgram , signals +from unittest import TestProgram, signals __author__ = "Benjamin Schubert <ben.c.schubert@gmail.com>" diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ Setup declaration to install NitPycker params = dict( name='NitPycker', version='0.1', - packages=['nitpycker', 'nitpycker.plugins'], + packages=['nitpycker'], url='https://github.com/BenjaminSchubert/NitPycker', download_url="https://github.com/BenjaminSchubert/NitPycker/tar.gz/0.1", license='MIT',
small typo and non existing plugins directory push
BenjaminSchubert_NitPycker
train
py,py
30affde3c86469dfb345b448309a7a8cec1e062d
diff --git a/Samurai/Onikiri/EntityTable.php b/Samurai/Onikiri/EntityTable.php index <HASH>..<HASH> 100644 --- a/Samurai/Onikiri/EntityTable.php +++ b/Samurai/Onikiri/EntityTable.php @@ -350,8 +350,8 @@ class EntityTable $attributes = array_merge($defaults, $attributes); $entity = new $class($this, $attributes, $exists); - $entity->initialize(); $entity->setContainer($this->raikiri()); + $entity->initialize(); return $entity; }
call setContainer before initialize
samurai-fw_samurai
train
php
8cb1368d2c19cda06fbfeb8533e3f4fba48f6faa
diff --git a/html/pfappserver/root/src/store/modules/pfqueue.js b/html/pfappserver/root/src/store/modules/pfqueue.js index <HASH>..<HASH> 100644 --- a/html/pfappserver/root/src/store/modules/pfqueue.js +++ b/html/pfappserver/root/src/store/modules/pfqueue.js @@ -81,8 +81,12 @@ const actions = { throw new Error(data.error.message) } return data.item - }).catch(err => { - throw err + }).catch(error => { + return new Promise(resolve => { + setTimeout(() => { + resolve(dispatch('pollTaskStatus', id)) + }, 3000) + }) }) } }
fix for haproxy-admin restart in configurator
inverse-inc_packetfence
train
js
192297c53faa752eb6bc662fee6708534b660a63
diff --git a/lib/deliver/ipa_uploader.rb b/lib/deliver/ipa_uploader.rb index <HASH>..<HASH> 100644 --- a/lib/deliver/ipa_uploader.rb +++ b/lib/deliver/ipa_uploader.rb @@ -94,6 +94,15 @@ module Deliver else Helper.log.info "deliver will **not** submit the app for Review or for TestFlight distribution".yellow Helper.log.info "If you want to distribute the binary, don't define `skip_deploy` ".yellow + + if ENV["DELIVER_WHAT_TO_TEST"] or ENV["DELIVER_BETA_DESCRIPTION"] or ENV["DELIVER_BETA_FEEDBACK_EMAIL"] + Helper.log.warn "---------------------------------------------------".yellow + Helper.log.warn "You provided beta version metadata, but used the ".yellow + Helper.log.warn "`skip_deploy` option when running deliver.".yellow + Helper.log.warn "You have to remove `skip_deploy` to set a changelog".yellow + Helper.log.warn "for TestFlight builds".yellow + Helper.log.warn "---------------------------------------------------".yellow + end end return true end
Added information about not used beta distribution variables
fastlane_fastlane
train
rb
e51c48c827c565ae77a1a74c37c6104815c5a509
diff --git a/lib/dexter/indexer.rb b/lib/dexter/indexer.rb index <HASH>..<HASH> 100644 --- a/lib/dexter/indexer.rb +++ b/lib/dexter/indexer.rb @@ -247,7 +247,10 @@ module Dexter cost_savings2 = false end - suggest_index = (cost_savings || cost_savings2) && query_indexes.size <= 2 + # TODO if multiple indexes are found (for either single or multicolumn) + # determine the impact of each individually + # for now, be conservative and don't suggest if more than one index + suggest_index = (cost_savings || cost_savings2) && query_indexes.size == 1 if suggest_index query_indexes.each do |index|
Don't suggest multiple indexes per query until individual impact can be determined
ankane_dexter
train
rb
c0f5acabca9cfeecf996a5748419c6c1df489678
diff --git a/lib/better_errors.rb b/lib/better_errors.rb index <HASH>..<HASH> 100644 --- a/lib/better_errors.rb +++ b/lib/better_errors.rb @@ -19,6 +19,7 @@ module BetterErrors { symbols: [:textmate, :txmt, :tm], sniff: /mate/i, url: "txmt://open?url=file://%{file}&line=%{line}" }, { symbols: [:idea], sniff: /idea/i, url: "idea://open?file=%{file}&line=%{line}" }, { symbols: [:rubymine], sniff: /mine/i, url: "x-mine://open?file=%{file}&line=%{line}" }, + { symbols: [:vscode, :code], sniff: /code/i, url: "vscode://file/%{file}:%{line}" }, ] class << self diff --git a/spec/better_errors_spec.rb b/spec/better_errors_spec.rb index <HASH>..<HASH> 100644 --- a/spec/better_errors_spec.rb +++ b/spec/better_errors_spec.rb @@ -85,5 +85,13 @@ describe BetterErrors do expect(subject.editor[]).to start_with "idea://" end end + + ["vscode", "code"].each do |editor| + it "uses vscode:// scheme when EDITOR=#{editor}" do + ENV["EDITOR"] = editor + subject.editor = subject.default_editor + expect(subject.editor[]).to start_with "vscode://" + end + end end end
Add support for vscode editor
BetterErrors_better_errors
train
rb,rb
f3d6a0156194f67a710d03768012bd12ac82d169
diff --git a/test/extended/image_ecosystem/mongodb_replica_petset.go b/test/extended/image_ecosystem/mongodb_replica_petset.go index <HASH>..<HASH> 100644 --- a/test/extended/image_ecosystem/mongodb_replica_petset.go +++ b/test/extended/image_ecosystem/mongodb_replica_petset.go @@ -57,7 +57,7 @@ var _ = g.Describe("[image_ecosystem][mongodb][Slow] openshift mongodb replicati exutil.ParseLabelsOrDie("name=mongodb-replicaset"), exutil.CheckPodIsRunningFn, 3, - 1*time.Minute, + 2*time.Minute, ) o.Expect(err).NotTo(o.HaveOccurred()) o.Expect(podNames).Should(o.HaveLen(3)) @@ -83,7 +83,7 @@ var _ = g.Describe("[image_ecosystem][mongodb][Slow] openshift mongodb replicati exutil.ParseLabelsOrDie("name=mongodb-replicaset"), exutil.CheckPodIsRunningFn, 3, - 1*time.Minute, + 2*time.Minute, ) o.Expect(err).NotTo(o.HaveOccurred()) o.Expect(podNames).Should(o.HaveLen(3))
MongoDB replica petset test: increase time of waiting for pods.
openshift_origin
train
go
b6a057a925bd631779f8c55091aaae0aee1ae203
diff --git a/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/authentication/OpenSamlAuthenticationProvider.java b/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/authentication/OpenSamlAuthenticationProvider.java index <HASH>..<HASH> 100644 --- a/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/authentication/OpenSamlAuthenticationProvider.java +++ b/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/authentication/OpenSamlAuthenticationProvider.java @@ -253,7 +253,7 @@ public final class OpenSamlAuthenticationProvider implements AuthenticationProvi validationParams.put(SAML2AssertionValidationParameters.SIGNATURE_REQUIRED, false); validationParams.put( SAML2AssertionValidationParameters.CLOCK_SKEW, - this.responseTimeValidationSkew + this.responseTimeValidationSkew.toMillis() ); validationParams.put( SAML2AssertionValidationParameters.COND_VALID_AUDIENCES,
OpenSAML expects type `long` representing millis for response time validation skew Fixes gh-<I> <URL>
spring-projects_spring-security
train
java
f054d8ec6db4f7ea1f34fc828f2853c0011d3de5
diff --git a/app/controllers/spree/admin/admin_controller_decorator.rb b/app/controllers/spree/admin/admin_controller_decorator.rb index <HASH>..<HASH> 100644 --- a/app/controllers/spree/admin/admin_controller_decorator.rb +++ b/app/controllers/spree/admin/admin_controller_decorator.rb @@ -3,7 +3,11 @@ if defined?(Spree::Admin::BaseController) Spree::Admin::BaseController.class_eval do protected def model_class - "Spree::#{controller_name.classify}".constantize + const_name = "Spree::#{controller_name.classify}" + if Object.const_defined?(const_name) + return const_name.constantize + end + nil end end end
Only return a value from model_class method if constant is available Fixes spree/spree#<I>
spree_spree_auth_devise
train
rb
6e6890de141bf456ae2b3d5f33de7ba88f8445b6
diff --git a/common/packet/connect_options.go b/common/packet/connect_options.go index <HASH>..<HASH> 100644 --- a/common/packet/connect_options.go +++ b/common/packet/connect_options.go @@ -1,5 +1,7 @@ package packet +import "os" + // Defalut values var ( DefaultCleanSession = true @@ -30,6 +32,11 @@ type CONNECTOptions struct { // Init initializes the CONNECTOptions. func (opts *CONNECTOptions) Init() { + if opts.ClientID == "" { + hostname, _ := os.Hostname() + opts.ClientID = hostname + } + if opts.CleanSession == nil { opts.CleanSession = &DefaultCleanSession }
Update common/packet/connect_options.go
yosssi_gmq
train
go
02c289245a403f40e1c98095c87b58d83a9c32a0
diff --git a/src/utils/TimeSlots.js b/src/utils/TimeSlots.js index <HASH>..<HASH> 100644 --- a/src/utils/TimeSlots.js +++ b/src/utils/TimeSlots.js @@ -130,7 +130,10 @@ export function getSlotMetrics({ min: start, max: end, step, timeslots }) { const rangeStartMin = positionFromDate(rangeStart) const rangeEndMin = positionFromDate(rangeEnd) - const top = (rangeStartMin / (step * numSlots)) * 100 + const top = + rangeEndMin - rangeStartMin < step && !dates.eq(end, rangeEnd) + ? ((rangeStartMin - step) / (step * numSlots)) * 100 + : (rangeStartMin / (step * numSlots)) * 100 return { top,
Revert round logic and detect last slot
intljusticemission_react-big-calendar
train
js
75f5d71bea8647e4d76f5b72c6d4e2fff3414ca4
diff --git a/Classes/Wwwision/PrivateResources/Resource/Target/ProtectedResourceTarget.php b/Classes/Wwwision/PrivateResources/Resource/Target/ProtectedResourceTarget.php index <HASH>..<HASH> 100644 --- a/Classes/Wwwision/PrivateResources/Resource/Target/ProtectedResourceTarget.php +++ b/Classes/Wwwision/PrivateResources/Resource/Target/ProtectedResourceTarget.php @@ -85,10 +85,10 @@ class ProtectedResourceTarget implements TargetInterface { } /** - * @param Collection $collection The collection to publish + * @param CollectionInterface $collection The collection to publish * @return void */ - public function publishCollection(Collection $collection) { + public function publishCollection(CollectionInterface $collection) { // publishing is not required for protected resources }
[BUGFIX] Adjust method signature of publishCollection to current Flow
bwaidelich_Wwwision.PrivateResources
train
php
9030cb224116319dc8a920e7d0c4faafc055b204
diff --git a/src/Core/AbstractInterface/AbstractEvent.php b/src/Core/AbstractInterface/AbstractEvent.php index <HASH>..<HASH> 100644 --- a/src/Core/AbstractInterface/AbstractEvent.php +++ b/src/Core/AbstractInterface/AbstractEvent.php @@ -76,5 +76,4 @@ abstract class AbstractEvent abstract function onTask(\swoole_http_server $server, $taskId, $fromId,$taskObj); abstract function onFinish(\swoole_http_server $server, $taskId, $fromId,$taskObj); abstract function onWorkerError(\swoole_http_server $server,$worker_id,$worker_pid,$exit_code); - abstract function onWorkerFatalError(\swoole_http_server $server); } \ No newline at end of file
delete onFatalError
easy-swoole_easyswoole
train
php
93d4b77a324fba15cdd775e21ea1a7866cc29a82
diff --git a/util/mock/mocks/statement.go b/util/mock/mocks/statement.go index <HASH>..<HASH> 100644 --- a/util/mock/mocks/statement.go +++ b/util/mock/mocks/statement.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +// Package mocks is just for test only. package mocks import (
util/mock/mocks: add package comment.
pingcap_tidb
train
go
474196a9b47929b9938d805ce8abb5cb95f1836f
diff --git a/lib/rprogram/compat.rb b/lib/rprogram/compat.rb index <HASH>..<HASH> 100644 --- a/lib/rprogram/compat.rb +++ b/lib/rprogram/compat.rb @@ -5,7 +5,7 @@ module RProgram # # Compat.arch #=> "linux" # - def self.platform + def Compat.platform RUBY_PLATFORM.split('-').last end @@ -16,7 +16,7 @@ module RProgram # # Compat.paths #=> ["/bin", "/usr/bin"] # - def self.paths + def Compat.paths # return an empty array in case # the PATH variable does not exist return [] unless ENV['PATH'] @@ -34,8 +34,8 @@ module RProgram # # Compat.find_program('as') #=> "/usr/bin/as" # - def self.find_program(name) - self.paths.each do |dir| + def Compat.find_program(name) + Compat.paths.each do |dir| full_path = File.expand_path(File.join(dir,name)) return full_path if File.file?(full_path) @@ -51,8 +51,8 @@ module RProgram # # Compat.find_program_by_names("gas","as") #=> "/usr/bin/as" # - def self.find_program_by_names(*names) - names.map { |name| self.find_program(name) }.compact.first + def Compat.find_program_by_names(*names) + names.map { |name| Compat.find_program(name) }.compact.first end end end
Put methods in the Compat namespace.
postmodern_rprogram
train
rb
2f654e135dafe284dd0b79b6510efa352e8b36ee
diff --git a/src/Message/MessageParser.php b/src/Message/MessageParser.php index <HASH>..<HASH> 100644 --- a/src/Message/MessageParser.php +++ b/src/Message/MessageParser.php @@ -38,7 +38,8 @@ class MessageParser 'body' => $parts['body'] ]; - $parsed['request_url'] = $this->getUrlPartsFromMessage($parts['start_line'][1], $parsed); + $parsed['request_url'] = $this->getUrlPartsFromMessage( + (isset($parts['start_line'][1]) ? $parts['start_line'][1] : ''), $parsed); return $parsed; }
Prevent crushes on parsing incorrect HTTP request Steps to reproduce crush: 1. Start http-server (like in Ratchet's Hello World (<URL>, and send any text followed by '\n\n'. Http-server will crush with "PHP Notice: Undefined offset: 1 in .../Guzzle/Parser/Message/MessageParser.php on line <I>" (ratchet currently uses <I>-dev)
guzzle_guzzle
train
php
566dc87d9d2c1a3c56fd9a10695ad8b4e79c9de6
diff --git a/clc-java-sdk/sdk/src/test/java/com/centurylink/cloud/sdk/servers/services/PublicIpTest.java b/clc-java-sdk/sdk/src/test/java/com/centurylink/cloud/sdk/servers/services/PublicIpTest.java index <HASH>..<HASH> 100644 --- a/clc-java-sdk/sdk/src/test/java/com/centurylink/cloud/sdk/servers/services/PublicIpTest.java +++ b/clc-java-sdk/sdk/src/test/java/com/centurylink/cloud/sdk/servers/services/PublicIpTest.java @@ -37,7 +37,6 @@ public class PublicIpTest extends AbstractServersSdkTest { @Test(groups = {INTEGRATION, LONG_RUNNING}) public void testPublicIp() { - new SingleServerFixture().createServer(); serverRef = SingleServerFixture.server(); addPublicIp();
<I> Implement possibilities to update public IP settings. changes according comments
CenturyLinkCloud_clc-java-sdk
train
java
952483362bf123684a6cd7008e763c1933c37f8d
diff --git a/lib/rules/prefer-destructuring.js b/lib/rules/prefer-destructuring.js index <HASH>..<HASH> 100644 --- a/lib/rules/prefer-destructuring.js +++ b/lib/rules/prefer-destructuring.js @@ -109,8 +109,10 @@ module.exports = { return; } - if (checkArrays && isArrayIndexAccess(rightNode)) { - report(reportNode, "array"); + if (isArrayIndexAccess(rightNode)) { + if (checkArrays) { + report(reportNode, "array"); + } return; } diff --git a/tests/lib/rules/prefer-destructuring.js b/tests/lib/rules/prefer-destructuring.js index <HASH>..<HASH> 100644 --- a/tests/lib/rules/prefer-destructuring.js +++ b/tests/lib/rules/prefer-destructuring.js @@ -72,6 +72,12 @@ ruleTester.run("prefer-destructuring", rule, { { code: "({ foo } = object);" }, + { + + // Fix #8654 + code: "var foo = array[0];", + options: [{ array: false }, { enforceForRenamedProperties: true }] + }, "[foo] = array;", "foo += array[0]", "foo += bar.foo"
Fix: Don't check object destructing in integer property (fixes #<I>) (#<I>)
eslint_eslint
train
js,js
a7b07a39d63067019c36c7e87d1930df15573575
diff --git a/src/Generator.php b/src/Generator.php index <HASH>..<HASH> 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -257,13 +257,13 @@ class Generator extends Extractor } if ($column->defaultValue !== null) { if ($column->defaultValue instanceof Expression) { - $definition .= '->defaultExpression(\'' . $column->defaultValue->expression . '\')'; + $definition .= '->defaultExpression(\'' . addslashes($column->defaultValue->expression) . '\')'; } else { - $definition .= '->defaultValue(\'' . $column->defaultValue . '\')'; + $definition .= '->defaultValue(\'' . addslashes($column->defaultValue) . '\')'; } } if ($column->comment) { - $definition .= '->comment(\'' . $column->comment . '\')'; + $definition .= '->comment(\'' . addslashes($column->comment) . '\')'; } if (!$compositePk && $checkPrimaryKey && $column->isPrimaryKey) { $definition .= '->append(\'' . $this->prepareSchemaAppend(true, $column->autoIncrement) . '\')';
Escape quotes in db comments and defaults
bizley_yii2-migration
train
php
d614e636085d322bb783cc7acfb48d0e8251a9ab
diff --git a/gffutils/db.py b/gffutils/db.py index <HASH>..<HASH> 100644 --- a/gffutils/db.py +++ b/gffutils/db.py @@ -226,21 +226,22 @@ class GFFDBCreator(DBCreator): class GTFDBCreator(DBCreator): - def __init__(self, dbfn): - DBCreator.__init__(self, dbfn) + def __init__(self, fn, dbfn, *args, **kwargs): + DBCreator.__init__(self, fn, dbfn, *args, **kwargs) + self.filetype = 'gtf' def populate_from_features(self, features): t0 = time.time() self.drop_indexes() c = self.conn.cursor() for feature in features: - parent = feature.attributes['transcript_id'][0] - grandparent = feature.attributes['gene_id'][0] + parent = feature.attributes['transcript_id'] + grandparent = feature.attributes['gene_id'] # A database-specific ID to use - ID = '%s:%s:%s-%s' % ( + ID = '%s:%s:%s-%s:%s' % ( feature.featuretype, feature.chrom, feature.start, - feature.stop) + feature.stop, feature.strand) # If it's an exon, its attributes include its parent transcript # and its 'grandparent' gene. So we can insert these
use new dbid, which has strand as well
daler_gffutils
train
py
b5aad13f499dafb4a8bf98e91293f2812d1a039d
diff --git a/lib/chef/client.rb b/lib/chef/client.rb index <HASH>..<HASH> 100644 --- a/lib/chef/client.rb +++ b/lib/chef/client.rb @@ -256,6 +256,7 @@ class Chef run_context = nil events.run_start(Chef::VERSION) Chef::Log.info("*** Chef #{Chef::VERSION} ***") + Chef::Log.info("Platform: #{RUBY_PLATFORM}") Chef::Log.info "Chef-client pid: #{Process.pid}" Chef::Log.debug("Chef-client request_id: #{request_id}") enforce_path_sanity
Log platform along with client version and pid.
chef_chef
train
rb
6f53b5ee4d61625f81569c61cb01cca5f4cd039d
diff --git a/src/com/xtremelabs/robolectric/shadows/ShadowActivity.java b/src/com/xtremelabs/robolectric/shadows/ShadowActivity.java index <HASH>..<HASH> 100644 --- a/src/com/xtremelabs/robolectric/shadows/ShadowActivity.java +++ b/src/com/xtremelabs/robolectric/shadows/ShadowActivity.java @@ -6,6 +6,7 @@ import java.util.List; import android.app.Activity; import android.app.Application; import android.content.Intent; +import android.os.Looper; import android.view.LayoutInflater; import android.view.View; import android.view.Window; @@ -151,6 +152,11 @@ public class ShadowActivity extends ShadowContextWrapper { public void onDestroy() { assertNoBroadcastListenersRegistered(); } + + @Implementation + public final void runOnUiThread( Runnable action ) { + shadowOf(Looper.myLooper()).post( action, 0 ); + } /** * Checks the {@code ApplicationContext} to see if {@code BroadcastListener}s are still registered.
Added runOnUiThread() to ShadowActivity
robolectric_robolectric
train
java
557213041189f322d68e2c0c21f0aaa0bdfb5b98
diff --git a/astropy_helpers/utils.py b/astropy_helpers/utils.py index <HASH>..<HASH> 100644 --- a/astropy_helpers/utils.py +++ b/astropy_helpers/utils.py @@ -13,6 +13,9 @@ import warnings try: from importlib import machinery as import_machinery + # Python 3.2 does not have SourceLoader + if not hasattr(import_machinery, 'SourceLoader'): + import_machinery = None except ImportError: import_machinery = None
SourceLoader does not exist in Python <I>
astropy_astropy-helpers
train
py
355c27171e1f3c725dbd14e30e10580354e4975c
diff --git a/environs/jujutest/livetests.go b/environs/jujutest/livetests.go index <HASH>..<HASH> 100644 --- a/environs/jujutest/livetests.go +++ b/environs/jujutest/livetests.go @@ -584,17 +584,23 @@ func (t *LiveTests) TestFile(c *C) { // check that the listed contents include the // expected name. found := false - names, err := storage.List("") - for _, lname := range names { - if lname == name { - found = true - break + var names []string +attempt: + for a := t.Attempt.Start(); a.Next(); { + var err error + names, err = storage.List("") + c.Assert(err, IsNil) + for _, lname := range names { + if lname == name { + found = true + break attempt + } } } if !found { c.Errorf("file name %q not found in file list %q", name, names) } - err = storage.Remove(name) + err := storage.Remove(name) c.Check(err, IsNil) checkFileDoesNotExist(c, storage, name, t.Attempt) // removing a file that does not exist should not be an error.
environs/jujutest: revert TestFile loop removal
juju_juju
train
go
240e1656d3d42e82a54fba0a4ceb1a774f988008
diff --git a/examples/update_user.rb b/examples/update_user.rb index <HASH>..<HASH> 100644 --- a/examples/update_user.rb +++ b/examples/update_user.rb @@ -11,3 +11,4 @@ puts client.username_update(username: "Batman", new_username: "Alfred") puts client.user_update(username: "Batman", name: "Bruce Wayne") puts client.email_update(username: "Batman", email: "batman@example.com") puts client.toggle_avatar(username: "Batman", use_uploaded_avatar: true) +puts client.upload_avatar(username: "DiscourseHero", file: "http://cdn.discourse.org/assets/logo.png") diff --git a/lib/discourse_api/client.rb b/lib/discourse_api/client.rb index <HASH>..<HASH> 100644 --- a/lib/discourse_api/client.rb +++ b/lib/discourse_api/client.rb @@ -29,4 +29,7 @@ class DiscourseApi::Client < DiscourseApi::Resource put :toggle_avatar => '/users/:username/preferences/avatar/toggle', :require => [:username] + post :upload_avatar => '/users/:username/preferences/avatar', + :require => [:username, :file] + end
Added a post request to upload avatars with a url
discourse_discourse_api
train
rb,rb
23b7d6b45c675bcd93e9f1fb9cd33e71779142c6
diff --git a/src/Illuminate/Foundation/Exceptions/Handler.php b/src/Illuminate/Foundation/Exceptions/Handler.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Foundation/Exceptions/Handler.php +++ b/src/Illuminate/Foundation/Exceptions/Handler.php @@ -6,6 +6,7 @@ use Exception; use Psr\Log\LoggerInterface; use Illuminate\Http\Response; use Illuminate\Routing\Router; +use Illuminate\Support\Facades\Auth; use Illuminate\Http\RedirectResponse; use Illuminate\Auth\AuthenticationException; use Illuminate\Contracts\Container\Container; @@ -69,7 +70,7 @@ class Handler implements ExceptionHandlerContract throw $e; // throw the original exception } - $logger->error($e); + $logger->error($e, $this->context()); } /** @@ -99,6 +100,20 @@ class Handler implements ExceptionHandlerContract } /** + * Get the default context variables for logging. + * + * @return array + */ + protected function context() + { + return array_filter([ + 'userId' => Auth::id(), + 'email' => Auth::check() && isset(Auth::user()->email) + ? Auth::user()->email : null, + ]); + } + + /** * Render an exception into a response. * * @param \Illuminate\Http\Request $request
Add some default context to logs if we know it. If we know the user ID and email, add it to the log context for easier searching for a given users error.
laravel_framework
train
php
575801dda7adb063fac03678cc258c6d9d2c8871
diff --git a/src/includes/classes/AppConfig.php b/src/includes/classes/AppConfig.php index <HASH>..<HASH> 100644 --- a/src/includes/classes/AppConfig.php +++ b/src/includes/classes/AppConfig.php @@ -194,6 +194,11 @@ class AppConfig extends AbsCore if (!is_array($config = json_decode(file_get_contents($config_file), true))) { throw new Exception(sprintf('Invalid config file: `%1$s`.', $config_file)); } + if (!empty($config['core_app'])) { + $config = (array) $config['core_app']; + } elseif (!empty($config['app'])) { + $config = (array) $config['app']; + } $config = $this->merge($instance_base, $config, true); $config = $this->merge($config, $instance); } else { @@ -288,6 +293,7 @@ class AppConfig extends AbsCore '%%app_dir%%', '%%core_dir%%', + '%%home_dir%%', ], [ $this->App->namespace, @@ -295,6 +301,7 @@ class AppConfig extends AbsCore $this->App->dir, $this->App->core_dir, + (string) ($_SERVER['HOME'] ?? ''), ], $value );
Adding support for `%%home_dir%%` replacement code.
wpsharks_core
train
php
63f495e4a859b3474e3196839c1939100027b450
diff --git a/lib/jazzy/sourcekitten.rb b/lib/jazzy/sourcekitten.rb index <HASH>..<HASH> 100644 --- a/lib/jazzy/sourcekitten.rb +++ b/lib/jazzy/sourcekitten.rb @@ -161,6 +161,15 @@ module Jazzy end end + # returns all subdirectories of specified path + def self.rec_path(path) + path.children.collect do |child| + if child.directory? + rec_path(child) + [child] + end + end.select { |x| x }.flatten(1) + end + # Builds SourceKitten arguments based on Jazzy options def self.arguments_from_options(options) arguments = ['doc'] @@ -170,8 +179,10 @@ module Jazzy 'objective-c', '-isysroot', `xcrun --show-sdk-path --sdk #{options.sdk}`.chomp, '-I', options.framework_root.to_s] - # add additional -I arguments for each subdirectory of framework_root - Pathname.new(options.framework_root.to_s).children.collect do |child| + end + # add additional -I arguments for each subdirectory of framework_root + unless options.framework_root.nil? + rec_path(Pathname.new(options.framework_root.to_s)).collect do |child| if child.directory? arguments += ['-I', child.to_s] end
Include all subfolders of framework_root Check if framework_root option is set and include all subfolders (recursively) of framework_root.
realm_jazzy
train
rb
bfe38a8af3dc7049a8e37487bcf969b59baf720b
diff --git a/acceptance/tests/ticket_17458_puppet_command_prints_help.rb b/acceptance/tests/ticket_17458_puppet_command_prints_help.rb index <HASH>..<HASH> 100644 --- a/acceptance/tests/ticket_17458_puppet_command_prints_help.rb +++ b/acceptance/tests/ticket_17458_puppet_command_prints_help.rb @@ -1,5 +1,5 @@ test_name "puppet command with an unknown external command prints help" -on agents, puppet('unknown') do +on(agents, puppet('unknown'), :acceptable_exit_codes => [1]) do assert_match(/See 'puppet help' for help on available puppet subcommands/, stdout) end
(maint) Allow exit code of 1 for unknown subcommand acceptance test. Fixing acceptance test to now allow for an exit code of 1 when the "unknown subcommand" error is returned from puppet.
puppetlabs_puppet
train
rb
6c42630380e93d2945620bae9a351a506bf42b19
diff --git a/ez_setup.py b/ez_setup.py index <HASH>..<HASH> 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -36,7 +36,7 @@ try: except ImportError: USER_SITE = None -DEFAULT_VERSION = "5.7" +DEFAULT_VERSION = "5.8" DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" def _python_cmd(*args): diff --git a/setuptools/version.py b/setuptools/version.py index <HASH>..<HASH> 100644 --- a/setuptools/version.py +++ b/setuptools/version.py @@ -1 +1 @@ -__version__ = '5.7' +__version__ = '5.8'
Bumped to <I> in preparation for next release.
pypa_setuptools
train
py,py
cede530984ddc7978f0c37260ccd441c128915b4
diff --git a/kernel/src/main/java/org/efaps/db/databases/OracleDatabase.java b/kernel/src/main/java/org/efaps/db/databases/OracleDatabase.java index <HASH>..<HASH> 100644 --- a/kernel/src/main/java/org/efaps/db/databases/OracleDatabase.java +++ b/kernel/src/main/java/org/efaps/db/databases/OracleDatabase.java @@ -127,7 +127,7 @@ public class OracleDatabase extends AbstractDatabase { try { ResultSet rs = stmt.executeQuery( - "select t.TABLENAME " + "select VIEW_NAME " + "from USER_VIEWS " + "where VIEW_NAME='" + _viewName.toUpperCase() + "'" );
- wrong column name of the user views was used git-svn-id: <URL>
eFaps_eFaps-Kernel
train
java
1a86d7d342459e0808a93f411f7a69da86b49765
diff --git a/test/jpypetest/test_buffer.py b/test/jpypetest/test_buffer.py index <HASH>..<HASH> 100644 --- a/test/jpypetest/test_buffer.py +++ b/test/jpypetest/test_buffer.py @@ -122,8 +122,8 @@ class BufferTestCase(common.JPypeTestCase): self.assertTrue(np.all(np.array(jtype(na), dtype=dtype) == np.array(na, dtype=dtype))) na = np.random.randint(0, 2**64 - 1, size=n, dtype=np.uint64) - self.assertTrue(np.all(np.array(jtype(na), dtype=dtype) - == np.array(na, dtype=dtype))) + self.assertTrue(np.allclose(np.array(jtype(na), dtype=dtype), + np.array(na, dtype=dtype), atol=1e-8)) na = np.random.random(n).astype(np.float32) self.assertTrue(np.all(np.array(jtype(na), dtype=dtype) == np.array(na, dtype=dtype)))
Use allclose to fix conversion issue.
jpype-project_jpype
train
py
63001e253fc30aeace84f48545bcb987525e2606
diff --git a/src/Collection.php b/src/Collection.php index <HASH>..<HASH> 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -446,7 +446,7 @@ class Collection * @see http://docs.mongodb.org/manual/core/read-operations-introduction/ * @param array|object $filter Query by which to filter documents * @param array $options Additional options - * @return object|null + * @return array|object|null */ public function findOne($filter = [], array $options = []) { diff --git a/src/Operation/FindOne.php b/src/Operation/FindOne.php index <HASH>..<HASH> 100644 --- a/src/Operation/FindOne.php +++ b/src/Operation/FindOne.php @@ -74,7 +74,7 @@ class FindOne implements Executable * * @see Executable::execute() * @param Server $server - * @return object|null + * @return array|object|null */ public function execute(Server $server) {
FindOne::execute() may return an array The return type documentation should have been updated when the typMap option was introduced in PHPLIB-<I>.
mongodb_mongo-php-library
train
php,php
ba10d573a1b7184d65666e89cab5642bf1bc84f9
diff --git a/pypet/tests/testutils/ioutils.py b/pypet/tests/testutils/ioutils.py index <HASH>..<HASH> 100644 --- a/pypet/tests/testutils/ioutils.py +++ b/pypet/tests/testutils/ioutils.py @@ -22,6 +22,9 @@ from pypet import HasLogger from pypet.pypetlogging import LoggingManager, rename_log_file from pypet.utils.decorators import copydoc +import pypet.utils.ptcompat as ptcompat +hdf5version = ptcompat.hdf5_version +print('HDF5 Version: %s') % str(hdf5version) testParams=dict( tempdir = 'tmp_pypet_tests',
Added printing of HDF5 Version
SmokinCaterpillar_pypet
train
py
f011eef93cf4c7eb6bef86233c4cd3715188855a
diff --git a/core-bundle/src/Resources/contao/modules/ModuleArticle.php b/core-bundle/src/Resources/contao/modules/ModuleArticle.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/modules/ModuleArticle.php +++ b/core-bundle/src/Resources/contao/modules/ModuleArticle.php @@ -10,7 +10,6 @@ namespace Contao; - /** * Provides methodes to handle articles. * @@ -376,7 +375,6 @@ class ModuleArticle extends \Module // Close and output PDF document $pdf->lastPage(); $pdf->Output(standardize(ampersand($this->title, false)) . '.pdf', 'D'); - // FIXME: This has to be changed to a ResponseException somehow - rather write to temp file and stream it then? // Stop script execution exit; }
[Core] Remove FIXME.
contao_contao
train
php
103a1252f9bdfd674e7684e2a48ccbd70287764b
diff --git a/nodes/ccu-mqtt.js b/nodes/ccu-mqtt.js index <HASH>..<HASH> 100644 --- a/nodes/ccu-mqtt.js +++ b/nodes/ccu-mqtt.js @@ -210,7 +210,7 @@ module.exports = function (RED) { return; } - this.ccu.setValue(iface, filter.channel, filter.datapoint, payload); + this.ccu.setValue(iface, filter.channel, filter.datapoint, payload).catch(() => {}); } sysvar(filter, payload) {
catch promise rejection on setValue (close #<I>)
rdmtc_node-red-contrib-ccu
train
js
e6df62c29678d4d7a6ee43f888b5591cda667bdb
diff --git a/gala/potential/common.py b/gala/potential/common.py index <HASH>..<HASH> 100644 --- a/gala/potential/common.py +++ b/gala/potential/common.py @@ -83,6 +83,13 @@ class CommonBase: def _parse_parameter_values(self, *args, **kwargs): expected_parameter_keys = list(self._parameters.keys()) + if len(args) > len(expected_parameter_keys): + raise ValueError("Too many positional arguments passed in to " + f"{self.__class__}: Potential and Frame classes " + "only accept parameters as positional arguments, " + "all other arguments (e.g., units) must now be " + "passed in as keyword argument.") + parameter_values = dict() # Get any parameters passed as positional arguments diff --git a/gala/potential/potential/tests/helpers.py b/gala/potential/potential/tests/helpers.py index <HASH>..<HASH> 100644 --- a/gala/potential/potential/tests/helpers.py +++ b/gala/potential/potential/tests/helpers.py @@ -65,7 +65,7 @@ class PotentialTestBase(object): def setup(self): # set up hamiltonian if self.frame is None: - self.frame = StaticFrame(self.potential.units) + self.frame = StaticFrame(units=self.potential.units) self.H = Hamiltonian(self.potential, self.frame) def test_unitsystem(self):
frames must now take units as a keyword argument
adrn_gala
train
py,py
4c9c68e9725c6196b708ac52ac141d5705d36255
diff --git a/parsl/executors/high_throughput/process_worker_pool.py b/parsl/executors/high_throughput/process_worker_pool.py index <HASH>..<HASH> 100755 --- a/parsl/executors/high_throughput/process_worker_pool.py +++ b/parsl/executors/high_throughput/process_worker_pool.py @@ -114,8 +114,6 @@ class Manager(object): last_beat = time.time() if ready_worker_count > 0: - - ready_worker_count = 4 logger.debug("[TASK_PULL_THREAD] Requesting tasks: {}".format(ready_worker_count)) msg = ((ready_worker_count).to_bytes(4, "little")) self.task_incoming.send(msg)
Removing hardcoded ready_worker_count
Parsl_parsl
train
py
6102a59d11324af003c85e06198df0649a7151eb
diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php index <HASH>..<HASH> 100644 --- a/mod/quiz/lib.php +++ b/mod/quiz/lib.php @@ -1074,7 +1074,7 @@ function quiz_reset_userdata($data) { function quiz_check_file_access($attemptuniqueid, $questionid) { global $USER, $DB; - $attempt = $DB->get_record('quiz_attempts', array('uniqueid' => $attemptid)); + $attempt = $DB->get_record('quiz_attempts', array('uniqueid' => $attemptuniqueid)); $quiz = $DB->get_record('quiz', array('id' => $attempt->quiz)); $context = get_context_instance(CONTEXT_COURSE, $quiz->course);
Fixing typo introduced in <I> version of this file.
moodle_moodle
train
php
4f644c3f398dfe20227604b64a366bc3f5633093
diff --git a/mod/resource/locallib.php b/mod/resource/locallib.php index <HASH>..<HASH> 100644 --- a/mod/resource/locallib.php +++ b/mod/resource/locallib.php @@ -404,7 +404,7 @@ function resource_get_intro(object $resource, object $cm, bool $ignoresettings = $content = ""; if ($ignoresettings || !empty($options['printintro']) || $extraintro) { - $gotintro = trim(strip_tags($resource->intro)); + $gotintro = !html_is_blank($resource->intro); if ($gotintro || $extraintro) { if ($gotintro) { $content = format_module_intro('resource', $resource, $cm->id);
MDL-<I> mod_resource: better detection of empty module intro.
moodle_moodle
train
php
ee5be9b556c6ee05ea7084c7176ef7697178f17e
diff --git a/src/Model/Table/ConfigurationsTable.php b/src/Model/Table/ConfigurationsTable.php index <HASH>..<HASH> 100644 --- a/src/Model/Table/ConfigurationsTable.php +++ b/src/Model/Table/ConfigurationsTable.php @@ -27,7 +27,7 @@ class ConfigurationsTable extends AbstractConfigurationsTable public function validationDefault(Validator $validator) { $validator->requirePresence('namespace', 'create') - ->add('namespace', 'valid-namespace', ['rule' => '@[a-z0-9\\\.]+@']) + ->add('namespace', 'valid-namespace', ['rule' => ['custom', '@[a-z0-9\\\.]+@']]) ->requirePresence('path') ->notEmpty('path')
'custom' rule is used, and must be named accordingly.
gourmet_aroma
train
php
77cc586d4a973a3d9f97fce8bf0d6785c7e61b41
diff --git a/SlimJson/Middleware.php b/SlimJson/Middleware.php index <HASH>..<HASH> 100644 --- a/SlimJson/Middleware.php +++ b/SlimJson/Middleware.php @@ -101,15 +101,18 @@ class Middleware extends \Slim\Middleware { $cors = $app->config(Config::Cors); if ($cors) { if(\is_callable($cors)) { - $origin = \call_user_func($cors, $app->request()); + $allowOrigin = \call_user_func($cors, $app->request()->headers->get('Origin')); } else { if (!\is_string($cors)) { - $origin = '*'; + $allowOrigin = '*'; } else { - $origin = $cors; + $allowOrigin = $cors; } } - $app->response()->header('Access-Control-Allow-Origin', $origin); + + if($allowOrigin) { + $app->response()->header('Access-Control-Allow-Origin', $allowOrigin); + } } if ($app->config(Config::Protect)) {
Think it's better to call a function with the request origin as parameter
dogancelik_slim-json
train
php
5a65da2c20ff2cb95330c6b3b160b7952d0e13f4
diff --git a/apps/editing-toolkit/editing-toolkit-plugin/full-site-editing-plugin.php b/apps/editing-toolkit/editing-toolkit-plugin/full-site-editing-plugin.php index <HASH>..<HASH> 100644 --- a/apps/editing-toolkit/editing-toolkit-plugin/full-site-editing-plugin.php +++ b/apps/editing-toolkit/editing-toolkit-plugin/full-site-editing-plugin.php @@ -338,6 +338,11 @@ add_action( 'plugins_loaded', __NAMESPACE__ . '\load_tags_education' ); * (Core Full Site Editing) */ function load_wpcom_site_editor() { + // This is no longer needed after Gutenberg 12.2 due to the Navigation menu no longer being inscrutable. + // This should be deleted along with the files that would be loaded after 12.2 is in production. + if ( defined( 'GUTENBERG_VERSION' ) && version_compare( GUTENBERG_VERSION, '12.2.0', '>=' ) ) { + return; + } require_once __DIR__ . '/wpcom-site-editor/index.php'; } add_action( 'plugins_loaded', __NAMESPACE__ . '\load_wpcom_site_editor', 11 ); // load just after the Gutenberg plugin.
Site Editor: don't hide nav after Gutenberg <I> (#<I>)
Automattic_wp-calypso
train
php
545f975ef177a3192a0005803acd06fcb7fd0cb0
diff --git a/src/quill.mention.js b/src/quill.mention.js index <HASH>..<HASH> 100644 --- a/src/quill.mention.js +++ b/src/quill.mention.js @@ -191,11 +191,14 @@ class Mention { if (!this.options.showDenotationChar) { render.denotationChar = ''; } + + const prevMentionCharPos = this.mentionCharPos; + this.quill .deleteText(this.mentionCharPos, this.cursorPos - this.mentionCharPos, Quill.sources.USER); - this.quill.insertEmbed(this.mentionCharPos, 'mention', render, Quill.sources.USER); - this.quill.insertText(this.mentionCharPos + 1, ' ', Quill.sources.USER); - this.quill.setSelection(this.mentionCharPos + 2, Quill.sources.USER); + this.quill.insertEmbed(prevMentionCharPos, 'mention', render, Quill.sources.USER); + this.quill.insertText(prevMentionCharPos + 1, ' ', Quill.sources.USER); + this.quill.setSelection(prevMentionCharPos + 2, Quill.sources.USER); this.hideMentionList(); }
Fix: Mention placement position (#<I>)
afconsult_quill-mention
train
js
800c846276382369f36ec64fddc21d893fb92a5b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ #!/usr/bin/env python + """ Setup script for the `can` package. Learn more at https://github.com/hardbyte/python-can/ @@ -6,8 +7,6 @@ Learn more at https://github.com/hardbyte/python-can/ # pylint: disable=invalid-name -from __future__ import absolute_import - from os import listdir from os.path import isfile, join import re
Remove Python 2 leftover from setup.py
hardbyte_python-can
train
py
883f229164b8f903908f2dcdff7385b5f9e8f332
diff --git a/Classes/Controller/BackendController.php b/Classes/Controller/BackendController.php index <HASH>..<HASH> 100755 --- a/Classes/Controller/BackendController.php +++ b/Classes/Controller/BackendController.php @@ -87,7 +87,7 @@ class BackendController extends ActionController LocalizationUtility::translate($this->languageFilePrefix . 'styleguide', 'styleguide'), LocalizationUtility::translate($this->languageFilePrefix . ($arguments['action'] ?? 'index'), 'styleguide') )) - ->setRouteIdentifier('help_StyleguideBackend') + ->setRouteIdentifier('help_StyleguideStyleguide') ->setArguments($shortcutArguments); $buttonBar->addButton($shortcutButton); }
[BUGFIX] Use correct route identifier for shortcut button
TYPO3_styleguide
train
php
eca64ed3d760bab71234db5c21e880c50f8867c3
diff --git a/src/TwigJs/JsCompiler.php b/src/TwigJs/JsCompiler.php index <HASH>..<HASH> 100644 --- a/src/TwigJs/JsCompiler.php +++ b/src/TwigJs/JsCompiler.php @@ -194,6 +194,7 @@ class JsCompiler extends \Twig_Compiler $this->filterCompilers = array(); $this->filterFunctions = array( 'escape' => 'twig.filter.escape', + 'e' => 'twig.filter.escape', 'length' => 'twig.filter.length', 'capitalize' => 'twig.filter.capitalize', 'default' => 'twig.filter.def',
adds "e" filter (closes #<I>)
schmittjoh_twig.js
train
php
c721a5b13dd5a59dda43294426cd257d9296a240
diff --git a/tests/helpers/run.js b/tests/helpers/run.js index <HASH>..<HASH> 100644 --- a/tests/helpers/run.js +++ b/tests/helpers/run.js @@ -30,7 +30,7 @@ const bootstrap = () => module.exports = (...args) => bootstrap().then((rootDir) => { process.chdir(rootDir); - process.nextTick(() => run(null, ...args)); + process.nextTick(() => run(...args)); const { events } = require(join(rootDir, 'core')); const api = {
test: use new yargs API
untool_untool
train
js
d11ade4cb9eb8c551376877ce7ebaa877d235c06
diff --git a/tcex/tcex_batch_v2.py b/tcex/tcex_batch_v2.py index <HASH>..<HASH> 100644 --- a/tcex/tcex_batch_v2.py +++ b/tcex/tcex_batch_v2.py @@ -535,9 +535,16 @@ class TcExBatch(object): 'type': group_data.get('type') } else: + GROUPS_CLASSES_WITH_FILE_CONTENTS = [Document, Report] + GROUPS_STRINGS_WITH_FILE_CONTENTS = ['Document', 'Report'] # process file content - if group_data.data.get('type') in ['Document', 'Report']: - self._files[group_data.data.get('xid')] = group_data.file_data + if group_data.data.get('type') in GROUPS_STRINGS_WITH_FILE_CONTENTS: + # this handles groups created using interface 1 (https://docs.threatconnect.com/en/latest/tcex/batch.html#group-interface-1) + if type(group_data) in GROUPS_CLASSES_WITH_FILE_CONTENTS: + self._files[group_data.data.get('xid')] = group_data.file_data + # this handles groups created using interface 2 (https://docs.threatconnect.com/en/latest/tcex/batch.html#group-interface-2) + else: + self._files[group_data.data.get('xid')] = group_data.data.get('file_data') group_data = group_data.data return group_data
Fixing document/report file content upload This handles documents/reports uploaded using interface 2
ThreatConnect-Inc_tcex
train
py
b516b89fe671b80d397ccc5c86a7e18b40388674
diff --git a/qface/idl/listener.py b/qface/idl/listener.py index <HASH>..<HASH> 100644 --- a/qface/idl/listener.py +++ b/qface/idl/listener.py @@ -63,6 +63,7 @@ class DomainListener(TListener): log.warn('Unknown type: {0}. Missing import?'.format(type.name)) def parse_annotations(self, ctx, symbol): + assert ctx and symbol if ctx.comment: comment = ctx.comment.text symbol.comment = comment @@ -153,7 +154,7 @@ class DomainListener(TListener): assert self.interface name = ctx.name.text self.signal = Signal(name, self.interface) - self.parse_annotations(ctx, self.operation) + self.parse_annotations(ctx, self.signal) contextMap[ctx] = self.signal def exitSignalSymbol(self, ctx: TParser.SignalSymbolContext):
Fixed error where wrong symbol was parsed for signal annotation
Pelagicore_qface
train
py
72e351a13ff0164741cb4aa461d6d3550b2a1715
diff --git a/packages/pob/utils/package.js b/packages/pob/utils/package.js index <HASH>..<HASH> 100644 --- a/packages/pob/utils/package.js +++ b/packages/pob/utils/package.js @@ -152,19 +152,20 @@ const internalAddDependencies = (pkg, type, dependencies, cleaned) => { const potentialNewVersion = pobDependencies[dependency]; const currentVersion = currentDependencies[dependency]; const potentialNewVersionCleaned = cleanVersion(potentialNewVersion); + const getNewVersion = () => cleaned ? potentialNewVersionCleaned : potentialNewVersion; try { if ( !currentVersion || semver.gt(potentialNewVersionCleaned, cleanVersion(currentVersion)) ) { - filtredDependencies[dependency] = potentialNewVersion; + filtredDependencies[dependency] = getNewVersion(); } else if (potentialNewVersionCleaned === cleanVersion(currentVersion)) { - filtredDependencies[dependency] = potentialNewVersion; + filtredDependencies[dependency] = getNewVersion(); } else if (potentialNewVersion !== currentVersion) { console.warn(`dependency "${dependency}" has a higher version: expected ${potentialNewVersion}, actual: ${currentVersion}.`); } } catch (err) { - filtredDependencies[dependency] = cleaned ? potentialNewVersionCleaned : potentialNewVersion; + filtredDependencies[dependency] = getNewVersion(); } }); }
fix: devDep always cleaned
christophehurpeau_pob-lerna
train
js
fe13dd0073a77a2daffab606c7286aca68864615
diff --git a/lib/spiced_rumby.rb b/lib/spiced_rumby.rb index <HASH>..<HASH> 100644 --- a/lib/spiced_rumby.rb +++ b/lib/spiced_rumby.rb @@ -15,7 +15,7 @@ module SpicedRumby module_function def start - is_debugging = ['nogui', 'bash', 'd', 'debug'].include?(ARGV.first) + is_debugging = ['nogui', 'bash', 'b', 'd', 'debug'].include?(ARGV.first) is_debugging ? debug_start : gui_start end
add extra option to get to debug bash ui
NullVoxPopuli_spiced_rumby
train
rb
1c68f296b8e292020014f3cb10b5f5d381cb6390
diff --git a/Twig/DoctrineExtension.php b/Twig/DoctrineExtension.php index <HASH>..<HASH> 100644 --- a/Twig/DoctrineExtension.php +++ b/Twig/DoctrineExtension.php @@ -233,9 +233,6 @@ class DoctrineExtension extends \Twig_Extension $result = $this->composeMiniQuery($query, $keywords, $required); } - // Highlight the minified query - $result = \SqlFormatter::highlight($result); - // Remove unneeded boilerplate HTML $result = str_replace(array("<pre style='background:white;'", "</pre>"), array("<span", "</span>"), $result);
Removed the highlighting of minified queries The minified queries are not valid SQL anymore, so highlighting them with the SqlFormatter does not make sense. Closes #<I>
doctrine_DoctrineBundle
train
php
ba4dcb011ada7df703835ba7f8ae243f94c62c10
diff --git a/app/modules/categories/CategoryController.js b/app/modules/categories/CategoryController.js index <HASH>..<HASH> 100644 --- a/app/modules/categories/CategoryController.js +++ b/app/modules/categories/CategoryController.js @@ -19,11 +19,24 @@ angular selectionService.select($stateParams.category, angular.element($event.currentTarget)); - if (!category.children){ - navigationService.navigateToProducts(category.urlId); - } else { - navigationService.navigateToCategory(category.urlId); - } + //even if we have the category already provided by the function parameter, + //we have to fetch it again via the couchService. The reason for that is, that + //it might be a leaf with no children but it's just an alias to a category + //which does have children. In this case, we want to get to the real category + //which has the children. + + //in 99% of the cases we will just get the same category returned by the couchService + //as the one we got via the function parameter but for such alias corner cases it's important + //to retrieve it through the couchService. + couchService + .getCategory(category.urlId) + .then(function(realCategory){ + if (!realCategory.children){ + navigationService.navigateToProducts(realCategory.urlId); + } else { + navigationService.navigateToCategory(realCategory.urlId); + } + }); }; if (!category.children){
fix(CategoryController): make sure to always fetch the category through the couchService
sofa_sofa-couch-service
train
js
0bde3afb8bbada900cac2940106238dece793c92
diff --git a/Lib/glyphsLib/builder/glyph.py b/Lib/glyphsLib/builder/glyph.py index <HASH>..<HASH> 100644 --- a/Lib/glyphsLib/builder/glyph.py +++ b/Lib/glyphsLib/builder/glyph.py @@ -143,10 +143,18 @@ def to_glyphs_glyph(self, ufo_glyph, ufo_layer, master): # have a write the first time, compare the next times for glyph # always write for the layer - if ufo_glyph.name in self.font.glyphs: - glyph = self.font.glyphs[ufo_glyph.name] - else: - glyph = self.glyphs_module.GSGlyph(name=ufo_glyph.name) + # NOTE: This optimizes around the performance drain that is glyph name lookup + # without replacing the actual data structure. Ideally, FontGlyphsProxy + # provides O(1) lookup for all the ways you can use strings to look up + # glyphs. + ufo_glyph_name = ufo_glyph.name # Avoid method lookup in hot loop. + glyph = None + for glyph_object in self.font._glyphs: # HOT LOOP. Avoid FontGlyphsProxy for speed! + if glyph_object.name == ufo_glyph_name: # HOT HOT HOT + glyph = glyph_object + break + if glyph is None: + glyph = self.glyphs_module.GSGlyph(name=ufo_glyph_name) # FIXME: (jany) ordering? self.font.glyphs.append(glyph)
to_glyphs_glyph: Optimize glyph name lookup
googlefonts_glyphsLib
train
py
c66e536e161fbca557b03ba59eedab0f8e4d5e28
diff --git a/atomic_reactor/plugins/pre_koji_parent.py b/atomic_reactor/plugins/pre_koji_parent.py index <HASH>..<HASH> 100644 --- a/atomic_reactor/plugins/pre_koji_parent.py +++ b/atomic_reactor/plugins/pre_koji_parent.py @@ -29,19 +29,19 @@ class KojiParentBuildMissing(ValueError): class KojiParentPlugin(PreBuildPlugin): - """Wait for Koji build of parent image to be available + """Wait for Koji build of parent images to be available - Uses inspected parent image config to determine the - nvr (Name-Version-Release) of the parent image. It uses + Uses inspected parent image configs to determine the + nvrs (Name-Version-Release) of the parent images. It uses this information to check if the corresponding Koji - build exists. This check is performed periodically until - the Koji build is found, or timeout expires. + builds exist. This check is performed periodically until + the Koji builds are all found, or timeout expires. This check is required due to a timing issue that may occur after the image is pushed to registry, but it has not been yet uploaded and tagged in Koji. This plugin - ensures that the layered image is only built with a parent - image that is known in Koji. + ensures that the layered image is only built with parent + images that are known in Koji. """ key = PLUGIN_KOJI_PARENT_KEY
Update KojiParentPlugin docstring to describe multiple parents
projectatomic_atomic-reactor
train
py
812aac6695095570a37d334962760f4d5689a2ce
diff --git a/Client/Api/StatementsApiClient.php b/Client/Api/StatementsApiClient.php index <HASH>..<HASH> 100644 --- a/Client/Api/StatementsApiClient.php +++ b/Client/Api/StatementsApiClient.php @@ -146,7 +146,10 @@ class StatementsApiClient extends ApiClient implements StatementsApiClientInterf return $createdStatements; } else { $createdStatement = clone $statements; - $createdStatement->setId($statementIds[0]); + + if (200 === $validStatusCode) { + $createdStatement->setId($statementIds[0]); + } return $createdStatement; }
When predefined id is setted, It doesn't spect content from store request (following xAPI spec <I> is used when id is included), so in case of <I> we don't need to fill id
php-xapi_serializer
train
php
8011cfe7037b9cca8d6aab9fb0a62f54976e314f
diff --git a/physical/etcd/etcd2.go b/physical/etcd/etcd2.go index <HASH>..<HASH> 100644 --- a/physical/etcd/etcd2.go +++ b/physical/etcd/etcd2.go @@ -138,9 +138,9 @@ func newEtcdV2Client(conf map[string]string) (client.Client, error) { if (hasCert && hasKey) || hasCa { var transportErr error tls := transport.TLSInfo{ - CAFile: ca, - CertFile: cert, - KeyFile: key, + TrustedCAFile: ca, + CertFile: cert, + KeyFile: key, } cTransport, transportErr = transport.NewTransport(tls, 30*time.Second) diff --git a/physical/etcd/etcd3.go b/physical/etcd/etcd3.go index <HASH>..<HASH> 100644 --- a/physical/etcd/etcd3.go +++ b/physical/etcd/etcd3.go @@ -86,9 +86,9 @@ func newEtcd3Backend(conf map[string]string, logger log.Logger) (physical.Backen ca, hasCa := conf["tls_ca_file"] if (hasCert && hasKey) || hasCa { tls := transport.TLSInfo{ - CAFile: ca, - CertFile: cert, - KeyFile: key, + TrustedCAFile: ca, + CertFile: cert, + KeyFile: key, } tlscfg, err := tls.ClientConfig()
Update to TrustedCAFile for etcd as CAFile is deprecated and removed in latest libs
hashicorp_vault
train
go,go
9cf31a3a0408261ad2530bc4167087c99b23663c
diff --git a/notifier.go b/notifier.go index <HASH>..<HASH> 100644 --- a/notifier.go +++ b/notifier.go @@ -34,7 +34,12 @@ func New(rawData ...interface{}) *Notifier { // Bugsnag after being converted to JSON. e.g. bugsnag.SeverityError, bugsnag.Context, // or bugsnag.MetaData. func (notifier *Notifier) Notify(rawData ...interface{}) (e error) { - return notifier.NotifySync(append(rawData, notifier.Config.Synchronous)...) + // Ensure any passed in raw-data synchronous boolean value takes precedence + args := append(rawData, nil) + copy(args[1:], args) + args[0] = notifier.Config.Synchronous + + return notifier.NotifySync(args...) } // NotifySync sends an error to Bugsnag. A boolean parameter specifies whether
[fix] Ensure calls to Notify has correct arg precedence
bugsnag_bugsnag-go
train
go
77ecc6c93a45692b15d456995502a399a140f07c
diff --git a/vendor/plugins/enju_oai/lib/enju_oai/oai_controller.rb b/vendor/plugins/enju_oai/lib/enju_oai/oai_controller.rb index <HASH>..<HASH> 100644 --- a/vendor/plugins/enju_oai/lib/enju_oai/oai_controller.rb +++ b/vendor/plugins/enju_oai/lib/enju_oai/oai_controller.rb @@ -54,12 +54,19 @@ module OaiController end def get_resumption_token(token) - resumption = Rails.cache.read(token) rescue nil + if token.present? + resumption = Rails.cache.read(token) + end + rescue + nil end def set_resumption_token(token, from_time, until_time, per_page = 0) - if resumption = Rails.cache.read(token) - @cursor = resumption[:cursor] + per_page ||= resources.per_page + if token.present? + resumption = Rails.cache.read(token) + if resumption + @cursor = resumption[:cursor] + per_page ||= resources.per_page + end end @cursor ||= 0 yml = YAML.load_file("#{Rails.root.to_s}/config/oai_cache.yml")
ListRecords doesn't work if resumptionToken isn't set
next-l_enju_leaf
train
rb
e027463875ea3830375b5f2f5f00069978602050
diff --git a/includes/properties/class-property-repeater.php b/includes/properties/class-property-repeater.php index <HASH>..<HASH> 100644 --- a/includes/properties/class-property-repeater.php +++ b/includes/properties/class-property-repeater.php @@ -62,7 +62,7 @@ class PropertyRepeater extends Papi_Property { return (object) _papi_get_property_options( $item, false ); }, $items ); - $items = array_filter( $items, function ( $item ) use ( $not_allowed ) { + return array_filter( $items, function ( $item ) use ( $not_allowed ) { if ( ! is_object( $item ) ) { return false; @@ -70,9 +70,6 @@ class PropertyRepeater extends Papi_Property { return ! in_array( _papi_get_property_short_type( $item->type ), $not_allowed ); } ); - - return _papi_sort_order( $items ); - } /**
Update class-property-repeater.php
wp-papi_papi
train
php
be379a166d991725fd1c53e3f2f8e675f4bd6edf
diff --git a/lib/punchblock/rayo_node.rb b/lib/punchblock/rayo_node.rb index <HASH>..<HASH> 100644 --- a/lib/punchblock/rayo_node.rb +++ b/lib/punchblock/rayo_node.rb @@ -60,6 +60,7 @@ module Punchblock # not provided one will be created # @return a new object with the registered name and namespace def self.new(name = registered_name, doc = nil) + raise "Trying to create a new #{self} with no name" unless name super name, doc, registered_ns end
[FEATURE] Raise a sensible error when trying to create nameless nodes
adhearsion_punchblock
train
rb
18bc6d40698aa7e8a6d1b62cb4b9c4d96fb06588
diff --git a/lib/common/config.js b/lib/common/config.js index <HASH>..<HASH> 100644 --- a/lib/common/config.js +++ b/lib/common/config.js @@ -93,7 +93,7 @@ define(['base', 'async', 'underscore'], function (Base, async, _) { // else attempt async for (i = len; i--;) { - fns.push(fn.bind(configs[i])); + fns.push(_.bind(fn, configs[i])); } async.waterfall(fns, function (err, result) {
Bug #<I> - Replace native bind function with underscore bind.
lazojs_lazo
train
js
a8915d115aeaeece9684d2468ba1b37003a84973
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,9 @@ from distutils.core import setup setup( name = 'date-extractor', packages = ['date_extractor'], - version = '1.9', + package_dir = {'date_extractor': 'date_extractor'}, + package_data = {'date_extractor': ['arabic.py', 'enumerations.py', '__init__.py', 'data/months_verbose/arabic.txt', 'data/months_verbose/french.txt', 'data/months_verbose/sorani.txt', 'data/months_verbose/turkish.txt', 'tests/__init__.py', 'tests/test.py']}, + version = '2.0', description = 'Extract dates from text', author = 'Daniel J. Dufour', author_email = 'daniel.j.dufour@gmail.com',
Added files to setup.py
DanielJDufour_date-extractor
train
py
f161c921ca6e19c130a9e03398f7b6b444fd3a6d
diff --git a/query/src/main/java/org/infinispan/query/indexmanager/InfinispanCommandsBackend.java b/query/src/main/java/org/infinispan/query/indexmanager/InfinispanCommandsBackend.java index <HASH>..<HASH> 100644 --- a/query/src/main/java/org/infinispan/query/indexmanager/InfinispanCommandsBackend.java +++ b/query/src/main/java/org/infinispan/query/indexmanager/InfinispanCommandsBackend.java @@ -165,7 +165,7 @@ public class InfinispanCommandsBackend implements BackendQueueProcessor { return members.get(elementIndex); } else { //If cache is configured as DIST - return hashService.primaryLocation(indexName); + return hashService.locatePrimaryOwner(indexName); } }
ISPN-<I> Make query compile with the new ConsistentHash interface
infinispan_infinispan
train
java
c77c14ecd3e7e35a331cef169b08ffcb318952c2
diff --git a/sos/plugins/block.py b/sos/plugins/block.py index <HASH>..<HASH> 100644 --- a/sos/plugins/block.py +++ b/sos/plugins/block.py @@ -46,7 +46,7 @@ class Block(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): disk_path = os.path.join('/dev/', disk) self.add_cmd_output([ "udevadm info -ap /sys/block/%s" % (disk), - "parted -s %s print" % (disk_path), + "parted -s %s unit s print" % (disk_path), "fdisk -l %s" % disk_path ])
[block] don't use parted human readable output Changed the parted command to return data in sectors units instead of human readable form. Fixes #<I>.
sosreport_sos
train
py
d18a0c83826b7a51d3cdc1b70bb3a4cefbe0ef4a
diff --git a/nudibranch/diff_render.py b/nudibranch/diff_render.py index <HASH>..<HASH> 100644 --- a/nudibranch/diff_render.py +++ b/nudibranch/diff_render.py @@ -331,9 +331,9 @@ class HTMLDiff(difflib.HtmlDiff): return "<hr>" def make_whole_file(self): - tables = [self._diff_html[diff] - for diff in self._all_diffs() - if self._has_diff(diff)] + tables = sorted([self._diff_html[diff] + for diff in self._all_diffs() + if self._has_diff(diff)]) return self._file_template % dict( summary=self.make_summary(), legend=self.legend_html(),
Tests are now output in order.
ucsb-cs_submit
train
py
ed1ba3c9645d1b632b39141f896c9be62816b0ba
diff --git a/src/Extension/PhiremockProcess.php b/src/Extension/PhiremockProcess.php index <HASH>..<HASH> 100644 --- a/src/Extension/PhiremockProcess.php +++ b/src/Extension/PhiremockProcess.php @@ -73,8 +73,10 @@ class PhiremockProcess */ public function stop() { - $this->process->signal(SIGTERM); - $this->process->stop(3, SIGKILL); + if (!$this->isWindows()) { + $this->process->signal(SIGTERM); + $this->process->stop(3, SIGKILL); + } } /**
#4 Fixed PCTNL exeption for windows environment
mcustiel_phiremock-codeception-extension
train
php
7816d103d391e817fd67900b1b03be102622bf23
diff --git a/controller.go b/controller.go index <HASH>..<HASH> 100644 --- a/controller.go +++ b/controller.go @@ -102,7 +102,7 @@ func (db *publishController) PublishOrDiscard(context *admin.Context) { // ConfigureQorResource configure qor resource for qor admin func (publish *Publish) ConfigureQorResource(res resource.Resourcer) { if res, ok := res.(*admin.Resource); ok { - admin.RegisterViewPath("github.com/qor/publish/views") + res.GetAdmin().RegisterViewPath("github.com/qor/publish/views") res.UseTheme("publish") if event := res.GetAdmin().GetResource("PublishEvent"); event == nil {
Upgrade to new RegisterViewPath API
qor_publish
train
go
9251504f15aaaea4311e46be0d2d772aff54aa27
diff --git a/ryu/app/ofctl_rest.py b/ryu/app/ofctl_rest.py index <HASH>..<HASH> 100644 --- a/ryu/app/ofctl_rest.py +++ b/ryu/app/ofctl_rest.py @@ -519,10 +519,13 @@ class StatsController(ControllerBase): if dp is None: return Response(status=404) - flow = {'table_id': dp.ofproto.OFPTT_ALL} - _ofp_version = dp.ofproto.OFP_VERSION + if ofproto_v1_0.OFP_VERSION == _ofp_version: + flow = {} + else: + flow = {'table_id': dp.ofproto.OFPTT_ALL} + _ofctl = supported_ofctl.get(_ofp_version, None) if _ofctl is not None: _ofctl.mod_flow_entry(dp, flow, dp.ofproto.OFPFC_DELETE)
ofctl_rest: fix error of delete_flow_entry ofctl_rest caused an exception when run delete_flow_entry command in OpenFlow<I>. this patch fixes this problem.
osrg_ryu
train
py
5563054fec1d932e419b4dfe5d915d00a2be100a
diff --git a/src/Degree.php b/src/Degree.php index <HASH>..<HASH> 100644 --- a/src/Degree.php +++ b/src/Degree.php @@ -55,7 +55,7 @@ class Degree extends BaseGraph */ public function getDegreeMin() { - return $this->getDegreeVertex($this->graph->getVertices()->getVertexOrder(Vertices::ORDER_DEGREE)); + return $this->getDegreeVertex($this->graph->getVertices()->getVertexOrder(array($this, 'getDegreeVertex'))); } /** @@ -68,7 +68,7 @@ class Degree extends BaseGraph */ public function getDegreeMax() { - return $this->getDegreeVertex($this->graph->getVertices()->getVertexOrder(Vertices::ORDER_DEGREE, true)); + return $this->getDegreeVertex($this->graph->getVertices()->getVertexOrder(array($this, 'getDegreeVertex'), true)); } /**
Simplify getting min/max degree
graphp_algorithms
train
php
f3410ed9283a34eec550ca846de74bdea4a67c3d
diff --git a/enoslib/service/locust/locust.py b/enoslib/service/locust/locust.py index <HASH>..<HASH> 100644 --- a/enoslib/service/locust/locust.py +++ b/enoslib/service/locust/locust.py @@ -95,7 +95,7 @@ class Locust(Service): ) with play_on(pattern_hosts="agent", roles=self.roles) as p: - for i in [density]: + for i in range(density): p.shell( ( "nohup locust "
service/locust: fix density
BeyondTheClouds_enoslib
train
py
dd259c124758482dced7ffaaca6218e2417bda8f
diff --git a/agent/config/config.go b/agent/config/config.go index <HASH>..<HASH> 100644 --- a/agent/config/config.go +++ b/agent/config/config.go @@ -314,8 +314,9 @@ func environmentConfig() Config { imageCleanupDisabled := utils.ParseBool(os.Getenv("ECS_DISABLE_IMAGE_CLEANUP"), false) minimumImageDeletionAge := parseEnvVariableDuration("ECS_IMAGE_MINIMUM_CLEANUP_AGE") imageCleanupInterval := parseEnvVariableDuration("ECS_IMAGE_CLEANUP_INTERVAL") - numImagesToDeletePerCycle, err := strconv.Atoi(os.Getenv("ECS_NUM_IMAGES_DELETE_PER_CYCLE")) - if err != nil { + numImagesToDeletePerCycleEnvVal := os.Getenv("ECS_NUM_IMAGES_DELETE_PER_CYCLE") + numImagesToDeletePerCycle, err := strconv.Atoi(numImagesToDeletePerCycleEnvVal) + if numImagesToDeletePerCycleEnvVal != "" && err != nil { seelog.Warnf("Invalid format for \"ECS_NUM_IMAGES_DELETE_PER_CYCLE\", expected an integer. err %v", err) }
Fix warning message when ECS_NUM_IMAGES_DELETE_PER_CYCLE is not provided
aws_amazon-ecs-agent
train
go
ed2b318d2941781808473a454d665dd5fdf40225
diff --git a/test/helpers_test.rb b/test/helpers_test.rb index <HASH>..<HASH> 100644 --- a/test/helpers_test.rb +++ b/test/helpers_test.rb @@ -133,6 +133,33 @@ class HelpersTest < Test::Unit::TestCase get '/' assert_equal 'Hello World', body end + + it 'can be used with other objects' do + mock_app do + get '/' do + body :hello => 'from json' + end + + after do + if Hash === response.body + body response.body[:hello] + end + end + end + + get '/' + assert_body 'from json' + end + + it 'can be set in after filter' do + mock_app do + get('/') { body 'route' } + after { body 'filter' } + end + + get '/' + assert_body 'filter' + end end describe 'redirect' do
add tests to show body is already working properly, fixes #<I>
sinatra_sinatra
train
rb
68d1818b0b23ca5cac454f30cd070c07ee16b25f
diff --git a/app/classes/lowlevelchecks.php b/app/classes/lowlevelchecks.php index <HASH>..<HASH> 100644 --- a/app/classes/lowlevelchecks.php +++ b/app/classes/lowlevelchecks.php @@ -153,7 +153,7 @@ class LowlevelChecks return; // Okidoki.. } - if (!@rename($distname, $ymlname)) { + if (!@copy($distname, $ymlname)) { $message = sprintf("Couldn't create a new <code>%s</code>-file. Create the file manually by copying <code>%s</code>, and optionally make it writable to the user that the webserver is using.", htmlspecialchars($name . ".yml", ENT_QUOTES),
Fixed #<I> Config files are now *copied* rather than *moved*.
bolt_bolt
train
php
5f44b71af6dd01dd1075b9ce7ccf6d9349d165ab
diff --git a/Doctrine/adodb-hack/adodb-datadict.inc.php b/Doctrine/adodb-hack/adodb-datadict.inc.php index <HASH>..<HASH> 100644 --- a/Doctrine/adodb-hack/adodb-datadict.inc.php +++ b/Doctrine/adodb-hack/adodb-datadict.inc.php @@ -212,7 +212,7 @@ class ADODB_DataDict { * @return array of tables for current database. */ - function MetaTables() + function &MetaTables($ttype=false,$showSchema=false,$mask=false) { global $ADODB_FETCH_MODE; diff --git a/Doctrine/adodb-hack/drivers/datadict-mysql.inc.php b/Doctrine/adodb-hack/drivers/datadict-mysql.inc.php index <HASH>..<HASH> 100644 --- a/Doctrine/adodb-hack/drivers/datadict-mysql.inc.php +++ b/Doctrine/adodb-hack/drivers/datadict-mysql.inc.php @@ -248,7 +248,7 @@ class ADODB2_mysql extends ADODB_DataDict { * * @return array of ADOFieldObjects for current table. */ - function MetaColumns($table) + function MetaColumns($table, $upper = true, $schema = false) { $this->_findschema($table,$schema); if ($schema) {
more fixed to make it strict compatable
doctrine_annotations
train
php,php
b8848438695f3036c4c38831b3bf328404b7d884
diff --git a/bquery/ctable.py b/bquery/ctable.py index <HASH>..<HASH> 100644 --- a/bquery/ctable.py +++ b/bquery/ctable.py @@ -151,8 +151,6 @@ class ctable(bcolz.ctable): carray_values.flush() rm_file_or_dir(col_values_rootdir, ignore_errors=True) shutil.move(col_values_rootdir_tmp, col_values_rootdir) - else: - rm_file_or_dir(col_factor_rootdir_tmp, ignore_errors=True) def unique(self, col_or_col_list): """
Remove unneeded tmp dir removal
visualfabriq_bquery
train
py
7391f7728d96c2ec0113de57f3316c191043ad2c
diff --git a/actionpack/lib/action_controller/cgi_ext/cookie.rb b/actionpack/lib/action_controller/cgi_ext/cookie.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/cgi_ext/cookie.rb +++ b/actionpack/lib/action_controller/cgi_ext/cookie.rb @@ -78,6 +78,12 @@ class CGI #:nodoc: buf end + # FIXME: work around broken 1.8.7 DelegateClass#respond_to? + def respond_to?(method, include_private = false) + return true if super(method) + return __getobj__.respond_to?(method, include_private) + end + # Parses a raw cookie string into a hash of <tt>cookie-name => cookie-object</tt> # pairs. #
Ruby <I> compat: work around broken DelegateClass#respond_to?
rails_rails
train
rb
9830fa1688fc3a0410e147700a118327150bccd1
diff --git a/astrobase/lcproc.py b/astrobase/lcproc.py index <HASH>..<HASH> 100644 --- a/astrobase/lcproc.py +++ b/astrobase/lcproc.py @@ -629,7 +629,7 @@ def getlclist(listpickle, ext_cosdecl = np.cos(np.radians(extcat['decl'])) ext_sindecl = np.sin(np.radians(extcat['decl'])) ext_cosra = np.cos(np.radians(extcat['ra'])) - ext_sinra = np.sin(np.radians(extcat['decl'])) + ext_sinra = np.sin(np.radians(extcat['ra'])) ext_xyz = np.column_stack((ext_cosra*ext_cosdecl, ext_sinra*ext_cosdecl,
lcproc.getlclist fix bugs with xmatchexternal
waqasbhatti_astrobase
train
py
2b2711d84bad43cc89baf0f938504ef190fef7d8
diff --git a/pysd/py_backend/functions.py b/pysd/py_backend/functions.py index <HASH>..<HASH> 100644 --- a/pysd/py_backend/functions.py +++ b/pysd/py_backend/functions.py @@ -1094,15 +1094,6 @@ def log(x, base): """ return np.log(x) / np.log(base) -#TODO document this new functions... -def and_(x, y): - #TODO check logical operations between matrix and vectors - return xr.ufuncs.logical_and(x, y) - - -def or_(x, y): - return xr.ufuncs.logical_or(x, y) - def sum(x, dim=None):
Remove not implemented logical functions remove logical or_ and and_ because they are not implemented in the vensim/vensim2py.py.
JamesPHoughton_pysd
train
py
cf8861e3e67867f0ddea45ce96b1f4c5dfe560ac
diff --git a/client/client.go b/client/client.go index <HASH>..<HASH> 100644 --- a/client/client.go +++ b/client/client.go @@ -217,7 +217,7 @@ func NewClient(cfg *config.Config) (*Client, error) { go c.run() // Start collecting stats - go c.monitorHostStats() + go c.collectHostStats() // Start the consul sync go c.syncConsul() @@ -1282,15 +1282,16 @@ func (c *Client) syncConsul() { } } -// monitorHostStats collects host resource usage stats periodically -func (c *Client) monitorHostStats() { +// collectHostStats collects host resource usage stats periodically +func (c *Client) collectHostStats() { next := time.NewTimer(hostStatsCollectorIntv) for { select { case <-next.C: ru, err := c.hostStatsCollector.Collect() if err != nil { - c.logger.Printf("[DEBUG] client: error fetching stats of host: %v", err) + c.logger.Printf("[DEBUG] client: error fetching host resource usage stats: %v", err) + continue } c.resourceUsageLock.RLock() c.resourceUsage.Enqueue(ru)
Renamed monitorUsage method
hashicorp_nomad
train
go
9a73625768b0c1354b1a74c70612621feb5e7399
diff --git a/handshake-state.js b/handshake-state.js index <HASH>..<HASH> 100644 --- a/handshake-state.js +++ b/handshake-state.js @@ -295,7 +295,7 @@ function readMessage (state, message, payloadBuffer) { if (state.messagePatterns.length === 0) { var tx = sodium.sodium_malloc(cipherState.STATELEN) var rx = sodium.sodium_malloc(cipherState.STATELEN) - symmetricState.split(state.symmetricState, tx, rx) + symmetricState.split(state.symmetricState, rx, tx) return {tx, rx} }
Swap (tx, rx) so they are symmetric in readMessage and writeMessage
emilbayes_noise-protocol
train
js
b3da612a0e0937dbfbf5bffc3618d0c8901c8714
diff --git a/timepiece/views.py b/timepiece/views.py index <HASH>..<HASH> 100644 --- a/timepiece/views.py +++ b/timepiece/views.py @@ -521,6 +521,7 @@ def view_person_time_sheet(request, person_id, period_id=None, window_id=None): total_statuses = len(statuses) unverified_count = statuses.count('unverified') verified_count = statuses.count('verified') + approved_count = statuses.count('approved') if time_sheet.user.pk == request.user.pk: show_verify = unverified_count != 0
Bug fix: Forgot one more line in the last commit
caktus_django-timepiece
train
py
ef98e68ecc873071a55c762d8f6ba3cfda292c20
diff --git a/mutagen/flac.py b/mutagen/flac.py index <HASH>..<HASH> 100644 --- a/mutagen/flac.py +++ b/mutagen/flac.py @@ -503,6 +503,21 @@ class Picture(MetadataBlock): * colors -- number of colors for indexed palettes (like GIF), 0 for non-indexed * data -- picture data + + To create a picture from file (in order to add to a FLAC file), + instantiate this object without passing anything to the constructor and + then set the properties manually:: + + p = Picture() + + with open("Folder.jpg", "rb") as f: + pic.data = f.read() + + pic.type = APICType.COVER_FRONT + pic.mime = u"image/jpeg" + pic.width = 500 + pic.height = 500 + pic.depth = 16 # color depth """ code = 6
docs: add example for how to create a new flac.Picture (Fixes issue #<I>)
quodlibet_mutagen
train
py
dda1d6d3ff1b5372887f89334f88d4be63ebfb67
diff --git a/manticore/ethereum.py b/manticore/ethereum.py index <HASH>..<HASH> 100644 --- a/manticore/ethereum.py +++ b/manticore/ethereum.py @@ -613,7 +613,7 @@ class ABI(object): ''' Build transaction data from function signature and arguments ''' - m = re.match(r"(?P<name>[a-zA-Z_]+)(?P<type>\(.*\))", type_spec) + m = re.match(r"(?P<name>[a-zA-Z_][a-zA-Z_0-9]*)(?P<type>\(.*\))", type_spec) if not m: raise EthereumError("Function signature expected")
Allow function identifiers on smart contract to have numbers on them (#<I>)
trailofbits_manticore
train
py
d250e2f2ea7827f2693da8c51e67a69a085b20d0
diff --git a/src/SDP/Asset.php b/src/SDP/Asset.php index <HASH>..<HASH> 100755 --- a/src/SDP/Asset.php +++ b/src/SDP/Asset.php @@ -40,6 +40,14 @@ class SDP_Asset extends Pluf_Model 'editable' => false, 'readable' => true ), + 'file_name' => array( + 'type' => 'Pluf_DB_Field_Varchar', + 'blank' => true, + 'default' => 'noname', + 'size' => 256, + 'editable' => true, + 'readable' => true + ), 'download' => array( 'type' => 'Pluf_DB_Field_Integer', 'blank' => false,
A field named file_name is added to SDP_Asset
pluf_cms
train
php
db39133bfee0935b65aa31738667319fb15ed4ef
diff --git a/spec/project_spec.rb b/spec/project_spec.rb index <HASH>..<HASH> 100644 --- a/spec/project_spec.rb +++ b/spec/project_spec.rb @@ -191,14 +191,14 @@ RSpec.describe 'RuboCop Project', type: :feature do describe 'requiring all of `lib` with verbose warnings enabled' do it 'emits no warnings' do - whitelisted = lambda do |line| + allowed = lambda do |line| line =~ /warning: private attribute\?$/ && RUBY_VERSION < '2.3' end warnings = `ruby -Ilib -w -W2 lib/rubocop.rb 2>&1` .lines .grep(%r{/lib/rubocop}) # ignore warnings from dependencies - .reject(&whitelisted) + .reject(&allowed) expect(warnings.empty?).to be(true) end end
Follow Rails lead on naming See rails/rails#<I>.
rubocop-hq_rubocop
train
rb
693c80f19418f6962be50d331165d53e2b7274d2
diff --git a/aeron-client/src/main/java/uk/co/real_logic/aeron/Aeron.java b/aeron-client/src/main/java/uk/co/real_logic/aeron/Aeron.java index <HASH>..<HASH> 100644 --- a/aeron-client/src/main/java/uk/co/real_logic/aeron/Aeron.java +++ b/aeron-client/src/main/java/uk/co/real_logic/aeron/Aeron.java @@ -20,8 +20,7 @@ import uk.co.real_logic.aeron.common.CommonContext; import uk.co.real_logic.aeron.common.concurrent.logbuffer.DataHandler; import uk.co.real_logic.aeron.exceptions.DriverTimeoutException; import uk.co.real_logic.agrona.*; -import uk.co.real_logic.agrona.concurrent.AgentRunner; -import uk.co.real_logic.agrona.concurrent.IdleStrategy; +import uk.co.real_logic.agrona.concurrent.*; import uk.co.real_logic.agrona.concurrent.broadcast.BroadcastReceiver; import uk.co.real_logic.agrona.concurrent.broadcast.CopyBroadcastReceiver; import uk.co.real_logic.agrona.concurrent.ringbuffer.ManyToOneRingBuffer;
[Java]: Moved package for SleepingIdleStrategy.
real-logic_aeron
train
java
1a602bc3c03d57fb410431ca873541199fc9d07d
diff --git a/parsl/launchers/launchers.py b/parsl/launchers/launchers.py index <HASH>..<HASH> 100644 --- a/parsl/launchers/launchers.py +++ b/parsl/launchers/launchers.py @@ -298,7 +298,7 @@ class AprunLauncher(Launcher): ---------- options: str - This string will be passed to the aprun launcher. Default: None + This string will be passed to the aprun launcher. Default: '' """ self.overrides = overrides
make Aprun default comment consistent with other launchers
Parsl_parsl
train
py
31229dd233c36a4528f884654ab747f108cb6d79
diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Controller/Controller.php +++ b/lib/Cake/Controller/Controller.php @@ -462,8 +462,8 @@ class Controller extends Object implements EventListener { $this->request = $request; $this->plugin = isset($request->params['plugin']) ? Inflector::camelize($request->params['plugin']) : null; $this->view = isset($request->params['action']) ? $request->params['action'] : null; - if (isset($request->params['pass']) && isset($request->params['named'])) { - $this->passedArgs = array_merge($request->params['pass'], $request->params['named']); + if (isset($request->params['pass'])) { + $this->passedArgs = $request->params['pass']; } if (array_key_exists('return', $request->params) && $request->params['return'] == 1) {
Update passedArgs named parameters have been removed.
cakephp_cakephp
train
php
0a6fb0d936dc18f661d2470e2dc1f651454b03bb
diff --git a/LiSE/LiSE/portal.py b/LiSE/LiSE/portal.py index <HASH>..<HASH> 100644 --- a/LiSE/LiSE/portal.py +++ b/LiSE/LiSE/portal.py @@ -165,8 +165,6 @@ class Portal(Edge, RuleFollower, TimeDispatcher): if not self.engine.caching: super().__setitem__(key, value) return - if key in self.character._portal_traits: - self.character._portal_traits = set() super().__setitem__(key, value) self.dispatch(key, value) @@ -175,8 +173,6 @@ class Portal(Edge, RuleFollower, TimeDispatcher): if not self.engine.caching: super().__delitem__(key) return - if key in self.character._portal_traits: - self.character._portal_traits = set() self.dispatch(key, None) def __repr__(self):
Delete the remnants of a previous caching scheme
LogicalDash_LiSE
train
py
80ab224a68fee7962187e2e3247bf05c26ac6d61
diff --git a/lib/sensu/server.rb b/lib/sensu/server.rb index <HASH>..<HASH> 100644 --- a/lib/sensu/server.rb +++ b/lib/sensu/server.rb @@ -299,7 +299,7 @@ module Sensu else @logger.error('mutator error', { :event => event, - :extension => extension, + :extension => extension.name, :error => 'non-zero exit status (' + status.to_s + '): ' + output }) @handlers_in_progress_count -= 1
log failed extension mutator name instead of empty curly braces
sensu_sensu
train
rb
3687e7c9e72432a055b877e1016500839bd71531
diff --git a/lib/filepicker/rails/version.rb b/lib/filepicker/rails/version.rb index <HASH>..<HASH> 100644 --- a/lib/filepicker/rails/version.rb +++ b/lib/filepicker/rails/version.rb @@ -1,5 +1,5 @@ module Filepicker module Rails - VERSION = "0.0.2" + VERSION = "0.0.3" end end
Update Version with @edowling suggestions
filestack_filestack-rails
train
rb
0359a9ae3c4836f45223d0bbf7b2412ce401c2f9
diff --git a/ember-cli-build.js b/ember-cli-build.js index <HASH>..<HASH> 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -1,10 +1,12 @@ -/*jshint node:true*/ +/* jshint node:true*/ /* global require, module */ -var EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); +let EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); module.exports = function(defaults) { - var app = new EmberAddon(defaults, { - // Add options here + let app = new EmberAddon(defaults, { + flatpickr: { + theme: 'dark' + } }); /*
Try to set theme for dummy app
shipshapecode_ember-flatpickr
train
js
5909b049f560ac6da4cc81467632810174ad200c
diff --git a/scripts/experiments/run_srl.py b/scripts/experiments/run_srl.py index <HASH>..<HASH> 100755 --- a/scripts/experiments/run_srl.py +++ b/scripts/experiments/run_srl.py @@ -660,6 +660,9 @@ class ParamDefinitions(): base_work_mem_megs = 5*1024 elif exp.get("includeSrl") == False: base_work_mem_megs = 5 * 1000 + is_higher_order = exp.get("grandparentFactors") or exp.get("siblingFactors") + if exp.get("pruneEdges") == False and is_higher_order: + base_work_mem_megs = 20*1000 else: if exp.get("useProjDepTreeFactor"): base_work_mem_megs = 20 * 1000 @@ -849,7 +852,6 @@ class SrlExpParamsRunner(ExpParamsRunner): parser += SrlExpParams(pruneModel=pruneModel) exp = g.defaults + data + parser exp += SrlExpParams(work_mem_megs=self.prm_defs.get_srl_work_mem_megs(exp)) - #TODO: Maybe remove? if parser != first_order: exp += SrlExpParams(work_mem_megs=20*1000) exps.append(exp) return self._get_pipeline_from_exps(exps)
Giving more memory to unpruned 2nd-order models
mgormley_pacaya
train
py
fb7759e06b3f888c4e2c328c6e5bdb4f35fdef99
diff --git a/icekit/api/base_serializers.py b/icekit/api/base_serializers.py index <HASH>..<HASH> 100644 --- a/icekit/api/base_serializers.py +++ b/icekit/api/base_serializers.py @@ -113,7 +113,8 @@ class WritableSerializerHelperMixin(object): for fieldname, field in self.get_fields().items(): if isinstance(field, ModelSubSerializer): field_data = validated_data.pop(fieldname) - validated_data.update(field_data) + if field_data: + validated_data.update(field_data) def _get_or_create_related_model_instances(self, validated_data): """ @@ -183,10 +184,10 @@ class WritableSerializerHelperMixin(object): u" 'can_update' is not set for this field in" u" 'writable_related_fields' but submitted" u" value `%s=%s` does not match existing" - u" instance %s" + u" instance value `%s`" % (fieldname, ModelClass.__name__, self.Meta.model.__name__, name, value, - related_instance) + original_value) ) setattr(related_instance, name, value) is_updated = True
#<I> Fix crash on null value for `ModelSubSerializer` field If a `ModelSubSerializer` API field is flagged as `allow_null` it might receive some null/empty data. Don't crash if that happens.
ic-labs_django-icekit
train
py
4cc2309eaeb65b505817157978c122a943693275
diff --git a/app.js b/app.js index <HASH>..<HASH> 100644 --- a/app.js +++ b/app.js @@ -47,8 +47,7 @@ module.exports = { opts.COUCH_BUFFER_SIZE, opts.COUCH_PARALLELISM, opts.COUCH_LOG, - opts.COUCH_RESUME, - opts.OUTPUT + opts.COUCH_RESUME ).on('written', function(obj) { debug(' backed up batch', obj.batch, ' docs: ', obj.total, 'Time', obj.time); writeStream.write(JSON.stringify(obj.data) + '\n'); diff --git a/includes/backup.js b/includes/backup.js index <HASH>..<HASH> 100644 --- a/includes/backup.js +++ b/includes/backup.js @@ -61,7 +61,7 @@ var processBatches = function(dbUrl, parallelism, log, batches, ee, start, grand }; // backup function -module.exports = function(dbUrl, blocksize, parallelism, log, resume, output) { +module.exports = function(dbUrl, blocksize, parallelism, log, resume) { if (typeof blocksize === 'string') { blocksize = parseInt(blocksize); }
Remove unused output parameter to backup method The `--output` argument is converted into a file in the application code. #<I>
cloudant_couchbackup
train
js,js
1f8404cb6a91855dbc3a07a197a87c6d34b26730
diff --git a/contrib/git-sync/main.go b/contrib/git-sync/main.go index <HASH>..<HASH> 100644 --- a/contrib/git-sync/main.go +++ b/contrib/git-sync/main.go @@ -66,12 +66,14 @@ func main() { if _, err := exec.LookPath("git"); err != nil { log.Fatalf("required git executable not found: %v", err) } - if err := syncRepo(*flRepo, *flDest, *flBranch, *flRev); err != nil { - log.Fatalf("error syncing repo: %v", err) + for { + if err := syncRepo(*flRepo, *flDest, *flBranch, *flRev); err != nil { + log.Fatalf("error syncing repo: %v", err) + } + log.Printf("wait %d seconds", *flWait) + time.Sleep(time.Duration(*flWait) * time.Second) + log.Println("done") } - log.Printf("wait %d seconds", *flWait) - time.Sleep(time.Duration(*flWait) * time.Second) - log.Println("done") } // syncRepo syncs the branch of a given repository to the destination at the given rev.
let the contrib/git-sync use a for-loop, rather than relying on the pod's restart policy, to periodically pull from the repo
kubernetes_kubernetes
train
go
6682309ec2401a5b98f8c22dcdbca4d5a3930e1c
diff --git a/lib/rbk/cli.rb b/lib/rbk/cli.rb index <HASH>..<HASH> 100644 --- a/lib/rbk/cli.rb +++ b/lib/rbk/cli.rb @@ -10,7 +10,7 @@ module Rbk @argv = argv @options = options @git = @options[:git] || Git - @github = @options[:github_repos] || Github::Repos + @github_repos = @options[:github_repos] || Github::Repos end def setup @@ -36,7 +36,7 @@ module Rbk def repos @repos ||= begin - r = @github.new(oauth_token: @config.github_access_token) + r = @github_repos.new(oauth_token: @config.github_access_token) r.list(org: @config.organization, auto_pagination: true) end end
Rename `github` instance variable in Cli
mthssdrbrg_rbk
train
rb