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
fc435fae36825258c35eb583be5a4b4e1e83d93c
diff --git a/raiden/ui/cli.py b/raiden/ui/cli.py index <HASH>..<HASH> 100644 --- a/raiden/ui/cli.py +++ b/raiden/ui/cli.py @@ -150,6 +150,14 @@ def check_synced(blockchain_service): "node cannot be trusted. Giving up.\n" ) sys.exit(1) + except KeyError: + print( + 'Your ethereum client is connected to a non-recognized private \n' + 'network with network-ID {}. Since we can not check if the client \n' + 'is synced please restart raiden with the --no-sync-check argument.' + '\n'.format(net_id) + ) + sys.exit(1) url = ETHERSCAN_API.format( network=network,
Give warning for nosyncheck arg for privatenets
raiden-network_raiden
train
py
caa32076af66326fbff4ee90a9c7f29479586778
diff --git a/keywords/_util.js b/keywords/_util.js index <HASH>..<HASH> 100644 --- a/keywords/_util.js +++ b/keywords/_util.js @@ -4,7 +4,7 @@ module.exports = { metaSchemaRef: metaSchemaRef }; -var META_SCHEMA_ID = 'http://json-schema.org/draft-06/schema'; +var META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema'; function metaSchemaRef(ajv) { var defaultMeta = ajv._opts.defaultMeta;
fix: draft-<I> is a default schema
epoberezkin_ajv-keywords
train
js
0c2c99b951f85c42bd17dc861b009efa1ae70c96
diff --git a/dashboard/modules/snapshot/snapshot_head.py b/dashboard/modules/snapshot/snapshot_head.py index <HASH>..<HASH> 100644 --- a/dashboard/modules/snapshot/snapshot_head.py +++ b/dashboard/modules/snapshot/snapshot_head.py @@ -4,9 +4,6 @@ from ray.core.generated import gcs_service_pb2_grpc from ray.experimental.internal_kv import _internal_kv_get import ray.new_dashboard.utils as dashboard_utils -from ray.serve.controller import SNAPSHOT_KEY as SERVE_SNAPSHOT_KEY -from ray.serve.constants import SERVE_CONTROLLER_NAME -from ray.serve.kv_store import format_key import json @@ -91,6 +88,15 @@ class SnapshotHead(dashboard_utils.DashboardHeadModule): return actors async def get_serve_info(self): + # Conditionally import serve to prevent ModuleNotFoundError from serve + # dependencies when only ray[default] is installed (#17712) + try: + from ray.serve.controller import SNAPSHOT_KEY as SERVE_SNAPSHOT_KEY + from ray.serve.constants import SERVE_CONTROLLER_NAME + from ray.serve.kv_store import format_key + except Exception: + return "{}" + client = self._dashboard_head.gcs_client # Serve wraps Ray's internal KV store and specially formats the keys.
[Dashboard] [Serve] Make serve import conditional (#<I>)
ray-project_ray
train
py
5f724c93f64874f435b8fde4321e234d32879390
diff --git a/sources/lib/Converter/PgJson.php b/sources/lib/Converter/PgJson.php index <HASH>..<HASH> 100644 --- a/sources/lib/Converter/PgJson.php +++ b/sources/lib/Converter/PgJson.php @@ -117,9 +117,9 @@ class PgJson implements ConverterInterface if ($return === false) { throw new ConverterException( sprintf( - "Could not convert data to JSON. Driver returned '%s'.\n======\n%s\n", - json_last_error(), - $data + "Could not convert %s data to JSON. Driver returned '%s'.", + gettype($data), + json_last_error() ) ); }
fix error in PgJson exception if data not a string When the data given to the converter is not a string (can be any instances of classes implementing the `JsonSerializable` interface), and the json_encode fails, the error message was formatted assuming it could turn data into a string which may not be the case. This was creating a fatal error in PHP.
pomm-project_Foundation
train
php
f58540d0b241b0afb293b07263226e40dc15118a
diff --git a/iserve-rest/src/main/java/uk/ac/open/kmi/iserve/rest/sal/resource/ServicesResource.java b/iserve-rest/src/main/java/uk/ac/open/kmi/iserve/rest/sal/resource/ServicesResource.java index <HASH>..<HASH> 100644 --- a/iserve-rest/src/main/java/uk/ac/open/kmi/iserve/rest/sal/resource/ServicesResource.java +++ b/iserve-rest/src/main/java/uk/ac/open/kmi/iserve/rest/sal/resource/ServicesResource.java @@ -552,6 +552,9 @@ public class ServicesResource { } catch (NumberFormatException nfe) { try { valueObj = new URI(value); + if (!((URI) valueObj).isAbsolute()) { + valueObj = value; + } } catch (URISyntaxException e) { valueObj = value; }
Fixed bug in RESTful interface. Now, literal values of service properties are stored properly.
kmi_iserve
train
java
0af07289fd1debc40a464d4129b5e9e320083794
diff --git a/Tone/core/Tone.js b/Tone/core/Tone.js index <HASH>..<HASH> 100644 --- a/Tone/core/Tone.js +++ b/Tone/core/Tone.js @@ -79,7 +79,7 @@ define("Tone/core/Tone", [], function(){ AudioNode.prototype._nativeConnect = AudioNode.prototype.connect; AudioNode.prototype.connect = function(B){ if (B.input){ - this._nativeConnect(B.input); + this.connect(B.input); } else { try { this._nativeConnect.apply(this, arguments);
recursive connect if the input is also a ToneNode
Tonejs_Tone.js
train
js
82f41b4e08b90200fbfd2bfb23c3cca7b3772b36
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,6 +5,12 @@ require 'rspec/rails' require 'factory_girl' Factory.find_definitions +User +class User + alias real_send_create_notification send_create_notification + def send_create_notification; end +end + # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
Do not construct mail on User creation in specs.
publify_publify
train
rb
4d7f2123d1269eac5f80e326e84ea573370556ba
diff --git a/spec/lib/great_pretender/pretender_spec.rb b/spec/lib/great_pretender/pretender_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/great_pretender/pretender_spec.rb +++ b/spec/lib/great_pretender/pretender_spec.rb @@ -5,12 +5,20 @@ class PrefixSlugPretender def say_hello "Hello, guest!" end + + def name + "Flip" + end end class TestSlugPretender def ohai "ohai" end + + def name + "Avery" + end end describe GreatPretender::Pretender do @@ -30,4 +38,7 @@ describe GreatPretender::Pretender do expect(recipient.say_hello).to eq("Hello, guest!") end + it "delegates methods to the most specific responder" do + expect(recipient.name).to eq("Avery") + end end
Add test for method specificity in pretenders
BackForty_great_pretender
train
rb
abecdcf35ddd26ad5e219d4abffa851869c3e951
diff --git a/art/art.py b/art/art.py index <HASH>..<HASH> 100644 --- a/art/art.py +++ b/art/art.py @@ -347,7 +347,7 @@ def text2art(text, font=DEFAULT_FONT, chr_ignore=True): result_list = [] letters = standard_dic text_temp = text - spliter = "\n" + splitter = "\n" if isinstance(text, str) is False: raise artError(TEXT_TYPE_ERROR) if isinstance(font, str) is False: @@ -386,8 +386,11 @@ def text2art(text, font=DEFAULT_FONT, chr_ignore=True): temp = temp + split_list[j][i] result_list.append(temp) if "win32" != sys.platform: - spliter = "\r\n" - return((spliter).join(result_list)) + splitter = "\r\n" + result = (splitter).join(result_list) + if result[-1] != "\n": + result += splitter + return result def set_default(font=DEFAULT_FONT, chr_ignore=True, filename="art",
fix : minor edit in text2art for 3new fonts
sepandhaghighi_art
train
py
bb78d043b4db822873ce386aa331f8af2710fc64
diff --git a/src/Node/NodeFactory.php b/src/Node/NodeFactory.php index <HASH>..<HASH> 100644 --- a/src/Node/NodeFactory.php +++ b/src/Node/NodeFactory.php @@ -56,14 +56,6 @@ final class NodeFactory } /** - * Creates "false" - */ - public function createFalseConstant(): ConstFetch - { - return BuilderHelpers::normalizeValue(false); - } - - /** * Creates "\SomeClass::CONSTANT" */ public function createClassConstant(string $className, string $constantName): ClassConstFetch
Remove unused method NodeFactory::createFalseConstant
rectorphp_rector
train
php
e6652caf678c2b34f1c574425588d1fe638ff573
diff --git a/threads/models.py b/threads/models.py index <HASH>..<HASH> 100644 --- a/threads/models.py +++ b/threads/models.py @@ -110,7 +110,7 @@ def post_save_thread(sender, instance, created, **kwargs): if not created and thread.number_of_messages == 0: thread.delete() -def update_message(sender, instance, created, **kwargs): +def post_save_message(sender, instance, created, **kwargs): message = instance thread = message.thread @@ -119,13 +119,13 @@ def update_message(sender, instance, created, **kwargs): thread.save() -def delete_message(sender, instance, **kwargs): +def post_delete_message(sender, instance, **kwargs): message = instance message.thread.save() # Connect signals with their respective functions from above. # When a message is created, update that message's thread's change_date to the post_date of that message. -models.signals.post_save.connect(update_message, sender=Message) -models.signals.post_delete.connect(delete_message, sender=Message) +models.signals.post_save.connect(post_save_message, sender=Message) +models.signals.post_delete.connect(post_delete_message, sender=Message) models.signals.pre_save.connect(pre_save_thread, sender=Thread) models.signals.post_save.connect(post_save_thread, sender=Thread)
Renamed functions to make their context more clear
knagra_farnsworth
train
py
85475da1175a633bdf4b52581591fbe03cc32bc5
diff --git a/nuimo_dbus.py b/nuimo_dbus.py index <HASH>..<HASH> 100644 --- a/nuimo_dbus.py +++ b/nuimo_dbus.py @@ -119,20 +119,24 @@ class GattDevice: return def connect(self): + self.__connect_retry_attempt = 0 self.__connect() + def connect_failed(self, e): + pass + def __connect(self): print("__connect...") + self.__connect_retry_attempt += 1 try: self.object.Connect() + if self.is_services_resolved(): + self.services_resolved() except dbus.exceptions.DBusException as e: - # TODO: Only retry on "software" exceptions and only retry for a given number of retries - print("Failed to connect:", e) - print("Trying to connect again...") - self.__connect() - - if self.is_services_resolved(): - self.services_resolved() + if (self.__connect_retry_attempt <= 5) and (e.get_dbus_name() == "org.bluez.Error.Failed") and (e.get_dbus_message() == "Software caused connection abort"): + self.__connect() + else: + self.connect_failed(e) def disconnect(self): self.object.Disconnect()
Retry device connection only after certain errors
getsenic_nuimo-linux-python
train
py
6884eb755e1e748ed103f6c5f6f3df5b2dc006c6
diff --git a/exchangelib/transport.py b/exchangelib/transport.py index <HASH>..<HASH> 100644 --- a/exchangelib/transport.py +++ b/exchangelib/transport.py @@ -220,26 +220,26 @@ def get_auth_method_from_response(response): def _tokenize(val): # Splits cookie auth values - auth_tokens = [] - auth_token = '' + auth_methods = [] + auth_method = '' quote = False for c in val: if c in (' ', ',') and not quote: - if auth_token not in ('', ','): - auth_tokens.append(auth_token) - auth_token = '' + if auth_method not in ('', ','): + auth_methods.append(auth_method) + auth_method = '' continue elif c == '"': - auth_token += c + auth_method += c if quote: - auth_tokens.append(auth_token) - auth_token = '' + auth_methods.append(auth_method) + auth_method = '' quote = not quote continue - auth_token += c - if auth_token: - auth_tokens.append(auth_token) - return auth_tokens + auth_method += c + if auth_method: + auth_methods.append(auth_method) + return auth_methods def dummy_xml(version, name):
Rename vars to avoid security linter false positive
ecederstrand_exchangelib
train
py
9a0e22165b75ac383be9b9dbe2755557fbca4d3d
diff --git a/lib/reset_properties.js b/lib/reset_properties.js index <HASH>..<HASH> 100644 --- a/lib/reset_properties.js +++ b/lib/reset_properties.js @@ -5,7 +5,8 @@ const getCacheFolderPath = require('../lib/get_cache_folder_path') module.exports = function () { return getCacheFolderPath('props') .then(function (propsDir) { - exec(`rm ${propsDir}/*.json`, function (err, res) { + // -f: ignore if there are no more files to delete + exec(`rm -f ${propsDir}/*.json`, function (err, res) { if (err) { console.error('reset properties failed', err) } else {
reset_properties: use a --force flag to ignore if there are no more files to delete instead rejecting an error
maxlath_wikidata-cli
train
js
03ddf0bda234a9bbe4ee4364160b7e053f1d3d0a
diff --git a/lib/flex.rb b/lib/flex.rb index <HASH>..<HASH> 100644 --- a/lib/flex.rb +++ b/lib/flex.rb @@ -628,7 +628,6 @@ module Flex def doc(*args) flex.doc(*args) end - alias_method :info, :doc def scan_search(*args, &block) flex.scan_search(*args, &block) diff --git a/lib/flex/deprecation.rb b/lib/flex/deprecation.rb index <HASH>..<HASH> 100644 --- a/lib/flex/deprecation.rb +++ b/lib/flex/deprecation.rb @@ -78,6 +78,13 @@ module Flex end + # Flex.info + def info(*names) + Deprecation.warn 'Flex.info', 'Flex.doc' + doc *names + end + + module Result::Collection NEW_MODULE = Struct::Paginable extend Deprecation::Module
added deprecation warning for Flex.info
elastics_elastics
train
rb,rb
3d16d1af9166f9cea422806fb08560730233c07c
diff --git a/lib/configurations/maps/readers/tolerant.rb b/lib/configurations/maps/readers/tolerant.rb index <HASH>..<HASH> 100644 --- a/lib/configurations/maps/readers/tolerant.rb +++ b/lib/configurations/maps/readers/tolerant.rb @@ -3,8 +3,8 @@ module Configurations module Readers class Tolerant def read(map, path) - path.reduce(map) do |map, value| - map[value] if map + path.reduce(map) do |m, value| + m[value] if m end end end diff --git a/test/configurations/configuration/test_configure_synchronized.rb b/test/configurations/configuration/test_configure_synchronized.rb index <HASH>..<HASH> 100644 --- a/test/configurations/configuration/test_configure_synchronized.rb +++ b/test/configurations/configuration/test_configure_synchronized.rb @@ -19,7 +19,6 @@ class TestConfigurationSynchronized < MiniTest::Test def test_configuration_synchronized collector = [] - semaphore = Mutex.new threads = 100.times.map do |i| Thread.new do sleep i%50 / 1000.0
Fix warnings for shadowed and unused variables
beatrichartz_configurations
train
rb,rb
d969c0a5ea1de270d890466693efa6cd048657c3
diff --git a/Services/Twilio/CapabilityTaskRouter.php b/Services/Twilio/CapabilityTaskRouter.php index <HASH>..<HASH> 100644 --- a/Services/Twilio/CapabilityTaskRouter.php +++ b/Services/Twilio/CapabilityTaskRouter.php @@ -17,7 +17,7 @@ class Services_Twilio_TaskRouter_Worker_Capability private $workerSid; private $apiCapability; - private $baseUrl = 'https://api.twilio.com/2010-04-01'; + private $baseUrl = 'https://taskrouter.twilio.com/v1'; private $baseWsUrl = 'https://event-bridge.twilio.com/v1/wschannels'; private $workerUrl; private $reservationsUrl; @@ -32,7 +32,7 @@ class Services_Twilio_TaskRouter_Worker_Capability $this->authToken = $authToken; $this->workspaceSid = $workspaceSid; $this->workerSid = $workerSid; - $this->apiCapability = new Services_Twilio_API_Capability($accountSid, $authToken, '2010-04-10', $workerSid); + $this->apiCapability = new Services_Twilio_API_Capability($accountSid, $authToken, 'v1', $workerSid); if(isset($overrideBaseWDSUrl)) { $this->baseUrl = $overrideBaseWDSUrl; }
Update base URL and version for TaskRouter scoped token generation
twilio_twilio-php
train
php
ca1d5cb2f130ae92d010abcb33b898813b0f03f1
diff --git a/art/art.py b/art/art.py index <HASH>..<HASH> 100644 --- a/art/art.py +++ b/art/art.py @@ -11,7 +11,7 @@ SMALLTHRESHOLD = 80 MEDIUMTHRESHOLD = 200 LARGETHRESHOLD = 500 -description = '''ASCII art is also known as "computer text art". +DESCRIPTION = '''ASCII art is also known as "computer text art". It involves the smart placement of typed special characters or letters to make a visual shape that is spread over multiple lines of text. Art is a Python lib for text converting to ASCII ART fancy.''' @@ -344,7 +344,7 @@ def help_func(): ''' tprint("art") tprint("v" + VERSION) - print(description + "\n") + print(DESCRIPTION + "\n") print("Webpage : http://art.shaghighi.ir\n") print("Help : \n") print(" - list --> (list of arts)\n")
fix : description renamed to DESCRIPTION
sepandhaghighi_art
train
py
75343f83e31d7b50e1b1fbcb0e83b128ae3fe4d1
diff --git a/src/main.py b/src/main.py index <HASH>..<HASH> 100644 --- a/src/main.py +++ b/src/main.py @@ -65,7 +65,7 @@ def cmd_list(args): print '#%s Display %s %s' % (n, _id, ' '.join(get_flags_of_display(_id))) cmode = Q.CGDisplayCopyDisplayMode(_id) - for m in Q.CGDisplayCopyAllDisplayModes(_id, None): + for mode in Q.CGDisplayCopyAllDisplayModes(_id, None): if (not args.all and not Q.CGDisplayModeIsUsableForDesktopGUI( mode)):
bugfix: m -> mode
bwesterb_displays
train
py
3f8094cb18ed5e974270709a659548200df7c588
diff --git a/src/threadPool.py b/src/threadPool.py index <HASH>..<HASH> 100644 --- a/src/threadPool.py +++ b/src/threadPool.py @@ -40,7 +40,7 @@ class ThreadPool(Module): self.pool.expectedFT -= 1 self.pool.workers.remove(self) self.pool.cond.release() - self.l.debug("Bye") + self.l.debug("Bye (%s)" % self.name) def __init__(self, *args, **kwargs): super(ThreadPool, self).__init__(*args, **kwargs)
threadPool: add name to "Bye"
bwesterb_mirte
train
py
ef219e6386682e38b012883fcc02d0442464dcea
diff --git a/src/NullCache.php b/src/NullCache.php index <HASH>..<HASH> 100644 --- a/src/NullCache.php +++ b/src/NullCache.php @@ -16,7 +16,7 @@ class NullCache implements Cache */ public function get($key, $default = null) { - return false; + return $default; } /** diff --git a/tests/NullCacheTest.php b/tests/NullCacheTest.php index <HASH>..<HASH> 100644 --- a/tests/NullCacheTest.php +++ b/tests/NullCacheTest.php @@ -10,7 +10,8 @@ class NullCacheTest extends \PHPUnit\Framework\TestCase public function testNullCache() { $cache = new NullCache(); - $this->assertFalse($cache->get('foo')); + $this->assertNull($cache->get('foo')); + $this->assertEquals('dflt', $cache->get("foo", "dflt")); $this->assertFalse($cache->set('foo', 'bar')); $this->assertFalse($cache->delete('foo')); $this->assertFalse($cache->clean());
Make NullCache a little more PSR-<I> compliant by making it heed the dafault
Vectorface_cache
train
php,php
d6852d10b25e073840278e1708b8c44cab298ab3
diff --git a/test/lynckia-test.js b/test/lynckia-test.js index <HASH>..<HASH> 100644 --- a/test/lynckia-test.js +++ b/test/lynckia-test.js @@ -1,8 +1,8 @@ /*global require, module*/ var vows = require('vows'), assert = require('assert'), - N = require('./extras/basic_example/nuve'), - config = require('./lynckia_config'); + N = require('../extras/basic_example/nuve'), + config = require('../lynckia_config'); vows.describe('lynckia').addBatch({ "Lynckia service": {
Testing travis with apt-get
lynckia_licode
train
js
24c65d838f2d8677c36e37d18206fa7fc224a726
diff --git a/web/web.go b/web/web.go index <HASH>..<HASH> 100644 --- a/web/web.go +++ b/web/web.go @@ -9,7 +9,9 @@ import ( "crypto/sha1" "encoding/base64" "fmt" - "github.com/codegangsta/martini" + // When do the merges, should correct the import path + // or martini.Context would not be correctly injected + "github.com/Archs/martini" "io/ioutil" "mime" "net/http" diff --git a/web/web_test.go b/web/web_test.go index <HASH>..<HASH> 100644 --- a/web/web_test.go +++ b/web/web_test.go @@ -1,7 +1,9 @@ package web import ( - "github.com/codegangsta/martini" + // When do the merges, should correct the import path + // or martini.Context would not be correctly injected + "github.com/Archs/martini" "net/http" "net/http/httptest" "testing"
update web to work with new martini route method: Any
codegangsta_martini-contrib
train
go,go
e2db7a5da47570e5109350337496840e9fead6fc
diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index <HASH>..<HASH> 100755 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -1767,8 +1767,10 @@ public class Jenkins extends AbstractCIBase implements ModifiableItemGroup<TopLe * correctly, especially when a migration is involved), but the downside * is that unless you are processing a request, this method doesn't work. * - * Please note that this will not work in all cases if Jenkins is running behind a reverse proxy. - * In this case, only the user-configured value from getRootUrl is correct. + * Please note that this will not work in all cases if Jenkins is running behind a + * reverse proxy (namely when user has switched off ProxyPreserveHost, which is + * default setup) and you should use getRootUrl if you want to be sure you reflect + * user setup. * See https://wiki.jenkins-ci.org/display/JENKINS/Running+Jenkins+behind+Apache * * @since 1.263
changed text a bit after some discussion with vjuranek
jenkinsci_jenkins
train
java
e6acde5d5f7986e3604933f5ee7f048f477401af
diff --git a/openquake/commonlib/oqvalidation.py b/openquake/commonlib/oqvalidation.py index <HASH>..<HASH> 100644 --- a/openquake/commonlib/oqvalidation.py +++ b/openquake/commonlib/oqvalidation.py @@ -171,15 +171,14 @@ class OqParam(valid.ParamSet): flags = dict( sites=getattr(self, 'sites', 0), sites_csv=self.inputs.get('sites', 0), - sites_model_file=self.inputs.get('site_model', 0), hazard_curves_csv=self.inputs.get('hazard_curves', 0), gmvs_csv=self.inputs.get('gmvs', 0), region=getattr(self, 'region', 0), exposure=self.inputs.get('exposure', 0)) # NB: below we check that all the flags # are mutually exclusive - return sum(bool(v) for v in flags.values()) == 1 or ( - self.inputs.get('site_model')) + return sum(bool(v) for v in flags.values()) == 1 or self.inputs.get( + 'site_model') def is_valid_poes(self): """
Removed a file added by accident
gem_oq-engine
train
py
b6c81ac52dfeb2167299474da2e767cef1514277
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ const {toString} = Object.prototype; const vowels = /^[aeiou]/i; -const builtin = [Array, Boolean, Date, Error, Function, Number, Object, RegExp, String, Symbol]; +const builtin = [Array, Boolean, Date, Error, Function, Number, Object, Promise, RegExp, String, Symbol]; if (typeof Buffer == 'function') builtin.push(Buffer); const _TypeError = TypeError;
fix: add Promise to builtin array
aleclarson_type-error
train
js
d9455a7646e56c2f445a0123762505bb6cfcd600
diff --git a/ui/src/utils/groupBy.js b/ui/src/utils/groupBy.js index <HASH>..<HASH> 100644 --- a/ui/src/utils/groupBy.js +++ b/ui/src/utils/groupBy.js @@ -99,11 +99,15 @@ const constructCells = serieses => { vals, })) + const tagSet = map(Object.keys(tags), tag => `[${tag}=${tags[tag]}]`) + .sort() + .join('') + const unsortedLabels = map(columns.slice(1), (field, i) => ({ label: groupByColumns && i <= groupByColumns.length - 1 ? `${field}` - : `${measurement}.${field}`, + : `${measurement}.${field}${tagSet}`, responseIndex, seriesIndex, }))
Restore groupBy naming behavior for lineGraphs
influxdata_influxdb
train
js
85ac2400033f4d9d9213684a0d2b0aa0374ecc6b
diff --git a/src/Drupal/DrupalExtension/Context/DrupalContext.php b/src/Drupal/DrupalExtension/Context/DrupalContext.php index <HASH>..<HASH> 100644 --- a/src/Drupal/DrupalExtension/Context/DrupalContext.php +++ b/src/Drupal/DrupalExtension/Context/DrupalContext.php @@ -172,7 +172,7 @@ class DrupalContext extends MinkContext implements DrupalAwareInterface { * Override MinkContext::locatePath() to work around Selenium not supporting * basic auth. */ - protected function locatePath($path) { + public function locatePath($path) { $driver = $this->getSession()->getDriver(); if ($driver instanceof Selenium2Driver && isset($this->basic_auth)) { // Add the basic auth parameters to the base url. This only works for
Issue #<I> by langworthy: Fixed locatePath() should be public.
jhedstrom_drupalextension
train
php
d5ceac43b71e6bda34b35762008b1231edd08751
diff --git a/Component/Drivers/PostgreSQL.php b/Component/Drivers/PostgreSQL.php index <HASH>..<HASH> 100644 --- a/Component/Drivers/PostgreSQL.php +++ b/Component/Drivers/PostgreSQL.php @@ -305,7 +305,7 @@ class PostgreSQL extends DoctrineBaseDriver implements Manageble, Routable, Geog $wkt = $db->quote($wkt); $srid = is_numeric($srid) ? intval($srid) : $db->quote($srid); $sridTo = is_numeric($sridTo) ? intval($sridTo) : $db->quote($sridTo); - return "(ST_ISVALID($geomFieldName) AND ST_INTERSECTS(ST_TRANSFORM(ST_GEOMFROMTEXT($wkt,$srid),$sridTo), $geomFieldName ))"; + return "(ST_TRANSFORM(ST_GEOMFROMTEXT($wkt,$srid),$sridTo) && ST_MakeValid($geomFieldName))"; } /**
Fix Postgis intersection filtering on self-intersecting geometries
mapbender_data-source
train
php
cc056e9a573bce9dfc9d32625383a9382732287b
diff --git a/lib/puppet/type/cron.rb b/lib/puppet/type/cron.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/type/cron.rb +++ b/lib/puppet/type/cron.rb @@ -427,7 +427,6 @@ Puppet::Type.newtype(:cron) do unless ret case name when :command - devfail "No command, somehow" unless @parameters[:ensure].value == :absent when :special # nothing else diff --git a/spec/unit/provider/cron/parsed_spec.rb b/spec/unit/provider/cron/parsed_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/provider/cron/parsed_spec.rb +++ b/spec/unit/provider/cron/parsed_spec.rb @@ -31,6 +31,14 @@ describe Puppet::Type.type(:cron).provider(:crontab) do ) end + let :resource_sparse do + Puppet::Type.type(:cron).new( + :minute => %w{42}, + :target => 'root', + :name => 'sparse' + ) + end + let :record_special do { :record_type => :crontab, @@ -321,5 +329,12 @@ describe Puppet::Type.type(:cron).provider(:crontab) do end end end + + describe "with a resource without a command" do + it "should not raise an error" do + expect { described_class.match(record,{resource_sparse[:name] => resource_sparse}) }.to_not raise_error + end + end + end end
(PUP-<I>) allow managing existing cronjobs without caring for command When the catalog contains a cron resource that does not specify a value for the command property, the transaction would fail with the cryptic error message 'no command, somehow' under certain conditions. This error is spurious. Generally, it's quite allowable to manage a subset of cron properties that does not include the command. Fixed by removing the devfail invocation. The command property is now handled just like the 'special' property.
puppetlabs_puppet
train
rb,rb
902720d89d441944b37ad896023b752c779cf872
diff --git a/asv/environment.py b/asv/environment.py index <HASH>..<HASH> 100644 --- a/asv/environment.py +++ b/asv/environment.py @@ -249,13 +249,14 @@ class Environment(object): """ self.install_requirements() self.uninstall(conf.project) - log.info("Installing {0} into {1}".format(conf.project, self.name)) + log.info("Building {0} for {1}".format(conf.project, self.name)) orig_path = os.getcwd() os.chdir(conf.project) try: - self.run(['setup.py', 'install']) + self.run(['setup.py', 'build']) finally: os.chdir(orig_path) + self.install(os.path.abspath(conf.project)) def can_install_project(self): """
Build with setup.py, then install with pip
airspeed-velocity_asv
train
py
fe041d419354fc83b35f9659a764bccf5107f155
diff --git a/ezp/Persistence/Content/Field.php b/ezp/Persistence/Content/Field.php index <HASH>..<HASH> 100644 --- a/ezp/Persistence/Content/Field.php +++ b/ezp/Persistence/Content/Field.php @@ -39,6 +39,6 @@ class Field extends AbstractValueObject /** * @var int|null Null if not created yet */ - public $versionId; + public $versionNo; } ?>
Fixed: $versionId -> $versionNo.
ezsystems_ezpublish-kernel
train
php
341b536bafe971f57fb3d8f61b4ed50ab2d22f9a
diff --git a/buildutils/bundle.py b/buildutils/bundle.py index <HASH>..<HASH> 100644 --- a/buildutils/bundle.py +++ b/buildutils/bundle.py @@ -35,8 +35,8 @@ pjoin = os.path.join # Constants #----------------------------------------------------------------------------- -bundled_version = (0,5,2) -libcapnp = "capnproto-c++-%i.%i.%i.tar.gz" % (bundled_version) +bundled_version = (0,5,3,1) +libcapnp = "capnproto-c++-%i.%i.%i.%i.tar.gz" % (bundled_version) libcapnp_url = "https://capnproto.org/" + libcapnp HERE = os.path.dirname(__file__)
Bump bundled capnp version to <I>
capnproto_pycapnp
train
py
5866d52ad770abcdf5c12b1d9c0bb9b5f075367b
diff --git a/script/build_gem.rb b/script/build_gem.rb index <HASH>..<HASH> 100755 --- a/script/build_gem.rb +++ b/script/build_gem.rb @@ -5,6 +5,8 @@ include RailsFancies # `git add .` # `git commit -m "Build v#{RailsFancies::VERSION} of rails_fancies"` `bundle` +`git add .` +`git commit` `git push origin master` # `gem push rails_fancies-#{RailsFancies::VERSION}.gem` `git tag v#{RailsFancies::VERSION} -a`
Fix nokogiri security by upgrading to <I>
obromios_rails_fancies
train
rb
1e50ec05376a88f9d8d0e7c84c9ea4542fed1846
diff --git a/salt/modules/xapi.py b/salt/modules/xapi.py index <HASH>..<HASH> 100644 --- a/salt/modules/xapi.py +++ b/salt/modules/xapi.py @@ -10,7 +10,7 @@ compatibility in mind. ''' import sys -from contextlib import contextmanager +import contextlib # This module has only been tested on Debian GNU/Linux and NetBSD, it # probably needs more path appending for other distributions. # The path to append is the path to python Xen libraries, where resides @@ -32,7 +32,7 @@ def __virtual__(): return 'virt' -@contextmanager +@contextlib.contextmanager def _get_xapi_session(): ''' Get a session to XenAPI. By default, use the local UNIX socket.
Don't import direct function in modules so they are not exposed
saltstack_salt
train
py
a133197d2545386bc556d2af436c9d9e3ad8e5ee
diff --git a/openquake/baselib/hdf5.py b/openquake/baselib/hdf5.py index <HASH>..<HASH> 100644 --- a/openquake/baselib/hdf5.py +++ b/openquake/baselib/hdf5.py @@ -433,10 +433,8 @@ def dumps(dic): new[k] = {cls2dotname(v.__class__): dumps(vars(v))} elif isinstance(v, dict): new[k] = dumps(v) - elif isinstance(v, str): - new[k] = '"%s"' % v else: - new[k] = v + new[k] = json.dumps(v) return "{%s}" % ','.join('\n"%s": %s' % it for it in new.items())
Fixed hdf5.dumps
gem_oq-engine
train
py
5f68f863e40ed935b1227bfe65958bc2a76922f4
diff --git a/src/SAML2/Assertion/Transformer/NameIdDecryptionTransformer.php b/src/SAML2/Assertion/Transformer/NameIdDecryptionTransformer.php index <HASH>..<HASH> 100644 --- a/src/SAML2/Assertion/Transformer/NameIdDecryptionTransformer.php +++ b/src/SAML2/Assertion/Transformer/NameIdDecryptionTransformer.php @@ -40,6 +40,7 @@ class NameIdDecryptionTransformer implements LoggerInterface $logger, PrivateKeyLoader $privateKeyLoader ) { + $this->logger = $logger; $this->privateKeyLoader = $privateKeyLoader; }
bugfix: Set logger in SAML2\Assertion\Transformer\NameIDDecryptionTransformer. This resolves #<I>.
simplesamlphp_saml2
train
php
f0535524c1030a8d715148a612aae94ee8041ad2
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -74,7 +74,7 @@ Queue.prototype.start = function (cb) { this.running = true - if (this.pending === this.concurrency) { + if (this.pending >= this.concurrency) { return }
Fix for "cannot update concurrency mid-process"
jessetane_queue
train
js
b1cf74350192f4cd7bcf8e056520bf068a4ef582
diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v2/spaces/_CreateSpaceRequest.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v2/spaces/_CreateSpaceRequest.java index <HASH>..<HASH> 100644 --- a/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v2/spaces/_CreateSpaceRequest.java +++ b/cloudfoundry-client/src/main/java/org/cloudfoundry/client/v2/spaces/_CreateSpaceRequest.java @@ -85,7 +85,7 @@ abstract class _CreateSpaceRequest { /** * The space quota definition id */ - @JsonProperty("space quota definition guid") + @JsonProperty("space_quota_definition_guid") @Nullable abstract String getSpaceQuotaDefinitionId();
Add underscores to variable Underscores are missing in the space quota definition guid variable. [resolves #<I>]
cloudfoundry_cf-java-client
train
java
73de826138e3614cd0e00e65932930f2bcc6cec8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,12 @@ setup( 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', - "Framework :: Django :: 1.4", + 'Framework :: Django :: 1.4', + 'Framework :: Django :: 1.5', + 'Framework :: Django :: 1.6', + 'Framework :: Django :: 1.7', + 'Framework :: Django :: 1.8', + 'Framework :: Django :: 1.9', 'Intended Audience :: Developers', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Software Development :: Libraries :: Python Modules',
add supported django versions This should now work up to django <I>. I'll try and help get automated testing set up so we can be more sure.
sveetch_django-feedparser
train
py
ecea7718010ad878954729385076c110b41a336b
diff --git a/src/ol/structs/rtree.js b/src/ol/structs/rtree.js index <HASH>..<HASH> 100644 --- a/src/ol/structs/rtree.js +++ b/src/ol/structs/rtree.js @@ -59,8 +59,8 @@ ol.structs.RTreeNode_ = function(bounds, parent, level) { * @param {string=} opt_type Type for another indexing dimension. */ ol.structs.RTreeNode_.prototype.find = function(bounds, results, opt_type) { - if (ol.extent.intersects(this.bounds, bounds) && - (!goog.isDef(opt_type) || this.types[opt_type] === true)) { + if ((!goog.isDef(opt_type) || this.types[opt_type] === true) && + ol.extent.intersects(this.bounds, bounds)) { var numChildren = this.children.length; if (numChildren === 0) { if (goog.isDef(this.object)) {
Making RTree's find more efficient By doing the type check before the intersection check, we can save he intersection check for cases where we don't care about type or have the specified type in a node.
openlayers_openlayers
train
js
979d9604a74f972de52dac2d9fd1cf08172d9167
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,5 @@ $:.unshift File.expand_path('../lib', File.dirname(__FILE__)) require 'respec' -require 'tmpdir' require 'temporaries' ROOT = File.expand_path('..', File.dirname(__FILE__))
No longer need tmpdir in specs.
oggy_respec
train
rb
301737221b8d9b87dfd2f0aa1c93ea665c17df41
diff --git a/jre_emul/android/platform/libcore/luni/src/test/java/libcore/java/text/NumberFormatTest.java b/jre_emul/android/platform/libcore/luni/src/test/java/libcore/java/text/NumberFormatTest.java index <HASH>..<HASH> 100644 --- a/jre_emul/android/platform/libcore/luni/src/test/java/libcore/java/text/NumberFormatTest.java +++ b/jre_emul/android/platform/libcore/luni/src/test/java/libcore/java/text/NumberFormatTest.java @@ -246,8 +246,9 @@ public class NumberFormatTest extends junit.framework.TestCase { public void test_currencyWithPatternDigits() throws Exception { // Japanese Yen 0 fractional digits. NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.JAPAN); - // TODO(tball): investigate iOS 10 failures, b/33557359. - //assertEquals("¥50", nf.format(50.00)); + String result = nf.format(50.00); + // Allow either full-width (0xFFE5) or regular width yen sign (0xA5). + assertTrue(result.equals("¥50") || result.equals("¥50")); // Armenian Dram 0 fractional digits. nf = NumberFormat.getCurrencyInstance(Locale.forLanguageTag("hy-AM"));
Fixes test by switching the expected currency symbol from the full width yen (0xFFE5) to the regular yen sign (0xA5).
google_j2objc
train
java
ee60ea56e119e6782a4512b333607def91e2cf34
diff --git a/gcs/bucket.go b/gcs/bucket.go index <HASH>..<HASH> 100644 --- a/gcs/bucket.go +++ b/gcs/bucket.go @@ -39,10 +39,11 @@ type Bucket interface { Name() string // Create a reader for the contents of a particular generation of an object. - // The caller must arrange for the reader to be closed when it is no longer - // needed. + // On a nil error, the caller must arrange for the reader to be closed when + // it is no longer needed. // - // If the object doesn't exist, err will be of type *NotFoundError. + // Non-existent objects cause either this method or the first read from the + // resulting reader to return an error of type *NotFoundError. // // Official documentation: // https://cloud.google.com/storage/docs/json_api/v1/objects/get
Updated the contract for NewReader.
jacobsa_gcloud
train
go
cca303ce333dd84a39b5b1c4ca221b2e8c1bb119
diff --git a/wpull/http.py b/wpull/http.py index <HASH>..<HASH> 100644 --- a/wpull/http.py +++ b/wpull/http.py @@ -326,7 +326,7 @@ class Connection(object): gzipped = 'gzip' in response.fields.get('Content-Encoding', '') # TODO: handle gzip responses - if re.search(r'chunked$|;', + if re.match(r'chunked($|;)', response.fields.get('Transfer-Encoding', '')): yield self._read_response_by_chunk(response) elif 'Content-Length' in response.fields:
Fixes chunked transfer encoding field match.
ArchiveTeam_wpull
train
py
b8737a28d095a2c6ca0d5a4f1ace7ccf4f32b68c
diff --git a/karma.conf.js b/karma.conf.js index <HASH>..<HASH> 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -11,6 +11,7 @@ module.exports = function(config) { files: [ 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.1/jquery.min.js', + 'https://cdnjs.cloudflare.com/ajax/libs/velocity/1.2.3/velocity.js', 'dist/garnish-0.1.js', 'test/**/*.js' ], diff --git a/karma.coverage.conf.js b/karma.coverage.conf.js index <HASH>..<HASH> 100644 --- a/karma.coverage.conf.js +++ b/karma.coverage.conf.js @@ -9,6 +9,7 @@ module.exports = function(config) { files: [ 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.1/jquery.min.js', + 'https://cdnjs.cloudflare.com/ajax/libs/velocity/1.2.3/velocity.js', 'dist/garnish-0.1.js', 'test/**/*.js' ],
Added Velocity.js to karma config files
pixelandtonic_garnishjs
train
js,js
45d704a4ea29da176f1250d3ee40a1e09d63ef96
diff --git a/sockeye/data_io.py b/sockeye/data_io.py index <HASH>..<HASH> 100644 --- a/sockeye/data_io.py +++ b/sockeye/data_io.py @@ -630,7 +630,7 @@ def prepare_data(source_fnames: List[str], save_shard(shard_idx, data_loader, shard_sources, shard_target, shard_stats, output_prefix, keep_tmp_shard_files) else: - logger.info(f"Processing shards using {max_processes} processes.") + logger.info("Processing shards using %s processes.", max_processes) # Process shards in parallel using max_processes process results = [] pool = multiprocessing.pool.Pool(processes=max_processes)
fix Python <I> build, no format strings (#<I>)
awslabs_sockeye
train
py
c15dd3f75971e5047c304d9e4e25d7bd97b73dfe
diff --git a/tenacity/tests/test_asyncio.py b/tenacity/tests/test_asyncio.py index <HASH>..<HASH> 100644 --- a/tenacity/tests/test_asyncio.py +++ b/tenacity/tests/test_asyncio.py @@ -36,9 +36,8 @@ def asynctest(callable_): @retry -@asyncio.coroutine -def _retryable_coroutine(thing): - yield from asyncio.sleep(0.00001) +async def _retryable_coroutine(thing): + await asyncio.sleep(0.00001) return thing.go()
Test async keyword This is possible since tenacity dropped support for <I>.
jd_tenacity
train
py
e9d10ca2332f7909c505134d9c78d2e18b7fa4b1
diff --git a/lib/puppet/provider/package/gem.rb b/lib/puppet/provider/package/gem.rb index <HASH>..<HASH> 100755 --- a/lib/puppet/provider/package/gem.rb +++ b/lib/puppet/provider/package/gem.rb @@ -20,7 +20,9 @@ Puppet::Type.type(:package).provide :gem, :parent => Puppet::Provider::Package d else gem_list_command << "--remote" end - + if options[:source] + gem_list_command << "--source" << options[:source] + end if name = options[:justme] gem_list_command << name + "$" end @@ -104,7 +106,9 @@ Puppet::Type.type(:package).provide :gem, :parent => Puppet::Provider::Package d def latest # This always gets the latest version available. - hash = self.class.gemlist(:justme => resource[:name]) + gemlist_options = {:justme => resource[:name]} + gemlist_options.merge!({:source => resource[:source]}) unless resource[:source].nil? + hash = self.class.gemlist(gemlist_options) hash[:ensure][0] end
(#<I>) add --source to the gem list command Without this patch the `gem list` command in the gem package provider will search all package repositories. This is a problem because the end user is likely expecting Puppet to only search the specified repository instead of all repositories. This patch fixes the problem by passing the source parameter value onto the gem list command as the `--source` command line option. Commit message amended by Jeff McCune <<EMAIL>>
puppetlabs_puppet
train
rb
5139dfaca35bc5bfc2776704f554db3fb1441ecd
diff --git a/src/test/basic.test.js b/src/test/basic.test.js index <HASH>..<HASH> 100644 --- a/src/test/basic.test.js +++ b/src/test/basic.test.js @@ -34,6 +34,11 @@ describe('basic', () => { expect(() => styled.notExistTag``).toThrow() }) + it('should allow for inheriting components that are not styled', () => { + const componentConfig = { name: 'Parent', template: '<div><slot/></div>', methods: {} } + expect(() => styled(componentConfig, {})``).toNotThrow() + }) + // it('should generate an empty tag once rendered', () => { // const Comp = styled.div`` // const vm = new Vue(Comp).$mount() diff --git a/src/utils/isStyledComponent.js b/src/utils/isStyledComponent.js index <HASH>..<HASH> 100644 --- a/src/utils/isStyledComponent.js +++ b/src/utils/isStyledComponent.js @@ -1,5 +1,5 @@ export default function isStyledComponent (target) { return target && target.methods && - typeof target.methods.generateAndInjectStyles() === 'string' + typeof target.methods.generateAndInjectStyles === 'function' }
Fixed error when inheriting from components with methods
styled-components_vue-styled-components
train
js,js
3f9dc7cd540ece87dff2b9673ac162a6820a0498
diff --git a/lib/bugsnag/cleaner.rb b/lib/bugsnag/cleaner.rb index <HASH>..<HASH> 100644 --- a/lib/bugsnag/cleaner.rb +++ b/lib/bugsnag/cleaner.rb @@ -38,7 +38,7 @@ module Bugsnag end clean_hash when Array, Set - obj.map { |el| traverse_object(el, seen, scope) }.compact + obj.map { |el| traverse_object(el, seen, scope) } when Numeric, TrueClass, FalseClass obj when String diff --git a/spec/cleaner_spec.rb b/spec/cleaner_spec.rb index <HASH>..<HASH> 100644 --- a/spec/cleaner_spec.rb +++ b/spec/cleaner_spec.rb @@ -19,6 +19,11 @@ describe Bugsnag::Cleaner do expect(subject.clean_object(a)).to eq(["[RECURSION]", "hello"]) end + it "doesn't remove nil from arrays" do + a = ["b", nil, "c"] + expect(subject.clean_object(a)).to eq(["b", nil, "c"]) + end + it "allows multiple copies of the same string" do a = {:name => "bugsnag"} a[:second] = a[:name]
Prevent nil from being cleaned in arrays and sets (#<I>)
bugsnag_bugsnag-ruby
train
rb,rb
d625af297a9d2256cdaf5bce15b1e6c757c9d177
diff --git a/railties/lib/rails/generators/testing/assertions.rb b/railties/lib/rails/generators/testing/assertions.rb index <HASH>..<HASH> 100644 --- a/railties/lib/rails/generators/testing/assertions.rb +++ b/railties/lib/rails/generators/testing/assertions.rb @@ -1,3 +1,5 @@ +require 'shellwords' + module Rails module Generators module Testing
Require shellwords since it is dependecy of this file Closes #<I>
rails_rails
train
rb
1793295543111ec49fce76edf0c71ffff8c503ce
diff --git a/src/PatternLab/PatternEngine/Twig/PatternEngineRule.php b/src/PatternLab/PatternEngine/Twig/PatternEngineRule.php index <HASH>..<HASH> 100644 --- a/src/PatternLab/PatternEngine/Twig/PatternEngineRule.php +++ b/src/PatternLab/PatternEngine/Twig/PatternEngineRule.php @@ -33,7 +33,10 @@ class PatternEngineRule extends Rule { */ public function getPatternLoader($options = array()) { - $twigLoader = new PatternLoader(Config::$options["patternSourceDir"],array("patternPaths" => $options["patternPaths"])); + //default var + $patternSourceDir = Config::getOption("patternSourceDir"); + + $twigLoader = new PatternLoader($patternSourceDir,array("patternPaths" => $options["patternPaths"])); return new \Twig_Environment($twigLoader);
matching the get/set changes in core
pattern-lab_patternengine-php-twig
train
php
9c33cdc9fe37d5eb03e71d571768604d2bfe3b94
diff --git a/src/selectivity-dropdown.js b/src/selectivity-dropdown.js index <HASH>..<HASH> 100644 --- a/src/selectivity-dropdown.js +++ b/src/selectivity-dropdown.js @@ -584,7 +584,10 @@ $.extend(SelectivityDropdown.prototype, EventDelegator.prototype, { */ _showResults: function(results, options) { - this.showResults(this.selectivity.filterResults(results), options); + this.showResults( + this.selectivity.filterResults(results), + $.extend({ dropdown: this }, options) + ); }, /** diff --git a/src/selectivity-submenu.js b/src/selectivity-submenu.js index <HASH>..<HASH> 100644 --- a/src/selectivity-submenu.js +++ b/src/selectivity-submenu.js @@ -126,7 +126,7 @@ var callSuper = Selectivity.inherits(SelectivitySubmenu, SelectivityDropdown, { } } - if (this.submenu) { + if (this.submenu && options.dropdown !== this) { this.submenu.showResults(results, options); } else { results.forEach(setSelectable);
Fix race condition in pagination when submenus are open.
arendjr_selectivity
train
js,js
fc8f6735974ed972e525c8be9f2453046d14b13c
diff --git a/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/api/config/MasterSlaveRuleConfiguration.java b/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/api/config/MasterSlaveRuleConfiguration.java index <HASH>..<HASH> 100644 --- a/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/api/config/MasterSlaveRuleConfiguration.java +++ b/sharding-jdbc-core/src/main/java/io/shardingjdbc/core/api/config/MasterSlaveRuleConfiguration.java @@ -29,6 +29,7 @@ import lombok.Setter; import javax.sql.DataSource; import java.util.Collection; import java.util.HashMap; +import java.util.LinkedList; import java.util.Map; /** @@ -44,7 +45,7 @@ public class MasterSlaveRuleConfiguration { private String masterDataSourceName; - private Collection<String> slaveDataSourceNames; + private Collection<String> slaveDataSourceNames = new LinkedList<>(); private MasterSlaveLoadBalanceAlgorithmType loadBalanceAlgorithmType;
refactor MasterSlaveRuleConfiguration
apache_incubator-shardingsphere
train
java
998e23120d5aed9da9c7e9848bd2e32503f95adc
diff --git a/src/Service/Emailer.php b/src/Service/Emailer.php index <HASH>..<HASH> 100644 --- a/src/Service/Emailer.php +++ b/src/Service/Emailer.php @@ -610,13 +610,11 @@ class Emailer if (Environment::not(Environment::ENV_PROD)) { if (Config::get('EMAIL_OVERRIDE')) { $oEmail->to->email = Config::get('EMAIL_OVERRIDE'); - } elseif (Config::get('EMAIL_WHITELIST')) { + } elseif (!empty(Config::get('EMAIL_WHITELIST'))) { $aWhitelist = array_values( array_filter( - (array) json_decode( - Config::get('EMAIL_WHITELIST') - ) + (array) Config::get('EMAIL_WHITELIST') ) );
Fixes issue with already decoded config value
nails_module-email
train
php
01abb0af19b206cfce991e851b8b4f0a61ced433
diff --git a/src/main/java/com/xtremelabs/robolectric/shadows/ShadowIntent.java b/src/main/java/com/xtremelabs/robolectric/shadows/ShadowIntent.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/xtremelabs/robolectric/shadows/ShadowIntent.java +++ b/src/main/java/com/xtremelabs/robolectric/shadows/ShadowIntent.java @@ -171,16 +171,16 @@ public class ShadowIntent { } @Implementation - public boolean hasExtra(String name) { - return extras.containsKey(name); - } - - @Implementation public void putExtra(String key, byte[] value) { extras.put(key, value); } @Implementation + public boolean hasExtra(String name) { + return extras.containsKey(name); + } + + @Implementation public String getStringExtra(String name) { return (String) extras.get(name); } @@ -211,6 +211,11 @@ public class ShadowIntent { public Serializable getSerializableExtra(String name) { return (Serializable) extras.get(name); } + + @Implementation + public void removeExtra(String name) { + extras.remove(name); + } @Implementation public Intent setComponent(ComponentName componentName) {
added removeExtra to ShadowIntent
robolectric_robolectric
train
java
48aca05d4c25103a65fc32db20e654a945413110
diff --git a/tests/PasswordHasherTest.php b/tests/PasswordHasherTest.php index <HASH>..<HASH> 100644 --- a/tests/PasswordHasherTest.php +++ b/tests/PasswordHasherTest.php @@ -20,7 +20,7 @@ class PasswordHashTester extends PHPUnit_Framework_TestCase { $password = new Password($password); $hash = $hasher->make($password); - $this->assertTrue(password_verify($password, (string)$hash)); + $this->assertTrue(password_verify((string)$password, (string)$hash)); $hash = new PasswordHash(password_hash($password, $algo), $hasher); $this->assertTrue($hasher->check($password, $hash));
Another fix for hhvm
BapCat_Hashing
train
php
152bc6c9fc272b085d0ef0a8d7a6a3abdc6b697f
diff --git a/gobblin-utility/src/main/java/gobblin/util/JobLauncherUtils.java b/gobblin-utility/src/main/java/gobblin/util/JobLauncherUtils.java index <HASH>..<HASH> 100644 --- a/gobblin-utility/src/main/java/gobblin/util/JobLauncherUtils.java +++ b/gobblin-utility/src/main/java/gobblin/util/JobLauncherUtils.java @@ -212,7 +212,7 @@ public class JobLauncherUtils { private static ParallelRunner getParallelRunner(FileSystem fs, Closer closer, int parallelRunnerThreads, Map<String, ParallelRunner> parallelRunners) { - String uriAndHomeDir = fs.getUri().toString() + fs.getHomeDirectory(); + String uriAndHomeDir = new Path(new Path(fs.getUri()), fs.getHomeDirectory()).toString(); if (!parallelRunners.containsKey(uriAndHomeDir)) { parallelRunners.put(uriAndHomeDir, closer.register(new ParallelRunner(parallelRunnerThreads, fs))); }
Addressing comments on PR-<I>
apache_incubator-gobblin
train
java
afadfd5107c3f4c1132d8b4b958aa307085fcdbb
diff --git a/lib/markdown.js b/lib/markdown.js index <HASH>..<HASH> 100644 --- a/lib/markdown.js +++ b/lib/markdown.js @@ -33,6 +33,8 @@ Object.defineProperty(helpers, 'markdown', { markdown = val; }, get: function() { + // this is defined as a getter to avoid calling this function + // unless the helper is actually used return markdown || (markdown = require('helper-markdown')()); } }); @@ -52,13 +54,4 @@ Object.defineProperty(helpers, 'markdown', { * @api public */ -Object.defineProperty(helpers, 'md', { - configurable: true, - enumerable: true, - set: function(val) { - md = val; - }, - get: function() { - return md || (md = require('helper-md')); - } -}); +helpers.md = require('helper-md');
add comments also export the `md` helper directly
helpers_handlebars-helpers
train
js
d83f28beed4704edf65a99c470bd9112b8ac1684
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -8,8 +8,8 @@ import ( "sync" "time" - "code.google.com/p/go.net/ipv4" - "code.google.com/p/go.net/ipv6" + "github.com/hashicorp/go.net/ipv4" + "github.com/hashicorp/go.net/ipv6" "github.com/miekg/dns" )
Switch to fork of go.net
hashicorp_mdns
train
go
3997ba390671f621d83dea30e90808f01d295d35
diff --git a/src/main/com/siemens/ct/exi/datatype/NBitBigIntegerDatatype.java b/src/main/com/siemens/ct/exi/datatype/NBitBigIntegerDatatype.java index <HASH>..<HASH> 100644 --- a/src/main/com/siemens/ct/exi/datatype/NBitBigIntegerDatatype.java +++ b/src/main/com/siemens/ct/exi/datatype/NBitBigIntegerDatatype.java @@ -68,6 +68,14 @@ public class NBitBigIntegerDatatype extends AbstractDatatype { numberOfBits4Range = MethodsBag.getCodingLength(boundedRange); } + public int getNumberOfBits() { + return numberOfBits4Range; + } + + public BigInteger getLowerBound() { + return lowerBound; + } + protected static final HugeIntegerValue getHugeInteger(BigInteger bi) { if (bi.bitLength() <= 63) { // fits into long
consistency with other n-bit datatypes
EXIficient_exificient
train
java
fd542e64cb5ea013ba046c7a3d64b1a5e6a3cea3
diff --git a/ramda.js b/ramda.js index <HASH>..<HASH> 100644 --- a/ramda.js +++ b/ramda.js @@ -42,7 +42,7 @@ from = from || 0; to = to || args.length; - arr = new Array (from - to); + arr = new Array (to - from); i = from - 1; while (++i < to) {
Corrected length definition in _slice
ramda_ramda
train
js
b5c42759bd63068c845e26f1df2317aa08ea15c5
diff --git a/library/WT/Controller/Individual.php b/library/WT/Controller/Individual.php index <HASH>..<HASH> 100644 --- a/library/WT/Controller/Individual.php +++ b/library/WT/Controller/Individual.php @@ -748,7 +748,7 @@ class WT_Controller_Individual extends WT_Controller_GedcomRecord { $controller ->addInlineJavascript(' jQuery("#sidebarAccordion").accordion({ - active:"#family_nav", + active: 1, autoHeight: false, collapsible: true, icons:{ "header": "ui-icon-triangle-1-s", "headerSelected": "ui-icon-triangle-1-n" }
A change in the jquery api for accordion elements means that the "active" option can now only accept boolean or integer values, not selectors.
fisharebest_webtrees
train
php
ecf1d8557be224a850a25dc56dba8ccb9093ba74
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -110,8 +110,9 @@ let cssVarsObserver = null; * @param {function} [options.onComplete] Callback after all CSS has been * processed, legacy-compatible CSS has been generated, and * (optionally) the DOM has been updated. Passes 1) a CSS - * string with CSS variable values resolved, and 2) a - * reference to the appended <style> node. + * string with CSS variable values resolved, 2) a reference to + * the appended <style> node, and 3) an object containing all + * custom properies names and values. * * @example *
Added JSDoc comments for options.onComplete
jhildenbiddle_css-vars-ponyfill
train
js
e74e277f54a52316b880abf3bac4b41074b8bbec
diff --git a/eZ/Publish/API/Repository/Values/ObjectState/ObjectStateGroup.php b/eZ/Publish/API/Repository/Values/ObjectState/ObjectStateGroup.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/API/Repository/Values/ObjectState/ObjectStateGroup.php +++ b/eZ/Publish/API/Repository/Values/ObjectState/ObjectStateGroup.php @@ -40,7 +40,7 @@ abstract class ObjectStateGroup extends ValueObject * * @var string */ - public $defaultLanguageCode; + protected $defaultLanguageCode; /** * The available language codes for names an descriptions
Fixed: Only protected members in domain value objects.
ezsystems_ezpublish-kernel
train
php
f10552ea6b778664f8b9e92401ae09b1e1360017
diff --git a/lib/reporter.js b/lib/reporter.js index <HASH>..<HASH> 100644 --- a/lib/reporter.js +++ b/lib/reporter.js @@ -186,8 +186,12 @@ module.exports = class Reporter extends events.EventEmitter { } await this._fnAfterConfigLoaded(this) - this.options.tenant = this.options.tenant || {name: ''} + + if (this.options.tempDirectory && !path.isAbsolute(this.options.tempDirectory)) { + this.options.tempDirectory = path.join(this.options.rootDirectory, this.options.tempDirectory) + } this.options.tempDirectory = this.options.tempDirectory || path.join(os.tmpdir(), 'jsreport') + this.options.tempAutoCleanupDirectory = path.join(this.options.tempDirectory, 'autocleanup') this.options.tempCoreDirectory = path.join(this.options.tempDirectory, 'core') this.options.store = this.options.store || {provider: 'memory'}
support relative tempDirectory in config
jsreport_jsreport-core
train
js
4244851d7518b6f9f9200d729a1ce0932f21bf9d
diff --git a/content/template/listTemplate/template_A_listCourses.php b/content/template/listTemplate/template_A_listCourses.php index <HASH>..<HASH> 100644 --- a/content/template/listTemplate/template_A_listCourses.php +++ b/content/template/listTemplate/template_A_listCourses.php @@ -196,22 +196,21 @@ foreach($ede as $e) $occIds[] = $e->OccationID; } -$pricenames = get_transient('eduadmin-publicpricenames'); -//if(!$pricenames) +$pricenames = get_transient('eduadmin-publicobjectpricenames'); +if(!$pricenames) { $ft = new XFiltering(); $f = new XFilter('PublicPriceName', '=', 'true'); $ft->AddItem($f); $pricenames = $eduapi->GetObjectPriceName($edutoken,'',$ft->ToString()); - set_transient('eduadmin-publicpricenames', $pricenames, HOUR_IN_SECONDS); + set_transient('eduadmin-publicobjectpricenames', $pricenames, HOUR_IN_SECONDS); } if(!empty($pricenames)) { $ede = array_filter($ede, function($object) use (&$pricenames) { $pn = $pricenames; - print_r($pn); foreach($pn as $subj) { if($object->ObjectID == $subj->ObjectID)
1 file changed, 3 insertions(+), 4 deletions(-) On branch master Your branch is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) modified: content/template/listTemplate/template_A_listCourses.php
MultinetInteractive_EduAdmin-WordPress
train
php
7ef6e5c38d110a79fba335dd6a6970086aabf4c7
diff --git a/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java b/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java index <HASH>..<HASH> 100644 --- a/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java +++ b/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java @@ -3065,7 +3065,14 @@ public class Sql { handleError(connection, e); throw e; } finally { - if (connection != null) connection.setAutoCommit(savedAutoCommit); + if (connection != null) { + try { + connection.setAutoCommit(savedAutoCommit); + } + catch (SQLException e) { + LOG.finest("Caught exception resetting auto commit: " + e.getMessage() + " - continuing"); + } + } cacheConnection = false; closeResources(connection, null); cacheConnection = savedCacheConnection;
GROOVY-<I>: Sql.withTransaction setAutoCommit in finally not wrapped in try/catch
apache_groovy
train
java
59dcbb63611f96aa906d34e75a45daba196054b6
diff --git a/plugins/Diagnostics/Diagnostic/ReportInformational.php b/plugins/Diagnostics/Diagnostic/ReportInformational.php index <HASH>..<HASH> 100644 --- a/plugins/Diagnostics/Diagnostic/ReportInformational.php +++ b/plugins/Diagnostics/Diagnostic/ReportInformational.php @@ -64,6 +64,10 @@ class ReportInformational implements Diagnostic $row = null; } + if ($numDays === 1 && defined('PIWIK_TEST_MODE') && PIWIK_TEST_MODE) { + return '0'; // fails randomly in tests + } + if (!empty($row)) { return '1'; }
Fix randomly failing test diagnostic page UI test (#<I>) Depending of the time of the day it returns 0 or 1. There might be better ways to fix this but thought to keep it simple. Happy to change if needed. <URL>
matomo-org_matomo
train
php
22a7ccc81a8933f7ec581f4c01df9a35519d41e8
diff --git a/src/main/java/net/sundell/snax/SNAXParser.java b/src/main/java/net/sundell/snax/SNAXParser.java index <HASH>..<HASH> 100755 --- a/src/main/java/net/sundell/snax/SNAXParser.java +++ b/src/main/java/net/sundell/snax/SNAXParser.java @@ -132,7 +132,7 @@ public class SNAXParser<T> { done = false; } - private XMLEvent processEvent(XMLEvent event) throws XMLStreamException, SNAXUserException { + private XMLEvent processEvent(XMLEvent event) throws SNAXUserException { try { int type = event.getEventType(); currentLocation = event.getLocation(); @@ -200,6 +200,11 @@ public class SNAXParser<T> { e.setLocation(currentLocation); throw e; } + catch (Exception e) { + SNAXUserException se = new SNAXUserException(e); + se.setLocation(currentLocation); + throw se; + } } private void checkState(boolean test, String message) {
Issue 5: Wrap exceptions thrown within processEvent as SNAXUserException
tingley_snax-xml
train
java
a4444f73ffeaa6f0bad1169f2741fb8387045534
diff --git a/lib/hacks/gradient.js b/lib/hacks/gradient.js index <HASH>..<HASH> 100644 --- a/lib/hacks/gradient.js +++ b/lib/hacks/gradient.js @@ -125,6 +125,10 @@ class Gradient extends Value { if (params[0].value === 'to') { return params; } + /* reset the search index of the global regex object, otherwise the next use + * will start the search for a match at the index where the search ended this time. + */ + isDirection.lastIndex = 0; if (!isDirection.test(params[0].value)) { return params; }
Bugfix reuse of global RegEx object. (#<I>) When the same global regex object is used, you need to reset the lastIndex property.
postcss_autoprefixer
train
js
204bfc16ea84db3405e3215be2a11157ac6ad334
diff --git a/goatools/test_data/optional_attrs.py b/goatools/test_data/optional_attrs.py index <HASH>..<HASH> 100755 --- a/goatools/test_data/optional_attrs.py +++ b/goatools/test_data/optional_attrs.py @@ -182,7 +182,7 @@ class OptionalAttrs(object): # level namespace depth parents children _parents exp_flds = self.exp_req.union(self.exp_gen) for goobj in self.go2obj.values(): - assert not set(vars(goobj).keys()).difference(exp_flds) + assert set(vars(goobj).keys()).difference(exp_flds) == set(['alt_ids']) # print(vars(goobj).keys()) # print(" ".join(vars(goobj).keys()))
alt_ids expected in GOTerm
tanghaibao_goatools
train
py
5259f06336e61df0e72fb7bc537097c89cdf6f32
diff --git a/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java b/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java index <HASH>..<HASH> 100755 --- a/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java +++ b/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WTableRenderer.java @@ -149,7 +149,10 @@ final class WTableRenderer extends AbstractWebXmlRenderer { boolean multiple = table.getSelectMode() == SelectMode.MULTIPLE; xml.appendTagOpen("ui:rowSelection"); xml.appendOptionalAttribute("multiple", multiple, "true"); - xml.appendOptionalAttribute("toggle", table.getToggleSubRowSelection(), "true"); + + boolean toggleSubRows = multiple && table.getToggleSubRowSelection() && + WTable.ExpandMode.NONE != table.getExpandMode(); + xml.appendOptionalAttribute("toggle", toggleSubRows, "true"); if (multiple) { switch (table.getSelectAllMode()) { case CONTROL:
Enhanced renderer Added more constraints around when WTableRenderer outputs the toggle attribute on ui:rowSelection. Part of #<I>
BorderTech_wcomponents
train
java
8aa96c9791e5f916319372c93347e7aea817a25b
diff --git a/main/core/Library/Mailing/Validator.php b/main/core/Library/Mailing/Validator.php index <HASH>..<HASH> 100644 --- a/main/core/Library/Mailing/Validator.php +++ b/main/core/Library/Mailing/Validator.php @@ -24,6 +24,13 @@ class Validator const INVALID_ENCRYPTION = 'invalid_encryption'; const INVALID_AUTH_MODE = 'invalid_auth_mode'; + public function checkIsPositiveNumber($value) + { + if (!is_numeric($value) || (int) $value < 0) { + return static::NUMBER_EXPECTED; + } + } + public function checkIsNotBlank($value) { if (empty($value)) {
[CoreBundle] Add missing mail validation method. (#<I>) * [CoreBundle] Add missing mail validation method. * Update Validator.php
claroline_Distribution
train
php
3ec26a80899823a7092e995bd9a330324cfc630d
diff --git a/test/test-helper.js b/test/test-helper.js index <HASH>..<HASH> 100644 --- a/test/test-helper.js +++ b/test/test-helper.js @@ -1117,16 +1117,21 @@ helper.ccm.start = function (nodeLength, options) { helper.ccm.bootstrapNode = function (nodeIndex, callback) { const ipPrefix = helper.ipPrefix; helper.trace('bootstrapping node', nodeIndex); - helper.ccm.exec([ + const ccmArgs = [ 'add', 'node' + nodeIndex, '-i', ipPrefix + nodeIndex, '-j', (7000 + 100 * nodeIndex).toString(), - '-b', - '--dse' - ], callback); + '-b' + ]; + + if (helper.getServerInfo().isDse) { + ccmArgs.push('--dse'); + } + + helper.ccm.exec(ccmArgs, callback); }; helper.ccm.decommissionNode = function (nodeIndex, callback) {
Test: fix bootstrapping with C*
datastax_nodejs-driver
train
js
00791134cc87ecf9bbf21466d119ad01019e84f0
diff --git a/src/main/java/com/chalup/microorm/MicroOrm.java b/src/main/java/com/chalup/microorm/MicroOrm.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/chalup/microorm/MicroOrm.java +++ b/src/main/java/com/chalup/microorm/MicroOrm.java @@ -105,6 +105,18 @@ public class MicroOrm { return result; } + /** + * Returns an array containing column names needed by {@link MicroOrm} to + * successfully create an object of the specified type from {@link Cursor}. + * + * @param klass The {@link Class} of the object, for which the projection + * should be generated + * @return the {@link String[]} containing column names + */ + public <T> String[] getProjection(Class<T> klass) { + return null; + } + @SuppressWarnings("unchecked") private <T> DaoAdapter<T> getAdapter(Class<T> klass) { DaoAdapter<?> cached = mDaoAdapterCache.get(klass);
Added MicroOrm.getProjection() method to public API
chalup_microorm
train
java
12c065498a44d23632f418db84d933e7c4e1d813
diff --git a/app/models/concerns/genkan/auth.rb b/app/models/concerns/genkan/auth.rb index <HASH>..<HASH> 100644 --- a/app/models/concerns/genkan/auth.rb +++ b/app/models/concerns/genkan/auth.rb @@ -44,7 +44,7 @@ module Genkan end def banned? - self.banned_at.present? + banned_at.present? end def ban
Refactored Genkan::Auth
yhirano55_genkan
train
rb
4c84aea4caf322631ebb8642eaf7036223f3df9e
diff --git a/uPortal-security/uPortal-security-authn/src/main/java/org/apereo/portal/security/provider/SimpleSecurityContext.java b/uPortal-security/uPortal-security-authn/src/main/java/org/apereo/portal/security/provider/SimpleSecurityContext.java index <HASH>..<HASH> 100644 --- a/uPortal-security/uPortal-security-authn/src/main/java/org/apereo/portal/security/provider/SimpleSecurityContext.java +++ b/uPortal-security/uPortal-security-authn/src/main/java/org/apereo/portal/security/provider/SimpleSecurityContext.java @@ -54,10 +54,10 @@ public class SimpleSecurityContext extends ChainingSecurityContext implements IS if (this.myPrincipal.UID != null && this.myOpaqueCredentials.credentialstring != null) { // Logs if an attempt is made to log into a local account - StringBuilder msg = new StringBuilder(); - msg.append("An attempt to log into the local login has occurred. "); - msg.append("user=" + this.myPrincipal.UID); - if (log.isWarnEnabled()) log.warn(msg.toString()); + if (log.isWarnEnabled()) + log.warn( + "An attempt to log into the local login has occurred. user=" + + this.myPrincipal.UID); try {
Cleaned up code and moved message into if statement
Jasig_uPortal
train
java
f8c15c3d347b8f64bb39f0e2dab3e364ece8540a
diff --git a/src/xopen/__init__.py b/src/xopen/__init__.py index <HASH>..<HASH> 100644 --- a/src/xopen/__init__.py +++ b/src/xopen/__init__.py @@ -189,7 +189,7 @@ class PipedCompressionWriter(Closing): ) # TODO use a context manager - self.outfile = open(path, mode) + self.outfile = open(path, mode[0] + "b") self.closed: bool = False self.name: str = str(os.fspath(path)) self._mode: str = mode
Open output file for piping in binary mode This avoids an EncodingWarning that was previously raised when opening the file in text mode. For Popen, we only need something that has a fileno() method and encoding or whether the file was opened in text mode at all is ignored anyway. Encoding and text mode are taken care of separately when writing into the process.
marcelm_xopen
train
py
64f057f3dcf7ab3e5b3319475f75ad80480eae10
diff --git a/payment/src/main/java/org/killbill/billing/payment/core/janitor/CompletionTaskBase.java b/payment/src/main/java/org/killbill/billing/payment/core/janitor/CompletionTaskBase.java index <HASH>..<HASH> 100644 --- a/payment/src/main/java/org/killbill/billing/payment/core/janitor/CompletionTaskBase.java +++ b/payment/src/main/java/org/killbill/billing/payment/core/janitor/CompletionTaskBase.java @@ -81,7 +81,8 @@ abstract class CompletionTaskBase<T> implements Runnable { this.accountInternalApi = accountInternalApi; this.pluginControlledPaymentAutomatonRunner = pluginControlledPaymentAutomatonRunner; this.pluginRegistry = pluginRegistry; - this.taskName = this.getClass().getName(); + // Limit the length of the username in the context (limited to 50 characters) + this.taskName = this.getClass().getSimpleName(); this.completionTaskCallContext = internalCallContextFactory.createInternalCallContext((Long) null, (Long) null, taskName, CallOrigin.INTERNAL, UserType.SYSTEM, UUID.randomUUID()); }
payment: fix java.sql.SQLDataException in PendingTransactionTask This fixes: java.sql.SQLDataException: Data too long for column 'updated_by' at row 1 as updated_by was set to org.killbill.billing.payment.core.janitor.PendingTransactionTask, which is longer than the updated_by column.
killbill_killbill
train
java
4e69c4b969cd3a9602227d31603c80195e4899a2
diff --git a/microcosm/loaders.py b/microcosm/loaders.py index <HASH>..<HASH> 100644 --- a/microcosm/loaders.py +++ b/microcosm/loaders.py @@ -22,7 +22,7 @@ def expand_config(dct, skip_to=0, key_func=lambda key: key.lower(), key_parts_filter=lambda key_parts: True, - value_func=lambda value: value() if callable(value) else value): + value_func=lambda value: value): """ Expand a dictionary recursively by splitting keys along the separator. diff --git a/microcosm/tests/test_loaders.py b/microcosm/tests/test_loaders.py index <HASH>..<HASH> 100644 --- a/microcosm/tests/test_loaders.py +++ b/microcosm/tests/test_loaders.py @@ -65,6 +65,7 @@ def test_expand_config(): }, key_parts_filter=lambda key_parts: key_parts[0] == "prefix", skip_to=1, + value_func=lambda value: value() if callable(value) else value, ), is_(equal_to( {
Don't evaluate values as callable by default
globality-corp_microcosm
train
py,py
5fab63186c18690de4296c7dcf278000c4d6e463
diff --git a/salt/modules/publish.py b/salt/modules/publish.py index <HASH>..<HASH> 100644 --- a/salt/modules/publish.py +++ b/salt/modules/publish.py @@ -111,8 +111,6 @@ def _publish( return cret else: return ret - if (loop_interval * loop_counter) > timeout: - return {} loop_counter = loop_counter + 1 time.sleep(loop_interval) else:
Removing some redundant code. This was moved to be above the loop exit
saltstack_salt
train
py
311e4f8345c095887ab2589173713ac579eaaf6f
diff --git a/graylog2-server/src/main/java/org/graylog/plugins/views/search/export/es/SearchAfter.java b/graylog2-server/src/main/java/org/graylog/plugins/views/search/export/es/SearchAfter.java index <HASH>..<HASH> 100644 --- a/graylog2-server/src/main/java/org/graylog/plugins/views/search/export/es/SearchAfter.java +++ b/graylog2-server/src/main/java/org/graylog/plugins/views/search/export/es/SearchAfter.java @@ -33,7 +33,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import static jersey.repackaged.com.google.common.collect.Lists.newArrayList; +import static com.google.common.collect.Lists.newArrayList; import static org.graylog2.plugin.streams.Stream.DEFAULT_EVENT_STREAM_IDS; public class SearchAfter implements RequestStrategy {
Fixed import (#<I>)
Graylog2_graylog2-server
train
java
fe694737db5e5ca2d8b9b93ad03c73ceb275d2a4
diff --git a/openpnm/models/geometry/pore_volume.py b/openpnm/models/geometry/pore_volume.py index <HASH>..<HASH> 100644 --- a/openpnm/models/geometry/pore_volume.py +++ b/openpnm/models/geometry/pore_volume.py @@ -148,8 +148,9 @@ def effective(target, pore_volume='pore.volume', cn = network['throat.conns'] P1 = cn[:, 0] P2 = cn[:, 1] - eff_vol = np.copy(target[pore_volume]) - np.add.at(eff_vol, P1, 1/2*target[throat_volume]) - np.add.at(eff_vol, P2, 1/2*target[throat_volume]) - value = eff_vol + eff_vol = np.copy(network[pore_volume]) + np.add.at(eff_vol, P1, 1/2*network[throat_volume]) + np.add.at(eff_vol, P2, 1/2*network[throat_volume]) + pores = network.map_pores(throats=target.Ps, origin=target) + value = eff_vol[pores] return value
Corrected for case where target object spans sub domain
PMEAL_OpenPNM
train
py
73c7d2bb1ba315d2e7ebcf59f7efa3aa6fc03a4d
diff --git a/core/server/src/main/java/alluxio/worker/netty/BlockDataServerHandler.java b/core/server/src/main/java/alluxio/worker/netty/BlockDataServerHandler.java index <HASH>..<HASH> 100644 --- a/core/server/src/main/java/alluxio/worker/netty/BlockDataServerHandler.java +++ b/core/server/src/main/java/alluxio/worker/netty/BlockDataServerHandler.java @@ -82,8 +82,8 @@ final class BlockDataServerHandler { BlockReader reader = null; DataBuffer buffer; try { - reader = mWorker.readBlockRemote(sessionId, blockId, lockId); req.validate(); + reader = mWorker.readBlockRemote(sessionId, blockId, lockId); final long fileLength = reader.getLength(); validateBounds(req, fileLength); final long readLength = returnLength(offset, len, fileLength);
Validate request before reading a remote block
Alluxio_alluxio
train
java
d5279e2ee38d855eb16cd91c8a5449c82c8693cd
diff --git a/Eloquent/Concerns/QueriesRelationships.php b/Eloquent/Concerns/QueriesRelationships.php index <HASH>..<HASH> 100644 --- a/Eloquent/Concerns/QueriesRelationships.php +++ b/Eloquent/Concerns/QueriesRelationships.php @@ -414,7 +414,10 @@ trait QueriesRelationships preg_replace('/[^[:alnum:][:space:]_]/u', '', "$name $function $column") ); - $this->selectSub($query->limit(1), $alias); + $this->selectSub( + $function ? $query : $query->limit(1), + $alias + ); } return $this;
Fix withAggregate issue caused by limit 1 for aggregation functions (#<I>)
illuminate_database
train
php
b2259a6370d4fb1d6642b7a4a678b562121c0df4
diff --git a/salt/utils/__init__.py b/salt/utils/__init__.py index <HASH>..<HASH> 100644 --- a/salt/utils/__init__.py +++ b/salt/utils/__init__.py @@ -1029,17 +1029,18 @@ def fopen(*args, **kwargs): return flopen(*args, **kwargs) # ensure 'binary' mode is always used on windows - if is_windows(): - if len(args) > 1: - args = list(args) - if 'b' not in args[1]: - args[1] += 'b' - elif kwargs.get('mode', None): - if 'b' not in kwargs['mode']: - kwargs['mode'] += 'b' - else: - # the default is to read - kwargs['mode'] = 'rb' + if kwargs.pop('binary', True): + if is_windows(): + if len(args) > 1: + args = list(args) + if 'b' not in args[1]: + args[1] += 'b' + elif kwargs.get('mode', None): + if 'b' not in kwargs['mode']: + kwargs['mode'] += 'b' + else: + # the default is to read + kwargs['mode'] = 'rb' fhandle = open(*args, **kwargs) if is_fcntl_available():
allow override of binary file mode on windows Related to #<I>.
saltstack_salt
train
py
eedda74f9334a6296fd032889e599cfedb7eb105
diff --git a/src/Core/Checkout/Cart/SalesChannel/CartOrderRoute.php b/src/Core/Checkout/Cart/SalesChannel/CartOrderRoute.php index <HASH>..<HASH> 100644 --- a/src/Core/Checkout/Cart/SalesChannel/CartOrderRoute.php +++ b/src/Core/Checkout/Cart/SalesChannel/CartOrderRoute.php @@ -69,10 +69,13 @@ class CartOrderRoute extends AbstractCartOrderRoute * @OA\Post( * path="/checkout/order", * summary="Create an order from a cart", - * description="Creates a new order from the current cart and deletes the cart.", + * description="Creates a new order from the current cart and deletes the cart. + +If you are using the [prepared payment flow](https://developer.shopware.com/docs/concepts/commerce/checkout-concept/payments#2.1-prepare-payment-optional), this endpoint also receives additional transaction details. The exact name of the parameters depends on the implementation of the corresponding *payment handler*.", * operationId="createOrder", * tags={"Store API", "Order"}, * @OA\RequestBody( + * description="Contains additional metadata which is stored together with the order. It can also contain payment transaction details.", * @OA\JsonContent( * @OA\Property( * property="customerComment",
NEXT-<I> - Added reference to prepared payments in order endpoint description.
shopware_platform
train
php
0a6a491fc56fee107b509d5cc273354f7da29d03
diff --git a/dbkit.py b/dbkit.py index <HASH>..<HASH> 100644 --- a/dbkit.py +++ b/dbkit.py @@ -428,7 +428,10 @@ class ThreadAffinePool(PoolBase): # collector kicks in while the starved threads are waiting, this means # they'll have a chance to grab a connection. - __slots__ = ('_cond', '_starved', '_max_conns', '_allocated', '_connect') + __slots__ = ( + '_cond', '_starved', '_local', + '_max_conns', '_allocated', + '_connect') def __init__(self, module, max_conns, *args, **kwargs): try:
Add _local to the slots.
kgaughan_dbkit
train
py
9b77cecdd58e949575487582158ee0345f4811f2
diff --git a/lib/guard/interactors/readline.rb b/lib/guard/interactors/readline.rb index <HASH>..<HASH> 100644 --- a/lib/guard/interactors/readline.rb +++ b/lib/guard/interactors/readline.rb @@ -49,10 +49,10 @@ module Guard # def stop # Erase the current line for Ruby Readline - if Readline.respond_to?(:refresh_line) + if Readline.respond_to?(:refresh_line) && !defined(JRUBY_VERSION) Readline.refresh_line end - + # Erase the current line for Rb-Readline if defined?(RbReadline) && RbReadline.rl_outstream RbReadline._rl_erase_entire_line @@ -60,7 +60,7 @@ module Guard super end - + # Read a line from stdin with Readline. # def read_line
Skip Readline.refresh_line on JRUBY. (Closes #<I>)
guard_guard
train
rb
b744bd6eb21af445c621680c853a4d043d302b8b
diff --git a/examples/terran/mass_reaper.py b/examples/terran/mass_reaper.py index <HASH>..<HASH> 100644 --- a/examples/terran/mass_reaper.py +++ b/examples/terran/mass_reaper.py @@ -113,7 +113,7 @@ class MassReaperBot(sc2.BotAI): continue # continue for loop, dont execute any of the following # attack is on cooldown, check if grenade is on cooldown, if not then throw it to furthest enemy in range 5 - reaperGrenadeRange = self._game_data.abilities[Abi lityId.D8CHARGE_KD8CHARGE.value]._proto.cast_range + reaperGrenadeRange = self._game_data.abilities[AbilityId.D8CHARGE_KD8CHARGE.value]._proto.cast_range enemyGroundUnitsInGrenadeRange = self.known_enemy_units.not_structure.not_flying.exclude_type([LARVA, EGG]).closer_than(reaperGrenadeRange, r) if enemyGroundUnitsInGrenadeRange.exists and (r.is_attacking or r.is_moving): # if AbilityId.KD8CHARGE_KD8CHARGE in abilities, we check that to see if the reaper grenade is off cooldown
Fix typo in "AbilityId" name
Dentosal_python-sc2
train
py
3d598a91dba9c075bc57a53e30c927fc9bb7dbbb
diff --git a/src/lib/KevinGH/Box/Command/Info.php b/src/lib/KevinGH/Box/Command/Info.php index <HASH>..<HASH> 100644 --- a/src/lib/KevinGH/Box/Command/Info.php +++ b/src/lib/KevinGH/Box/Command/Info.php @@ -146,27 +146,24 @@ HELP $indent, $base ) { + /** @var SplFileInfo[] $list */ foreach ($list as $item) { - /** @var $item SplFileInfo */ - if (false !== $indent) { $output->write(str_repeat(' ', $indent)); + $path = $item->getFilename(); + if ($item->isDir()) { - $output->writeln( - '<info>' . $item->getFilename() . '/</info>' - ); - } else { - $output->writeln($item->getFilename()); + $path .= '/'; } } else { $path = str_replace($base, '', $item->getPathname()); + } - if ($item->isDir()) { - $output->writeln("<info>$path</info>"); - } else { - $output->writeln($path); - } + if ($item->isDir()) { + $output->writeln("<info>$path</info>"); + } else { + $output->writeln($path); } if ($item->isDir()) {
Consolidating render for future compression information addition.
box-project_box2
train
php
a3a83aeac1a8ef8b1074aae44cedd5ea7134a990
diff --git a/tests/mapping.js b/tests/mapping.js index <HASH>..<HASH> 100644 --- a/tests/mapping.js +++ b/tests/mapping.js @@ -16,6 +16,7 @@ var objectFns = [ "updateAccount", "updateCampaign", "addCertificate", + "addDeveloperCertificate", "updateCertificate", "listDeviceLogs", "listMetrics", @@ -88,7 +89,8 @@ exports.mapArgs = (module, method, query) => { // Transform query to json string query = query .replace(/&/g, '","') - .replace(/=/g, '":"'); + .replace(/=/g, '":"') + .replace(/\+/g, ' '); query = `{"${decodeURIComponent(query)}"}`; @@ -97,7 +99,7 @@ exports.mapArgs = (module, method, query) => { .replace(/"\[/g, '[') .replace(/\}"/g, '}') .replace(/"\{/g, '{') - .replace(/\+/g, ' '); + .replace(/\n/g, '\\n'); // Use a reviver to camel-case the JSON args = JSON.parse(query, function(key, value) { @@ -106,6 +108,7 @@ exports.mapArgs = (module, method, query) => { if (snakey === key) return value; this[snakey] = value; }); + } catch(e) { console.log(e); return [];
Test fixe (#<I>) * Fixed newlines in data being passed to tests * Added addDeveloperCertificate object mapping
ARMmbed_mbed-cloud-sdk-javascript
train
js
b39e765475b9dc3ba53a21a4acf91c97a18e1dbd
diff --git a/tests/FileManipulation/UndefinedVariableManipulationTest.php b/tests/FileManipulation/UndefinedVariableManipulationTest.php index <HASH>..<HASH> 100644 --- a/tests/FileManipulation/UndefinedVariableManipulationTest.php +++ b/tests/FileManipulation/UndefinedVariableManipulationTest.php @@ -1,8 +1,6 @@ <?php namespace Psalm\Tests\FileManipulation; -use const PHP_VERSION; - class UndefinedVariableManipulationTest extends FileManipulationTestCase { /** @@ -136,7 +134,7 @@ class UndefinedVariableManipulationTest extends FileManipulationTestCase new D(); }', - PHP_VERSION, + '7.4', [], true, ],
Prevent failures with dev PHP versions It was failing with dev versions, e.g. `<I>-dev`
vimeo_psalm
train
php
a425f712c53e9b91fe9d8377650f8751c9de33d8
diff --git a/lib/subdomain_locale/controller.rb b/lib/subdomain_locale/controller.rb index <HASH>..<HASH> 100644 --- a/lib/subdomain_locale/controller.rb +++ b/lib/subdomain_locale/controller.rb @@ -1,13 +1,14 @@ module SubdomainLocale module Controller def self.included(base) - base.before_filter :set_locale + base.around_filter :set_locale end private def set_locale - I18n.locale = SubdomainLocale.mapping.locale_for(request.subdomain) + locale = SubdomainLocale.mapping.locale_for(request.subdomain) + I18n.with_locale(locale) { yield } end end end diff --git a/test/rails_test.rb b/test/rails_test.rb index <HASH>..<HASH> 100644 --- a/test/rails_test.rb +++ b/test/rails_test.rb @@ -39,6 +39,12 @@ class HelloControllerTest < ActionController::TestCase assert_select "p", "Привіт" end + def test_locale_after_action + @request.host = "ru.example.com" + get :world + assert_equal :en, I18n.locale + end + def test_other @request.host = "wtf.example.com" assert_raise(I18n::InvalidLocale) do
Controller action should revert global locale afterwards.
semaperepelitsa_subdomain_locale
train
rb,rb
f5aad2a7de014b1520dbeda9c3023988b1be3301
diff --git a/src/wa_kat/zeo/request_info.py b/src/wa_kat/zeo/request_info.py index <HASH>..<HASH> 100755 --- a/src/wa_kat/zeo/request_info.py +++ b/src/wa_kat/zeo/request_info.py @@ -106,6 +106,16 @@ def _get_req_mapping(): ) +class Progress(namedtuple("Progress", ["done", "base"])): + """ + Progress bar representation. + + Attr: + done (int): How much is done. + base (int): How much is there. + """ + + @total_ordering class RequestInfo(Persistent): """ @@ -211,9 +221,12 @@ class RequestInfo(Persistent): Get progress. Returns: - tuple: (int(done), int(how_many)) + namedtuple: :class:`Progress`. """ - return len(self._get_all_set_properties()), len(_get_req_mapping()) + return Progress( + done=len(self._get_all_set_properties()), + base=len(_get_req_mapping()), + ) def is_all_set(self): """
#<I>: Added more human-readable progress tracking.
WebarchivCZ_WA-KAT
train
py
2314e65ba7aadff4e702c4cf045121c102e25fb6
diff --git a/core/src/main/java/net/kuujo/copycat/internal/PassiveState.java b/core/src/main/java/net/kuujo/copycat/internal/PassiveState.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/net/kuujo/copycat/internal/PassiveState.java +++ b/core/src/main/java/net/kuujo/copycat/internal/PassiveState.java @@ -110,13 +110,15 @@ public class PassiveState extends AbstractState { // Get a list of entries up to 1MB in size. List<ByteBuffer> entries = new ArrayList<>(1024); - long index = member.getIndex(); - int size = 0; - while (size < 1024 * 1024 && index < context.getCommitIndex()) { - ByteBuffer entry = context.log().getEntry(index); - size += entry.limit(); - entries.add(entry); - index++; + if (!context.log().isEmpty()) { + long index = Math.max(member.getIndex(), context.log().lastIndex()); + int size = 0; + while (size < 1024 * 1024 && index < context.getCommitIndex()) { + ByteBuffer entry = context.log().getEntry(index); + size += entry.limit(); + entries.add(entry); + index++; + } } syncHandler.handle(SyncRequest.builder()
Handle missing entries due to log compaction in gossip-based replication.
atomix_atomix
train
java
9d585f2853e6a0566ee04ce577975523b1a533fb
diff --git a/opal/browser/dom/event.rb b/opal/browser/dom/event.rb index <HASH>..<HASH> 100644 --- a/opal/browser/dom/event.rb +++ b/opal/browser/dom/event.rb @@ -40,6 +40,8 @@ class Event < Native def stopped?; !!@stopped; end def stop! + `#@native.stopPropagation()` if `#@native.stopPropagation` + @stopped = true end end
dom/event: call stopPropagation
opal_opal-browser
train
rb
b750b351cccd60a4e396e36dbbfaf680c8076b2a
diff --git a/drizzlepac/haputils/catalog_utils.py b/drizzlepac/haputils/catalog_utils.py index <HASH>..<HASH> 100755 --- a/drizzlepac/haputils/catalog_utils.py +++ b/drizzlepac/haputils/catalog_utils.py @@ -935,6 +935,10 @@ class HAPPointCatalog(HAPCatalogBase): # Perform manual detection of sources using theoretical PSFs # Initial test data: ictj65 try: + # Subtract the detection threshold image so that detection is anything > 0 + region -= (reg_rms * self.param_dict['nsigma']) + # insure no negative values for deconvolution + region = np.clip(region, 0., region.max()) user_peaks, source_fwhm = decutils.find_point_sources(self.image.imgname, data=region, def_fwhm=source_fwhm,
Adjust threshold for point-catalog generation (#<I>) * Adjust threshold for PSF source finding * Remove errant neg sign
spacetelescope_drizzlepac
train
py