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
8182bd66de930a9d4c5000d253a9de40364655b3
diff --git a/test/host/HostHttpServer.test.js b/test/host/HostHttpServer.test.js index <HASH>..<HASH> 100644 --- a/test/host/HostHttpServer.test.js +++ b/test/host/HostHttpServer.test.js @@ -71,7 +71,8 @@ test('HostHttpServer.handle authorized', function (t) { // Function for creating a JWT let jwt = function () { return jsonwebtoken.sign({}, s.key, { - jwtid: crypto.randomBytes(64).toString('base64'), + algorithm: 'HS256', + jwtid: crypto.randomBytes(8).toString('base64'), expiresIn: 3600 }) }
Reduce length of jwi to reduced size of token; force HS<I>
stencila_node
train
js
1704d44482f22ad5660f4753f93dcf5c0d58ac14
diff --git a/hererocks.py b/hererocks.py index <HASH>..<HASH> 100755 --- a/hererocks.py +++ b/hererocks.py @@ -527,11 +527,11 @@ class Program(object): archive_name = os.path.join(opts.downloads, self.get_file_name()) if opts.downloads and os.path.exists(archive_name): - print("Fetching {} (cached)".format(self.title)) + print("Fetching {}{} (cached)".format(self.title, self.version_suffix)) else: for base_url in self.downloads: url = self.get_download_url(base_url) - print("Fetching {} from {}".format(self.title, url)) + print("Fetching {}{} from {}".format(self.title, self.version_suffix, url)) try: download(url, archive_name)
Show version suffix in fetching stage Used version is not always obvious when version is specified as `latest`, show it as early as possible.
mpeterv_hererocks
train
py
6f62deabbddb40a4713836dd88261829f33b4d85
diff --git a/PBB_Core.py b/PBB_Core.py index <HASH>..<HASH> 100755 --- a/PBB_Core.py +++ b/PBB_Core.py @@ -39,6 +39,7 @@ class WDItemEngine(object): wd_item_id = '' item_names = '' + domain = '' autoadd_references = False normalize = True @@ -54,6 +55,7 @@ class WDItemEngine(object): """ self.wd_item_id = wd_item_id self.item_names = item_name + self.domain = domain self.autoadd_references = False self.normalize = normalize @@ -95,7 +97,16 @@ class WDItemEngine(object): print(e) def get_property_list(self): + """ + extract the properties which belong to the domain of the WD item + :return: a list of property strings is being returned + """ + property_list = [] for x in wd_property_store.wd_properties: + if self.domain in x['domain']: + property_list.append(x.key) + + return(property_list) def getItemsByProperty(self, wdproperty):
added property loading from wd_property_store
SuLab_WikidataIntegrator
train
py
d8add63f303e994a03a188e3c33ded74eb4fa5da
diff --git a/lan.go b/lan.go index <HASH>..<HASH> 100644 --- a/lan.go +++ b/lan.go @@ -23,7 +23,7 @@ type LanProperties struct { Name string `json:"name,omitempty"` Public bool `json:"public,omitempty"` IPFailover *[]IPFailover `json:"ipFailover,omitempty"` - PCC string `json:"pcc,omitmepty"` + PCC string `json:"pcc,omitempty"` } // LanEntities object
Updates: LAN pcc property
profitbricks_profitbricks-sdk-go
train
go
93035aace30cd947f6c910b822ddc62d2ade3f6a
diff --git a/src/Store/Store.php b/src/Store/Store.php index <HASH>..<HASH> 100644 --- a/src/Store/Store.php +++ b/src/Store/Store.php @@ -392,7 +392,7 @@ class Store $identifiers = $collection->getIdentifiers(); if (empty($identifiers)) { // Nothing to query. - return $collection; + return []; } if ($collection instanceof InverseCollection) { $records = $this->retrieveInverseRecords($collection->getOwner()->getType(), $collection->getType(), $collection->getIdentifiers(), $collection->getQueryField());
Fix bug loadCollection was not returning array The `loadCollection` method must return an array of Models. If the collection was empty, the code was previously returning the passed collection, and not returning an array.
as3io_modlr
train
php
2140db92a3fd83dd89a53f15ef36173a847e701a
diff --git a/classes/ezjscserverfunctionsnode.php b/classes/ezjscserverfunctionsnode.php index <HASH>..<HASH> 100644 --- a/classes/ezjscserverfunctionsnode.php +++ b/classes/ezjscserverfunctionsnode.php @@ -51,6 +51,7 @@ class ezjscServerFunctionsNode extends ezjscServerFunctions $offset = isset( $args[2] ) ? $args[2] : 0; $sort = isset( $args[3] ) ? self::sortMap( $args[3] ) : 'published'; $order = isset( $args[4] ) ? $args[4] : false; + $objectNameFilter = isset( $args[5] ) ? $args[5] : ''; if ( !$parentNodeID ) { @@ -68,6 +69,7 @@ class ezjscServerFunctionsNode extends ezjscServerFunctions 'Offset' => $offset, 'SortBy' => array( array( $sort, $order ) ), 'DepthOperator' => 'eq', + 'ObjectNameFilter' => $objectNameFilter, 'AsObject' => true ); // fetch nodes and total node count
Fixed #<I>: AlphabeticalFilter is not working in admin2
ezsystems_ezpublish-legacy
train
php
f4dd4c3f2cc4df85502529fa6ffb006bac00829e
diff --git a/producer/kafka.go b/producer/kafka.go index <HASH>..<HASH> 100644 --- a/producer/kafka.go +++ b/producer/kafka.go @@ -325,7 +325,7 @@ func (prod *Kafka) pollResults() { for _, topic := range prod.topic { sent := atomic.SwapInt64(&topic.sent, 0) duration := time.Since(prod.lastMetricUpdate) - sentPerSec := float64(sent)/duration.Seconds() + 0.5 + sentPerSec := float64(sent) / duration.Seconds() rttSum := atomic.SwapInt64(&topic.rttSum, 0) delivered := atomic.SwapInt64(&topic.delivered, 0)
[fix] Rounding error in producer.Kafka perSecond metrics
trivago_gollum
train
go
2cc70dd914c4106474c10197f2cde25aab53b775
diff --git a/lib/dm-core/adapters/postgres_adapter.rb b/lib/dm-core/adapters/postgres_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/dm-core/adapters/postgres_adapter.rb +++ b/lib/dm-core/adapters/postgres_adapter.rb @@ -80,15 +80,6 @@ module DataMapper end # TODO: move to dm-more/dm-migrations - def property_schema_statement(schema) - if schema[:serial?] - "#{quote_column_name(schema[:name])} SERIAL" - else - super - end - end - - # TODO: move to dm-more/dm-migrations def property_schema_hash(repository, property) schema = super @@ -102,6 +93,10 @@ module DataMapper schema.delete(:scale) end + if schema[:serial?] + schema[:primitive] = 'SERIAL' + end + schema end end # module SQL
Further simplify SERIAL column creation for PostgreSQL * Allows other column properties like NOT NULL to be added when applicable
datamapper_dm-core
train
rb
f8defce82820d5cfe7ee6c75a455a25247f4fbc2
diff --git a/app/actions.go b/app/actions.go index <HASH>..<HASH> 100644 --- a/app/actions.go +++ b/app/actions.go @@ -507,3 +507,14 @@ var ProvisionerDeploy = action.Action{ }, MinParams: 3, } + +// Increment is an actions that increments the deploy number. +var IncrementDeploy = action.Action{ + Name: "increment-deploy", + Forward: func(ctx action.FWContext) (action.Result, error) { + return nil, nil + }, + Backward: func(ctx action.BWContext) { + }, + MinParams: 3, +} diff --git a/app/actions_test.go b/app/actions_test.go index <HASH>..<HASH> 100644 --- a/app/actions_test.go +++ b/app/actions_test.go @@ -1173,3 +1173,7 @@ func (s *S) TestProvisionerDeployParams(c *gocheck.C) { _, err = ProvisionerDeploy.Forward(ctx) c.Assert(err.Error(), gocheck.Equals, "First parameter must be a *App.") } + +func (s *S) TestIncrementDeployName(c *gocheck.C) { + c.Assert(IncrementDeploy.Name, gocheck.Equals, "increment-deploy") +}
app: added increment deploy action. related to #<I>.
tsuru_tsuru
train
go,go
d43c02a2f903d8b5387ccca651c1cf327fc08d92
diff --git a/Classes/Lightwerk/SurfRunner/Package.php b/Classes/Lightwerk/SurfRunner/Package.php index <HASH>..<HASH> 100644 --- a/Classes/Lightwerk/SurfRunner/Package.php +++ b/Classes/Lightwerk/SurfRunner/Package.php @@ -26,15 +26,13 @@ class Package extends BasePackage { public function boot(Bootstrap $bootstrap) { $dispatcher = $bootstrap->getSignalSlotDispatcher(); - if (!$bootstrap->getContext()->isProduction()) { - $dispatcher->connect( - 'Lightwerk\SurfRunner\Service\DeploymentService', 'deploymentStarted', - 'Lightwerk\SurfRunner\Notification\HitChatNotifier', 'deploymentStarted' - ); - $dispatcher->connect( - 'Lightwerk\SurfRunner\Service\DeploymentService', 'deploymentFinished', - 'Lightwerk\SurfRunner\Notification\HitChatNotifier', 'deploymentFinished' - ); - } + $dispatcher->connect( + 'Lightwerk\SurfRunner\Service\DeploymentService', 'deploymentStarted', + 'Lightwerk\SurfRunner\Notification\HitChatNotifier', 'deploymentStarted' + ); + $dispatcher->connect( + 'Lightwerk\SurfRunner\Service\DeploymentService', 'deploymentFinished', + 'Lightwerk\SurfRunner\Notification\HitChatNotifier', 'deploymentFinished' + ); } }
[TASK] Enables notifications in production context
lightwerk_SurfRunner
train
php
4d9662e8d3fbb558b5f0fb380c11b1e00d577b3b
diff --git a/jradius-authenticator/src/main/java/org/jasig/cas/adaptors/radius/RadiusProtocol.java b/jradius-authenticator/src/main/java/org/jasig/cas/adaptors/radius/RadiusProtocol.java index <HASH>..<HASH> 100644 --- a/jradius-authenticator/src/main/java/org/jasig/cas/adaptors/radius/RadiusProtocol.java +++ b/jradius-authenticator/src/main/java/org/jasig/cas/adaptors/radius/RadiusProtocol.java @@ -30,7 +30,7 @@ public enum RadiusProtocol { EAP_MSCHAPv2("eap-mschapv2"), EAP_TLS("eap-tls"), EAP_TTLS_PAP("eap-ttls:innerProtocol=pap"), - EAP_TTLS_MD5("eap-ttls:innerProtocol=eap-md5"), + EAP_TTLS_EAP_MD5("eap-ttls:innerProtocol=eap-md5"), EAP_TTLS_EAP_MSCHAPv2("eap-ttls:innerProtocol=eap-mschapv2"), MSCHAPv1("mschapv1"), MSCHAPv2("mschapv2"),
Back-merged updated RadiusProtocol from CAS <I>.
spaetow_cas-abfab-support
train
java
238dfed9e7c806fdfade238e2dd4eab655c17137
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -101,12 +101,12 @@ class AgentSDK extends EventEmitter { // todo monitor the socket, return this.sp.send(userProfileReq.getType(), userProfileReq.getRequest()); } - compose(convid) { + compose(convId) { let composeEventReq = new ComposeEvent({convId: convId}); return this.sp.send(composeEventReq.getType(), composeEventReq.getRequest()); } - active(convid) { + active(convId) { let activeEventReq = new ActiveEvent({convId: convId}); return this.sp.send(activeEventReq.getType(), activeEventReq.getRequest()); }
support compose and active chat states via the api
yarivr_lp-labs-agent-sdk
train
js
5d672986a9d4b1c69070e301d7951805d2593cad
diff --git a/src/Elements/Html.php b/src/Elements/Html.php index <HASH>..<HASH> 100644 --- a/src/Elements/Html.php +++ b/src/Elements/Html.php @@ -37,8 +37,17 @@ class Html extends Element public function display() { return sprintf( - '<tr><td></td><td colspan="2">%s</td></tr>', - $this->content + '<tr %s><td><div title="%s">%s</div></td><td>%s</td></tr>', + $this->renderFieldAttributes(), + $this->getAttribute('name'), + $this->label, + $this->displayValue() ); } + + + public function displayValue() + { + return $this->content; + } }
fix(HTML): apply field attributes
laravolt_semantic-form
train
php
a5a3700a76687f915b9743821ef0354f798e63a6
diff --git a/app/models/fluentd/agent/common.rb b/app/models/fluentd/agent/common.rb index <HASH>..<HASH> 100644 --- a/app/models/fluentd/agent/common.rb +++ b/app/models/fluentd/agent/common.rb @@ -20,7 +20,7 @@ class Fluentd attr_reader :extra_options def self.included(base) - base.include Fluentd::Agent::ProcessOperation + base.send(:include, Fluentd::Agent::ProcessOperation) end # define these methods on each Agent class
Use #send for private method on <I>
fluent_fluentd-ui
train
rb
31a1b0d1067369d05d73e0d8945e73c14dfa3c6c
diff --git a/platform/android/device.js b/platform/android/device.js index <HASH>..<HASH> 100644 --- a/platform/android/device.js +++ b/platform/android/device.js @@ -3,6 +3,7 @@ var Device = function(ui) { ui.deviceId = device.uuid ui.modelName = device.model ui.firmware = device.version + ui.runtime = 'cordova' } ui._context.document.on('deviceready', onDeviceReady);
set runtime field to 'cordova' for cordova
pureqml_qmlcore
train
js
ba2bff4d6530a771d72a8a9421e7fe94615c1679
diff --git a/check_manifest.py b/check_manifest.py index <HASH>..<HASH> 100755 --- a/check_manifest.py +++ b/check_manifest.py @@ -433,7 +433,7 @@ def check_manifest(source_tree='.', create=False, update=False): info_begin("building an sdist") with cd(tempsourcedir): with mkdtemp('-sdist') as tempdir: - run(['python', 'setup.py', 'sdist', '-d', tempdir]) + run([sys.executable, 'setup.py', 'sdist', '-d', tempdir]) sdist_filename = get_one_file_in(tempdir) info_continue(": %s" % os.path.basename(sdist_filename)) sdist_files = sorted(strip_sdist_extras(strip_toplevel_name(
Use the same Python interpreter to run setup.py Fixes #<I>, hopefully.
mgedmin_check-manifest
train
py
48e5df87a3195f9fcb85ee42e6dff157779c4544
diff --git a/src/Symfony/Component/Cache/Traits/RedisTrait.php b/src/Symfony/Component/Cache/Traits/RedisTrait.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Cache/Traits/RedisTrait.php +++ b/src/Symfony/Component/Cache/Traits/RedisTrait.php @@ -156,7 +156,7 @@ trait RedisTrait $initializer = function ($redis) use ($connect, $params, $dsn, $auth, $hosts) { try { - @$redis->{$connect}($hosts[0]['host'], $hosts[0]['port'], $params['timeout'], (string) $params['persistent_id'], $params['retry_interval']); + @$redis->{$connect}($hosts[0]['host'] ?? $hosts[0]['path'], $hosts[0]['port'] ?? null, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval']); } catch (\RedisException $e) { throw new InvalidArgumentException(sprintf('Redis connection failed (%s): %s', $e->getMessage(), $dsn)); }
[Cache] fix connecting using socket with phpredis
symfony_symfony
train
php
fe28e60785a1021fd7d322594120f50f2edeb3dd
diff --git a/doc2dash/parsers/sphinx/parser.py b/doc2dash/parsers/sphinx/parser.py index <HASH>..<HASH> 100644 --- a/doc2dash/parsers/sphinx/parser.py +++ b/doc2dash/parsers/sphinx/parser.py @@ -91,8 +91,8 @@ def _get_type(text): _IN_MODULE = '_in_module' TYPE_MAPPING = [ - (re.compile(r'(.*)\(\S+ method\)$'), types.METHOD), - (re.compile(r'(.*)\(.*function\)$'), types.FUNCTION), + (re.compile(r'([^ (]*)(?:\(\))? ?\(\S+ method\)$'), types.METHOD), + (re.compile(r'([^ (]*)(?:\(\))? ?\(.*function\)$'), types.FUNCTION), (re.compile(r'(.*)\(\S+ attribute\)$'), types.ATTRIBUTE), (re.compile(r'(.*)\(\S+ member\)$'), types.ATTRIBUTE), (re.compile(r'(.*)\(class in \S+\)$'), types.CLASS),
Don't collect () as part of func and method names Complying with dash's default style.
hynek_doc2dash
train
py
5fdb0908c4bf7b8f471a4b6f6f0be87d303a0d09
diff --git a/salt/crypt.py b/salt/crypt.py index <HASH>..<HASH> 100644 --- a/salt/crypt.py +++ b/salt/crypt.py @@ -11,6 +11,7 @@ import hmac import tempfile import random import hashlib +import time import string import cPickle as pickle # Import Cryptography libs
Add time to imports on crypt
saltstack_salt
train
py
45b122fd04055c01fe2abe885942002a40f18c30
diff --git a/stacker/actions/build.py b/stacker/actions/build.py index <HASH>..<HASH> 100644 --- a/stacker/actions/build.py +++ b/stacker/actions/build.py @@ -83,7 +83,6 @@ def should_ensure_cfn_bucket(outline, dump): bool: If access to CF bucket is needed, return True. """ - print "OUTLINE: %s, DUMP: %s" % (outline, dump) return not outline and not dump
Remove leftover print debug statement (#<I>)
cloudtools_stacker
train
py
62f132126048dd4fecddc018f45635256965cebf
diff --git a/lib/dirty_associations.rb b/lib/dirty_associations.rb index <HASH>..<HASH> 100644 --- a/lib/dirty_associations.rb +++ b/lib/dirty_associations.rb @@ -9,22 +9,23 @@ module DirtyAssociations module ClassMethods ## - # Creates methods that allows an association named +field+ to be monitored. + # Creates methods that allows an +association+ to be monitored. # - # The +field+ parameter should be a string or symbol representing the name of an association. - def monitor_association_changes(field) - [field, "#{field.to_s.singularize}_ids"].each do |name| + # The +association+ parameter should be a string or symbol representing the name of an association. + def monitor_association_changes(association) + ids = "#{association.to_s.singularize}_ids" + [association, ids].each do |name| define_method "#{name}=" do |value| - attribute_will_change!(field) # TODO: should probably use the singluar_field_ids name to match how belongs_to relations are handled and because it makes more sense given what's being tracked + attribute_will_change!(ids) super(value) end define_method "#{name}_changed?" do - changed.include?(field) + changed.include?(ids) end define_method "#{name}_previously_changed?" do - previous_changes.keys.include?(field.to_s) + previous_changes.keys.include?(ids) end end end
Register changes to association_ids attribute instead of the association name.
jmpage_dirty_associations
train
rb
d8ab2c406372f3db0a201f1972ba20a5ef95b469
diff --git a/spec/schema.rb b/spec/schema.rb index <HASH>..<HASH> 100644 --- a/spec/schema.rb +++ b/spec/schema.rb @@ -1,6 +1,6 @@ ActiveRecord::Schema.define(:version => 0) do - %w{gates readers writers transients simples thieves}.each do |table_name| + %w{gates readers writers transients simples thieves i18n_test_models}.each do |table_name| create_table table_name, :force => true end 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,10 +5,6 @@ require 'aasm' require 'rspec' require 'rspec/autorun' -RSpec.configure do |config| - -end - def load_schema config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml')) ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log")
fixed tests after I<I>n integration
aasm_aasm
train
rb,rb
fa21b082467d025e73f1da07406672d00dafb8d4
diff --git a/datatableview/helpers.py b/datatableview/helpers.py index <HASH>..<HASH> 100644 --- a/datatableview/helpers.py +++ b/datatableview/helpers.py @@ -62,7 +62,7 @@ def link_to_model(instance, text=None, *args, **kwargs): return """<a href="{}">{}</a>""".format(instance.get_absolute_url(), text) @keyed_helper -def make_boolean_checkmark(value, false_value=""): +def make_boolean_checkmark(value, false_value="", *args, **kwargs): if value: return "&#10004;" return false_value \ No newline at end of file
Added *args and **kwargs to helper signature
pivotal-energy-solutions_django-datatable-view
train
py
41fc9eceae39af0e4c7d5444000996ac52d840a2
diff --git a/tests/test_profiling.py b/tests/test_profiling.py index <HASH>..<HASH> 100644 --- a/tests/test_profiling.py +++ b/tests/test_profiling.py @@ -40,7 +40,7 @@ class TestProfiling(GPflowTestCase): m = self.prepare() s = gpflow.settings.get_settings() s.profiling.dump_timeline = True - s.profiling.output_directory = os.path.dirname(__file__) + s.profiling.output_directory = '/tmp/' s.profiling.output_file_name = 'test_trace_autoflow' with gpflow.settings.temp_settings(s):
Change temporary file directory for profiling tests.
GPflow_GPflow
train
py
c7721c894815a9429f9a46c72ed7bb57f8c128af
diff --git a/services/meta/client.go b/services/meta/client.go index <HASH>..<HASH> 100644 --- a/services/meta/client.go +++ b/services/meta/client.go @@ -120,7 +120,7 @@ func (c *Client) Databases() ([]DatabaseInfo, error) { if c.data.Databases == nil { return []DatabaseInfo{}, nil } - return c.data.CloneDatabases(), nil + return c.data.Databases, nil } // CreateDatabase creates a database.
don't clone database infos in client
influxdata_influxdb
train
go
7898fd8973120443552bd350bcd42675e8ccd6cc
diff --git a/jax/lax/lax_parallel.py b/jax/lax/lax_parallel.py index <HASH>..<HASH> 100644 --- a/jax/lax/lax_parallel.py +++ b/jax/lax/lax_parallel.py @@ -353,7 +353,7 @@ def _defreducer(prim, collective_prim): parallel.papply_primitive_rules[prim] = partial(_reducer_papply, prim, collective_prim) -def _identity_papply(prim, argnum, name, vals, axes, **params): +def _identity_papply(prim, argnum, name, size, vals, axes, **params): return prim.bind(*vals, **params), axes[argnum] def _defidentity(prim, argnum=0):
fix `_identity_papply` to accept axis size
tensorflow_probability
train
py
886c109d8da59b7763e7a20c7361855447350c2a
diff --git a/lib/weblib.php b/lib/weblib.php index <HASH>..<HASH> 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -543,7 +543,7 @@ function link_to_popup_window ($url, $name='popup', $linkname='click here', $url = substr($url, strlen($CFG->wwwroot)); } - $link = '<a title="'. s($title) .'" href="'. $CFG->wwwroot . $url .'" '. + $link = '<a title="'. s(strip_tags($title)) .'" href="'. $CFG->wwwroot . $url .'" '. "onclick=\"this.target='$name'; return openpopup('$url', '$name', '$options', $fullscreen);\">$linkname</a>"; if ($return) { return $link; @@ -4876,7 +4876,7 @@ function helpbutton ($page, $title='', $module='moodle', $image=true, $linktext= if ($imagetext) { $linkobject .= $imagetext; } else { - $linkobject .= '<img class="iconhelp" alt="'.$tooltip.'" src="'. + $linkobject .= '<img class="iconhelp" alt="'.s(strip_tags($tooltip)).'" src="'. $CFG->pixpath .'/help.gif" />'; } } else {
MDL-<I> Double quotes and tags in helpable item breaks XHTML strict; merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
b1d9bcb6f9235bcb6e805c3992cc914c05d36665
diff --git a/lib/ggem/version.rb b/lib/ggem/version.rb index <HASH>..<HASH> 100644 --- a/lib/ggem/version.rb +++ b/lib/ggem/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module GGem - VERSION = "1.10.5" + VERSION = "1.10.6" end
version to <I> * 9e<I> - update to work with Ruby 3+ #<I>
redding_ggem
train
rb
986d98026ddaabd11daae9c5b43ba2d67fe076ae
diff --git a/tests/core/test_templating.py b/tests/core/test_templating.py index <HASH>..<HASH> 100644 --- a/tests/core/test_templating.py +++ b/tests/core/test_templating.py @@ -4,6 +4,8 @@ import shutil import tempfile import unittest import jinja2 +import pwd +import grp import mock from charmhelpers.core import templating @@ -64,7 +66,10 @@ class TestTemplating(unittest.TestCase): fn1 = os.path.join(tmpdir, 'test.conf') try: context = {'nginx_port': 80} - templating.render('test.conf', fn1, context, templates_dir=TEMPLATES_DIR) + templating.render('test.conf', fn1, context, + owner=pwd.getpwuid(os.getuid()).pw_name, + group=grp.getgrgid(os.getgid()).gr_name, + templates_dir=TEMPLATES_DIR) with open(fn1) as f: contents = f.read()
[niedbalski, r=freyes] Fixes regression on tests introduced LP Bug: #<I>.
juju_charm-helpers
train
py
67beab1b5c0efe50e0c61f34a2775c21208e6fa5
diff --git a/spec/features/payu_latam_checkout_spec.rb b/spec/features/payu_latam_checkout_spec.rb index <HASH>..<HASH> 100644 --- a/spec/features/payu_latam_checkout_spec.rb +++ b/spec/features/payu_latam_checkout_spec.rb @@ -23,8 +23,6 @@ describe 'Payu Latam checkout', :vcr, type: :feature do end it 'can process a valid payment', js: true do - sleep(5) - # wait to payU.getPaymentMethods() fill_credit_card '4111 1111 1111 1111', '32144457' click_button 'Save and Continue' expect(page).to have_content('Your order has been processed successfully') @@ -52,8 +50,6 @@ describe 'Payu Latam checkout', :vcr, type: :feature do stub_authorization! before do - sleep(5) - # wait to payU.getPaymentMethods() fill_credit_card '4111 1111 1111 1111', '32144457' click_button 'Save and Continue' end
remove sleep for payu js in spec since is not used right now
ccarruitero_solidus_payu_latam
train
rb
95a8b481e4dcb0c5be60fcd9a31d1ecbcb73cb9b
diff --git a/event-log/src/main/java/net/kuujo/copycat/event/internal/DefaultEventLog.java b/event-log/src/main/java/net/kuujo/copycat/event/internal/DefaultEventLog.java index <HASH>..<HASH> 100644 --- a/event-log/src/main/java/net/kuujo/copycat/event/internal/DefaultEventLog.java +++ b/event-log/src/main/java/net/kuujo/copycat/event/internal/DefaultEventLog.java @@ -86,6 +86,7 @@ public class DefaultEventLog<T> extends AbstractResource<EventLog<T>> implements executor.execute(() -> consumer.handle(value)); } commitIndex = index; + result.flip(); return result; }
Flip event log consumer result before returning.
atomix_atomix
train
java
fd4997d4ad245567630fb4b2f2102942f49860e0
diff --git a/src/Utipd/XCPDClient/Client.php b/src/Utipd/XCPDClient/Client.php index <HASH>..<HASH> 100644 --- a/src/Utipd/XCPDClient/Client.php +++ b/src/Utipd/XCPDClient/Client.php @@ -39,7 +39,7 @@ class Client $client = $this->buildClient(); // build the request - $request = $this->buildRequest($name, $arguments[0], $client); + $request = $this->buildRequest($name, $arguments ? $arguments[0] : [], $client); // get the response $response = $client->send($request);
added support for empty client params
tokenly_xcpd-client
train
php
1691f7abaaf0115b137653b20d17c8693e6967ce
diff --git a/app/Services/CalendarService.php b/app/Services/CalendarService.php index <HASH>..<HASH> 100644 --- a/app/Services/CalendarService.php +++ b/app/Services/CalendarService.php @@ -290,7 +290,7 @@ class CalendarService $query ->orderBy('d_day') - ->orderByDesc('d_year'); + ->orderBy('d_year'); $ind_query = (clone $query) ->join('individuals', static function (JoinClause $join): void {
Fix: #<I> - order of events on calendar pages
fisharebest_webtrees
train
php
e850f9fa6d3b440c51ae0cda7d9d573627839167
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -6,7 +6,6 @@ module.exports = function(grunt) { nodeunit : { zones : [ "tests/zones/**/*.js", - "tests/countries/*.js" ], countries: [ "tests/countries/*.js"
grunt: do not bundle zone and contry tests
moment_moment-timezone
train
js
db5c4cfd75d8525d8a27dca8784a60f74698b7ce
diff --git a/lib/file-set.js b/lib/file-set.js index <HASH>..<HASH> 100644 --- a/lib/file-set.js +++ b/lib/file-set.js @@ -1,7 +1,9 @@ -var fs = require("fs"), - glob = require("glob"), - Glob = glob.Glob, - a = require("array-tools"); +"use strict"; +var fs = require("fs"); +var glob = require("glob"); +var Glob = glob.Glob; +var a = require("array-tools"); +var path = require("path"); /** Exports a contructor taking a list of file patterns as input, returning a `file-set` instance containing the expanded patterns split into separate lists of `files`, `dirs` and `notExisting`. @@ -74,11 +76,14 @@ FileSet.prototype.add = function(files){ } catch(err){ if (err.code === "ENOENT"){ nonExistingFiles.push(file); + } else { + throw err; } } }); nonExistingFiles.forEach(function(file){ + file = path.normalize(file); var glob = new Glob(file, { sync: true, stat: true }); if (glob.found.length){ glob.found.forEach(function(file){
fixed issue when path like 'this/that/../something'
75lb_file-set
train
js
cc63a4814d53b49144441bf8ab28fd7da5947c08
diff --git a/flask_resty/view.py b/flask_resty/view.py index <HASH>..<HASH> 100644 --- a/flask_resty/view.py +++ b/flask_resty/view.py @@ -87,6 +87,10 @@ class ApiView(MethodView): return flask.url_for(flask.request.endpoint, _method='GET', **id_dict) def get_request_data(self, **kwargs): + data_raw = self.parse_request_data() + return self.deserialize(data_raw, **kwargs) + + def parse_request_data(self): try: data_raw = flask.request.get_json()['data'] except TypeError: @@ -94,7 +98,7 @@ class ApiView(MethodView): except KeyError: raise ApiError(400, {'code': 'invalid_data.missing'}) - return self.deserialize(data_raw, **kwargs) + return data_raw def deserialize(self, data_raw, expected_id=None, **kwargs): data, errors = self.deserializer.load(data_raw, **kwargs)
feature: add get_raw_request_data (#<I>) * feature: add get_raw_request_data This makes it easier to override the logic associated with getting the request data w/o ovverriding the de-serializer. * rename to parse_request_data
4Catalyzer_flask-resty
train
py
170a5047e5d4b06f1e5cdc415606adbd32a9bdd2
diff --git a/PyFunceble/logger.py b/PyFunceble/logger.py index <HASH>..<HASH> 100644 --- a/PyFunceble/logger.py +++ b/PyFunceble/logger.py @@ -80,7 +80,11 @@ class Logger: # pylint: disable=too-many-public-methods # pylint: disable=line-too-long - OWN_FORMAT: str = "[%(asctime)s::%(levelname)s::%(origin_path)s:%(origin_line)s@%(origin_func)s](PID%(thread)s:%(threadName)s): %(message)s" + OWN_FORMAT: str = ( + "[%(asctime)s | %(levelname)s | %(origin_path)s:" + "%(origin_line)s@%(origin_func)s | TPID%(thread)d:%(threadName)s" + " | PPID%(process)d:%(processName)s]:\n%(message)s" + ) """ Our very own format. """
Improvement of the logging format. Indeed, before this patch, because we didn't used multiprocessing, there was no tracking of running/logging process.
funilrys_PyFunceble
train
py
9a9c4669ccd85d36399ed696c7d3415796aee276
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,3 +1,4 @@ +require 'rubygems' require 'mocha' require 'builder' require 'pivotal'
Make sure specs see rubygems
trydionel_git-pivotal
train
rb
4f8c92b380f16ba669cdb3d83277b1b74f20a645
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ setup_data = { 'long_description': """Simple tools for processing string in russian (choose proper form for plurals, in-words representation of numerals, dates in russian without locales, transliteration, etc)""", - 'packages': ['pytils', 'pytils.templatetags', 'pytils.test', 'pytils.test.templatetags'], + 'packages': ['pytils', 'pytils.templatetags', 'pytils.test', 'pytils.test.templatetags', 'pytils.third'], 'license': "GPL", 'platforms': "All", 'classifiers': [
Fix #<I>, pytils.third is added as package in setup.py
last-partizan_pytils
train
py
ce73cb56bd518b1aca5cecd6dba1b6ba88d18770
diff --git a/lib/travis/model/artifact/log.rb b/lib/travis/model/artifact/log.rb index <HASH>..<HASH> 100644 --- a/lib/travis/model/artifact/log.rb +++ b/lib/travis/model/artifact/log.rb @@ -10,8 +10,9 @@ class Artifact::Log < Artifact def append(job_id, chars, number = nil, final = false) if Travis::Features.feature_active?(:log_aggregation) id = Artifact::Log.where(job_id: job_id).select(:id).first.id + puts "[warn] artifact is is nil for job_id: #{job_id}, number: #{number}, ignoring the log part!" meter('logs.update') do - Artifact::Part.create!(artifact_id: id, content: filter(chars), number: number, final: final || final?(chars)) + Artifact::Part.create!(artifact_id: id, content: filter(chars), number: number, final: final || final?(chars)) if id end else meter('logs.update') do
ignore artifact parts that do not have an id and warn
travis-ci_travis-core
train
rb
af34275a4dd485a1bbbabc0135c02a60fc8be48a
diff --git a/lib/fernet.rb b/lib/fernet.rb index <HASH>..<HASH> 100644 --- a/lib/fernet.rb +++ b/lib/fernet.rb @@ -10,12 +10,14 @@ Fernet::Configuration.run module Fernet TOKEN_VERSION = 0x80.freeze - def self.generate(secret, message = '', &block) - Generator.new(secret: secret, message: message).generate(&block) + def self.generate(secret, message = '', opts = {}, &block) + Generator.new(opts.merge({secret: secret, message: message})). + generate(&block) end - def self.verify(secret, token, &block) - Verifier.new(secret: secret, token: token).verify(&block) + def self.verify(secret, token, opts = {}, &block) + Verifier.new(opts.merge({secret: secret, token: token})). + verify(&block) end def self.verifier(secret, token, &block)
Allows options to be injected into the generator/verifier
fernet_fernet-rb
train
rb
6658e6f1e1a0229f09c45c617b3f3a1281cf6f4d
diff --git a/tests/test_project.py b/tests/test_project.py index <HASH>..<HASH> 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -35,7 +35,7 @@ class ProjectTest(unittest.TestCase): with self.assertRaises(ConfigurationError): find_configs(package_root) - @patch('pathlib.Path') + @patch.object(pathlib, 'Path') @patch('ballet.project.find_configs') def test_config_get(self, mock_find_configs, mock_Path): config1 = {
Have to patch.object pathlib because of compat issues
HDI-Project_ballet
train
py
2686823c129afc38fda3080d71d1c0a96c7c4b83
diff --git a/lib/Form/Field/Upload.php b/lib/Form/Field/Upload.php index <HASH>..<HASH> 100644 --- a/lib/Form/Field/Upload.php +++ b/lib/Form/Field/Upload.php @@ -150,7 +150,9 @@ class Form_Field_Upload extends Form_Field { //.', error: '.$this->getFileError()); //more user friendly } - $e->addMoreInfo('upload_error',$this->getFileError()); + if(is_subclass_of($e, 'BaseException')){ + $e->addMoreInfo('upload_error',$this->getFileError()); + } echo '<script>$=window.top.$;'; $_POST['ajax_submit']=1;
Update Upload.php fix for Fatal error: Call to undefined method ErrorException::addMoreInfo() in /atk4/lib/Form/Field/Upload.php on line <I>
atk4_atk4
train
php
d65168bf04f96ded55bdf39b197db964fd48fe8c
diff --git a/src/social-likes.js b/src/social-likes.js index <HASH>..<HASH> 100644 --- a/src/social-likes.js +++ b/src/social-likes.js @@ -1,5 +1,5 @@ import Button from './button'; -import { deepmerge, toArray } from './util'; +import { deepmerge, dataset, toArray } from './util'; import { prefix } from './config'; // Default options @@ -17,7 +17,7 @@ const defaults = { export default class SocialLikes { constructor(container, options = {}) { this.container = container; - this.options = deepmerge(defaults, options); + this.options = deepmerge(deepmerge(defaults, options), dataset(container)); let buttons = this.container.children; this.buttons = toArray(buttons).map(elem => {
data-attributes on container should override SocialLikes options.
sapegin_social-likes-next
train
js
dbe72815f15e37f44c40a1da7f064063e7e351e7
diff --git a/manifest.php b/manifest.php index <HASH>..<HASH> 100755 --- a/manifest.php +++ b/manifest.php @@ -29,7 +29,7 @@ return array( 'label' => 'Browser and OS diagnostic tool', 'description' => 'Check compatibility of the os and browser of a client', 'license' => 'GPL-2.0', - 'version' => '2.17.10', + 'version' => '2.17.11', 'author' => 'Open Assessment Technologies SA', 'requires' => array( 'tao' => '>=17.8.0', diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php index <HASH>..<HASH> 100755 --- a/scripts/update/Updater.php +++ b/scripts/update/Updater.php @@ -727,6 +727,6 @@ class Updater extends \common_ext_ExtensionUpdater $this->setVersion('2.17.9'); } - $this->skip('2.17.9', '2.17.10'); + $this->skip('2.17.9', '2.17.11'); } }
Bump v. <I> (PDOException replaced with DBALException)
oat-sa_extension-tao-clientdiag
train
php,php
ed40d087da2d1164d2474167fb59c877469b063e
diff --git a/etrago/cluster/gasclustering.py b/etrago/cluster/gasclustering.py index <HASH>..<HASH> 100755 --- a/etrago/cluster/gasclustering.py +++ b/etrago/cluster/gasclustering.py @@ -146,8 +146,14 @@ def create_gas_busmap(etrago): save="network_ch4_" + kmean_gas_settings["bus_weight_tocsv"], ) elif kmean_gas_settings["bus_weight_fromcsv"] is not None: - weight_ch4 = pd.Series.from_csv(kmean_gas_settings["bus_weight_fromcsv"]) - weight_ch4.index = weight_ch4.index.astype(str) + # create DataFrame with uniform weightings for all ch4_buses + weight_ch4 = pd.DataFrame([1] * len(buses_ch4), index=buses_ch4.index) + loaded_weights = pd.read_csv( + kmean_gas_settings["bus_weight_fromcsv"], index_col=0 + ) + # load weights into previously created DataFrame + loaded_weights.index = loaded_weights.index.astype(str) + weight_ch4.loc[loaded_weights.index] = loaded_weights else: weight_ch4 = weighting_for_scenario(network_ch4.buses, save=False)
Updated deprecated from_csv to pandas.read_csv()
openego_eTraGo
train
py
0e78e0b062d3b21be791fe07ae7fb739b5625706
diff --git a/lib/schema_dev/gem.rb b/lib/schema_dev/gem.rb index <HASH>..<HASH> 100644 --- a/lib/schema_dev/gem.rb +++ b/lib/schema_dev/gem.rb @@ -120,7 +120,7 @@ module SchemaDev s = s.gsub('%GEM_MODULE%', gem_module) s = s.gsub('%FULLNAME%', fullname) s = s.gsub('%EMAIL%', email) - s = s.gsub('%SCHEMA_PLUS_CORE_DEPENDENCY%', dependency(schema_plus_core_version)) + s = s.gsub('%SCHEMA_PLUS_CORE_DEPENDENCY%') { dependency(schema_plus_core_version) } s = s.gsub('%SCHEMA_DEV_DEPENDENCY%', dependency(SchemaDev::VERSION)) s = s.gsub('%YEAR%', Time.now.strftime("%Y")) end
Only try to connect to the internet if you need it.
SchemaPlus_schema_dev
train
rb
d6d452fcbd108aebd841d4da8bb7afa6cdb31d3a
diff --git a/underfs/oss/src/main/java/tachyon/underfs/oss/OSSInputStream.java b/underfs/oss/src/main/java/tachyon/underfs/oss/OSSInputStream.java index <HASH>..<HASH> 100644 --- a/underfs/oss/src/main/java/tachyon/underfs/oss/OSSInputStream.java +++ b/underfs/oss/src/main/java/tachyon/underfs/oss/OSSInputStream.java @@ -65,4 +65,9 @@ public class OSSInputStream extends InputStream { int ret = mInputStream.read(b, off, len); return ret; } + + @Override + public long skip(long n) throws IOException { + throw new IOException("unsupported skip in OSSInputStream currently."); + } }
[TACHYON-<I>] Merge Implement the OSSUnderFileSystem. Throw exception when call OSSInputStream.skip for the oss sdk not provide yet.
Alluxio_alluxio
train
java
358677a957d0f0f27e783e42a57efaab0189cbb5
diff --git a/salt/cloud/clouds/ibmsce.py b/salt/cloud/clouds/ibmsce.py index <HASH>..<HASH> 100644 --- a/salt/cloud/clouds/ibmsce.py +++ b/salt/cloud/clouds/ibmsce.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- ''' IBM SCE Cloud Module ====================
utf tag for ibm cloud
saltstack_salt
train
py
9380c7caa71d5b3c7638a6c7cb44eade9d949859
diff --git a/common/persistence/sql/class.Platform.php b/common/persistence/sql/class.Platform.php index <HASH>..<HASH> 100644 --- a/common/persistence/sql/class.Platform.php +++ b/common/persistence/sql/class.Platform.php @@ -152,7 +152,17 @@ class common_persistence_sql_Platform { * @return string */ public function getNowExpression(){ - return $this->dbalPlatform->getNowExpression(); + // We can't use $this->dbalPlatform->getNowExpression() because sqlite, + // at least used for the tests, returns `datetime('now')` which can + // not be parsed as a regular date. + // We instead generate a date with php and the format it with + // $this->dbalPlatform->getDateTimeTzFormatString(), to still have the + // correct format to be inserted in db. + + $datetime = new \DateTime('now', new \DateTimeZone('UTC')); + $date = $datetime->format($this->dbalPlatform->getDateTimeTzFormatString()); + + return $date; } /**
Amended getNowExpression to use a php-generated date instead of relying on platform-generated date. Sqlite returns `datetime('now')` which cannot be parsed as a regular date.
oat-sa_generis
train
php
f3c252e597737e7e73040f68e18561a6423923f8
diff --git a/lxc/cluster.go b/lxc/cluster.go index <HASH>..<HASH> 100644 --- a/lxc/cluster.go +++ b/lxc/cluster.go @@ -160,7 +160,11 @@ func (c *cmdClusterList) Run(cmd *cobra.Command, args []string) error { data := [][]string{} for _, member := range members { roles := member.ClusterMemberPut.Roles - line := []string{member.ServerName, member.URL, strings.Join(roles, "\n"), member.Architecture, member.FailureDomain, member.Description, strings.ToUpper(member.Status), member.Message} + rolesDelimiter := "\n" + if c.flagFormat == "csv" { + rolesDelimiter = "," + } + line := []string{member.ServerName, member.URL, strings.Join(roles, rolesDelimiter), member.Architecture, member.FailureDomain, member.Description, strings.ToUpper(member.Status), member.Message} data = append(data, line) } sort.Sort(byName(data))
lxc/cluster: Comma as delimeter for csv format
lxc_lxd
train
go
a714b46cfa513d825bb07c6b87f02dafd96522c1
diff --git a/contrib/clients/TSCA/ruby/RubyClient.rb b/contrib/clients/TSCA/ruby/RubyClient.rb index <HASH>..<HASH> 100755 --- a/contrib/clients/TSCA/ruby/RubyClient.rb +++ b/contrib/clients/TSCA/ruby/RubyClient.rb @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -$:.push('../../../../thrift/gen-rb') +$:.push('gen-rb') $:.unshift '../../../lib/rb/lib' require 'csv'
Adapt TSCA ruby client to new code layout
Alignak-monitoring_alignak
train
rb
c363c5ffe187b7a39633a6be4c35ea962a37bf3a
diff --git a/lib/backup/notifier/mail.rb b/lib/backup/notifier/mail.rb index <HASH>..<HASH> 100644 --- a/lib/backup/notifier/mail.rb +++ b/lib/backup/notifier/mail.rb @@ -76,6 +76,11 @@ module Backup attr_accessor :openssl_verify_mode ## + # Automatically set SSL + # Example: true + attr_accessor :ssl + + ## # When using the `:sendmail` `delivery_method` option, # this may be used to specify the absolute path to `sendmail` (if needed) # Example: '/usr/sbin/sendmail' @@ -174,7 +179,8 @@ module Backup :password => @password, :authentication => @authentication, :enable_starttls_auto => @enable_starttls_auto, - :openssl_verify_mode => @openssl_verify_mode } + :openssl_verify_mode => @openssl_verify_mode, + :ssl => @ssl } when 'sendmail' opts = {} opts.merge!(:location => File.expand_path(@sendmail)) if @sendmail
Add support for SMTP with SSL. Fastmail requires SMTP to use SSL but not STARTTLS. This change enables ones to turn on SSL without automatically starting TLS. Here are some relevant links: <URL>
backup_backup
train
rb
6e4d0bc85bad39abfe14554d10fce976ca61faa0
diff --git a/gui/tools/designer.py b/gui/tools/designer.py index <HASH>..<HASH> 100644 --- a/gui/tools/designer.py +++ b/gui/tools/designer.py @@ -77,7 +77,9 @@ class BasicDesigner: elif evt.GetEventType() == wx.EVT_LEFT_UP.typeId: self.mouse_up(evt) elif evt.GetEventType() == wx.EVT_MOTION.typeId: - self.mouse_move(evt) + # wait 500ms before EVT_LEFT_DOWN to prevent accidental moves + if self.timestamp and evt.Timestamp - self.timestamp > 500: + self.mouse_move(evt) elif evt.GetEventType() == wx.EVT_RIGHT_DOWN.typeId and self.inspector: # on right click, inspect and pop up the context menu # do this after this event to prevent reference issues (deletions!)
fixed accidental move when clicking over a control in the designer
reingart_gui2py
train
py
a59ee93bcac73f58eabe77aebbe3b21e80da967c
diff --git a/builder/amazon/chroot/device.go b/builder/amazon/chroot/device.go index <HASH>..<HASH> 100644 --- a/builder/amazon/chroot/device.go +++ b/builder/amazon/chroot/device.go @@ -27,11 +27,12 @@ func AvailableDevice() (string, error) { continue } - for i := 1; i < 16; i++ { - device := fmt.Sprintf("/dev/%s%c%d", prefix, letter, i) - if _, err := os.Stat(device); err != nil { - return device, nil - } + // To be able to build both Paravirtual and HVM images, the unnumbered + // device and the first numbered one must be available. + // E.g. /dev/xvdf and /dev/xvdf1 + numbered_device := fmt.Sprintf("%s%d", device, 1) + if _, err := os.Stat(numbered_device); err != nil { + return device, nil } }
To be able to build both PV and HVM images, it is not possible to use both /dev/sd[f-p] and [1-<I>] as the HVM images get attached at /dev/sdf but must be mounted a /dev/sdf1. This reduces the number of simultaneous packer runs possible significantly, but unless you are Netflix, who have Aminator anyway, this is probably never going to be an issue
hashicorp_packer
train
go
dff0f517e2976c26fb01a517583339a575af9200
diff --git a/src/main/com/mongodb/DBApiLayer.java b/src/main/com/mongodb/DBApiLayer.java index <HASH>..<HASH> 100644 --- a/src/main/com/mongodb/DBApiLayer.java +++ b/src/main/com/mongodb/DBApiLayer.java @@ -83,10 +83,16 @@ public class DBApiLayer extends DB { try { if (isServerVersionAtLeast(asList(2, 6, 0))) { CommandResult userInfoResult = command(new BasicDBObject("usersInfo", username)); - userInfoResult.throwOnError(); - DBObject userCommandDocument = getUserCommandDocument(username, passwd, readOnly, - ((List) userInfoResult.get("users")).isEmpty() - ? "createUser" : "updateUser"); + try { + userInfoResult.throwOnError(); + } catch (MongoException e) { + if (e.getCode() != 13) { + throw e; + } + } + String operationType = (!userInfoResult.containsField("users") || + ((List) userInfoResult.get("users")).isEmpty()) ? "createUser" : "updateUser"; + DBObject userCommandDocument = getUserCommandDocument(username, passwd, readOnly, operationType); CommandResult commandResult = command(userCommandDocument); commandResult.throwOnError(); return new WriteResult(commandResult, getWriteConcern());
Work around localhost exception issues in addUser helper JAVA-<I>
mongodb_mongo-java-driver
train
java
89698044077924b5fb77088ef554ee0601ff4b07
diff --git a/src/Keboola/Syrup/Command/QueueCreateCommand.php b/src/Keboola/Syrup/Command/QueueCreateCommand.php index <HASH>..<HASH> 100644 --- a/src/Keboola/Syrup/Command/QueueCreateCommand.php +++ b/src/Keboola/Syrup/Command/QueueCreateCommand.php @@ -60,9 +60,12 @@ class QueueCreateCommand extends ContainerAwareCommand } if (!$noWatch) { - $cwClient = CloudWatchClient::factory([ - 'region' => 'us-east-1' - ]); + $data['region'] = $region; + if ($accessKey != null && $secretKey != null) { + $data['key'] = $accessKey; + $data['secret'] = $secretKey; + } + $cwClient = CloudWatchClient::factory($data); $cwClient->putMetricAlarm([ // AlarmName is required
fix (QueueCreateCommand): use supplied credentials for Cloudwatch alert
keboola_syrup
train
php
c795dc78437e562fde29d254561895dbb0a0912e
diff --git a/question/type/questiontype.php b/question/type/questiontype.php index <HASH>..<HASH> 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -1701,6 +1701,7 @@ class default_questiontype { * This is used in question/restorelib.php */ function restore($old_question_id,$new_question_id,$info,$restore) { + global $DB; $status = true; $extraquestionfields = $this->extra_question_fields(); @@ -1716,7 +1717,7 @@ class default_questiontype { foreach ($extraquestionfields as $field) { $record->$field = backup_todb($recordinfo['#'][strtoupper($field)]['0']['#']); } - if (!insert_record($questionextensiontable, $record)) { + if (!$DB->insert_record($questionextensiontable, $record)) { echo "Can't insert record in $questionextensiontable when restoring " . $this->name() . ' question id ' . $question; $status = false;
questiontypes: MDL-<I> Fix another merge error.
moodle_moodle
train
php
24e0e25ec86b069b1b44f59f8de9314d0a404abc
diff --git a/pysat/tests/test_utils.py b/pysat/tests/test_utils.py index <HASH>..<HASH> 100644 --- a/pysat/tests/test_utils.py +++ b/pysat/tests/test_utils.py @@ -545,7 +545,7 @@ class TestBasics(): self.testInst.index.freq = pysat.utils.calc_freq(self.testInst.index) - assert set.testInst.index.freq.find("1S") == 0 + assert self.testInst.index.freq.find("1S") == 0 def test_calc_freq_ns(self): """Test index frequency calculation with nanosecond output""" @@ -555,7 +555,7 @@ class TestBasics(): uts=np.arange(0.0, 0.04, .01)) freq = pysat.utils.calc_freq(tind) - assert set.testInst.index.freq.find("10000000N") == 0 + assert self.testInst.index.freq.find("10000000N") == 0 def test_calc_freq_len_fail(self): """Test index frequency calculation with empty list"""
Update test_utils.py Fixed bug in frequency tests
rstoneback_pysat
train
py
d8b34a5502411385f434f24ad85e6ea5b0fca28a
diff --git a/tests/Hal/HalTest.php b/tests/Hal/HalTest.php index <HASH>..<HASH> 100644 --- a/tests/Hal/HalTest.php +++ b/tests/Hal/HalTest.php @@ -788,7 +788,6 @@ JSON; ); $json = json_decode($hal->asJson()); - var_dump($json); $this->assertInternalType('array', $json->_embedded->foo->_embedded->bar); } }
Careless. Remove var_dump.
blongden_hal
train
php
618060b229194185f20b1d73897e682bd36ffb8d
diff --git a/lib/awesome_translations/erb_inspector.rb b/lib/awesome_translations/erb_inspector.rb index <HASH>..<HASH> 100644 --- a/lib/awesome_translations/erb_inspector.rb +++ b/lib/awesome_translations/erb_inspector.rb @@ -4,7 +4,7 @@ class AwesomeTranslations::ErbInspector def initialize(args = {}) @args = args - @args[:exts] ||= [".erb", ".haml", ".rb", ".rake"] + @args[:exts] ||= [".erb", ".haml", ".rb", ".rake", ".slim"] if @args[:dirs] @dirs = @args[:dirs]
Added support for *.slim files
kaspernj_awesome_translations
train
rb
28a519842df4c3254e3a7bbd958b70229980fd87
diff --git a/examples/profile.php b/examples/profile.php index <HASH>..<HASH> 100755 --- a/examples/profile.php +++ b/examples/profile.php @@ -8,7 +8,12 @@ $token = isset($_GET['token']) ? $_GET['token'] : ''; $profileAttributes = []; try { - $yotiClient = new Yoti\YotiClient(getenv('YOTI_SDK_ID'), getenv('YOTI_KEY_FILE_PATH')); + $yotiConnectApi = getenv('YOTI_CONNECT_API') ?: Yoti\YotiClient::DEFAULT_CONNECT_API; + $yotiClient = new Yoti\YotiClient( + getenv('YOTI_SDK_ID'), + getenv('YOTI_KEY_FILE_PATH'), + $yotiConnectApi + ); $activityDetails = $yotiClient->getActivityDetails($token); $profile = $activityDetails->getProfile();
SDK-<I>: Add override option for CoonectAPi
getyoti_yoti-php-sdk
train
php
6a7439751811b15d8e475fb6475d57328e6f76cd
diff --git a/pylivetrader/backend/alpaca.py b/pylivetrader/backend/alpaca.py index <HASH>..<HASH> 100644 --- a/pylivetrader/backend/alpaca.py +++ b/pylivetrader/backend/alpaca.py @@ -527,7 +527,8 @@ class Backend(BaseBackend): limit=bar_count) # change the index values to assets to compatible with zipline - symbol_asset = {a.symbol: a for a in assets} + symbol_asset = {a.symbol: a for a in assets} if not assets_is_scalar \ + else {assets.symbol: assets} df.columns = df.columns.set_levels([ symbol_asset[s] for s in df.columns.levels[0]], level=0) return df
fix in case assets is not a list
alpacahq_pylivetrader
train
py
3572c7496f2c3b7a7ff5d0e2d7749035f71579cd
diff --git a/lib/server.js b/lib/server.js index <HASH>..<HASH> 100644 --- a/lib/server.js +++ b/lib/server.js @@ -104,7 +104,7 @@ Server.prototype._publish = function() { var info = this._bridge.getService(Service.AccessoryInformation); info.setCharacteristic(Characteristic.Manufacturer, `${toTitleCase(require('../package.json').author.name)}`); info.setCharacteristic(Characteristic.Model, `${toTitleCase(require('../package.json').name)}`); - info.setCharacteristic(Characteristic.SerialNumber, bridgeConfig.pin); + info.setCharacteristic(Characteristic.SerialNumber, bridgeConfig.username); info.setCharacteristic(Characteristic.FirmwareRevision, require('../package.json').version); this._printPin(bridgeConfig.pin);
Update server.js Populate serial number from bridge username (MAC address)
nfarina_homebridge
train
js
2b4f294af83388ee7a90ef09944675a7afca2ce5
diff --git a/handlebars/helpers.js b/handlebars/helpers.js index <HASH>..<HASH> 100644 --- a/handlebars/helpers.js +++ b/handlebars/helpers.js @@ -302,7 +302,7 @@ function renderTree (object, isLast, fn) { * @param somePath the root-directory of the tree * @param isLast an array of boolean values, showing whether the current element on each level is the last element in the list * @param filter a function that returns true for each file that should be displayed - * @returns an object structure compatible with `renderTree` representing the file tree + * @returns {object} an object structure compatible with `renderTree` representing the file tree */ function createDirectoryTree (somePath, isLast, filter) { debug('filter', filter) @@ -310,10 +310,6 @@ function createDirectoryTree (somePath, isLast, filter) { var filelink = path.basename(somePath) if (fs.statSync(somePath).isFile()) { - if (filter && !filter(somePath)) { - debug('Omitting ' + somePath + ' based on glob') - return '' - } return {name: filelink} } return {
Remove redundant filter-call in "createDirectoryTree"
nknapp_thought
train
js
e9214b866ac1efe41d56e99fe38743167e0e5b84
diff --git a/system/Model.php b/system/Model.php index <HASH>..<HASH> 100644 --- a/system/Model.php +++ b/system/Model.php @@ -1123,7 +1123,7 @@ class Model */ public function paginate(int $perPage = null, string $group = 'default', int $page = 0) { - $pager = \Config\Services::pager(null, null, true); + $pager = \Config\Services::pager(null, null, false); $page = $page >= 1 ? $page : $pager->getCurrentPage($group); $total = $this->countAllResults(false);
back to use shared pager instance in Model::paginate
codeigniter4_CodeIgniter4
train
php
69401f90a31a83b85fd4aa0d1756d80f65cf6993
diff --git a/tensor2tensor/utils/t2t_model.py b/tensor2tensor/utils/t2t_model.py index <HASH>..<HASH> 100644 --- a/tensor2tensor/utils/t2t_model.py +++ b/tensor2tensor/utils/t2t_model.py @@ -387,7 +387,7 @@ class T2TModel(base.Layer): assert not isinstance(target_modality, dict), ( "model_body must return a dictionary of logits when " "problem_hparams.target_modality is a dict.") - return self._loss_single(logits, target_modality, features) + return self._loss_single(logits, target_modality, features["targets"]) def optimize(self, loss, num_async_replicas=1): """Return a training op minimizing loss."""
One more fix for target modalites.
tensorflow_tensor2tensor
train
py
83a0802e2073a7b36c1143b2d9c1b49fb2b74805
diff --git a/natural-language-understanding/src/main/java/com/ibm/watson/natural_language_understanding/v1/NaturalLanguageUnderstanding.java b/natural-language-understanding/src/main/java/com/ibm/watson/natural_language_understanding/v1/NaturalLanguageUnderstanding.java index <HASH>..<HASH> 100644 --- a/natural-language-understanding/src/main/java/com/ibm/watson/natural_language_understanding/v1/NaturalLanguageUnderstanding.java +++ b/natural-language-understanding/src/main/java/com/ibm/watson/natural_language_understanding/v1/NaturalLanguageUnderstanding.java @@ -165,6 +165,7 @@ public class NaturalLanguageUnderstanding extends BaseService { } builder.header("Accept", "application/json"); if (listModelsOptions != null) { + } ResponseConverter<ListModelsResults> responseConverter = ResponseConverterUtils.getValue( new com.google.gson.reflect.TypeToken<ListModelsResults>() { @@ -208,6 +209,7 @@ public class NaturalLanguageUnderstanding extends BaseService { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + ResponseConverter<DeleteModelResults> responseConverter = ResponseConverterUtils.getValue( new com.google.gson.reflect.TypeToken<DeleteModelResults>() { }.getType());
refactor(Natural Language Understanding): Add newest generator output
watson-developer-cloud_java-sdk
train
java
7c65b3beaf9bacb9a2c375e8b7d4a7fceed3cdfb
diff --git a/labware/liquids.py b/labware/liquids.py index <HASH>..<HASH> 100644 --- a/labware/liquids.py +++ b/labware/liquids.py @@ -73,7 +73,7 @@ class LiquidContainer(): def assert_capacity(self, new_amount, ml=False): if not self.max_volume: - return + raise ValueError("No maximum liquid amount set for well.") new_value = self.calculate_total_volume()+new_amount if (new_value > self.max_volume): raise VolumeError(
LiquidContainer: Force maximum limit. I'm not actually sure why the tests concerning maximum limits on MicroplateWell are passing. Need to figure out where they're set.
Opentrons_opentrons
train
py
77480ddd05ea95f4152d9f03cafd7ba13b3ae0a1
diff --git a/TextFormatter/Tests/ParamsAndFiltersTest.php b/TextFormatter/Tests/ParamsAndFiltersTest.php index <HASH>..<HASH> 100644 --- a/TextFormatter/Tests/ParamsAndFiltersTest.php +++ b/TextFormatter/Tests/ParamsAndFiltersTest.php @@ -636,6 +636,21 @@ class ParamsAndFiltersTest extends \PHPUnit_Framework_TestCase ) ), array( + '[x range=TWENTY /]', + '<rt><X>[x range=TWENTY /]</X></rt>', + array( + 'error' => array( + array( + 'pos' => 0, + 'bbcodeId' => 'X', + 'paramName' => 'range', + 'msg' => 'Invalid param %s', + 'params' => array('range') + ) + ) + ) + ), + array( '[size=1]too small[/size]', '<rt><SIZE size="7"><st>[size=1]</st>too small<et>[/size]</et></SIZE></rt>', array(
Added test covering invalid data in a range param
s9e_TextFormatter
train
php
b20b622c20bf9f78b8ab06f9020935843f9a8cc3
diff --git a/lib/resolve.js b/lib/resolve.js index <HASH>..<HASH> 100644 --- a/lib/resolve.js +++ b/lib/resolve.js @@ -25,6 +25,12 @@ module.exports = function resolve(dirname) { return path.resolve(process.env.APP_ROOT_PATH); } + // Defer to Yarn Plug'n'Play if enabled + if (process.versions.pnp) { + var pnp = require('pnpapi'); + return pnp.getPackageInformation(pnp.topLevel).packageLocation; + } + // Defer to main process in electron renderer if ('undefined' !== typeof window && window.process && 'renderer' === window.process.type) { var electron = 'electron';
feat: Yarn Plug'n'Play support
inxilpro_node-app-root-path
train
js
75ec6e1ff8da53ce1a0f831e50817910fd52a214
diff --git a/zzk/service2/hoststate_test.go b/zzk/service2/hoststate_test.go index <HASH>..<HASH> 100644 --- a/zzk/service2/hoststate_test.go +++ b/zzk/service2/hoststate_test.go @@ -344,7 +344,7 @@ func (t *ZZKTest) TestHostStateListener_Spawn_AttachRun(c *C) { select { case e := <-ev: c.Assert(e.Type, Equals, client.EventNodeDeleted) - case <-time.After(time.Second): + case <-time.After(5 * time.Second): c.Fatalf("state not deleted") } handler.AssertExpectations(c)
bumped hoststate timeout for test
control-center_serviced
train
go
bdf897f212f5df0f49840ae1abc7bf6f6325b186
diff --git a/djongo/models/fields.py b/djongo/models/fields.py index <HASH>..<HASH> 100644 --- a/djongo/models/fields.py +++ b/djongo/models/fields.py @@ -49,8 +49,7 @@ def make_mdl(model, model_dict): def useful_field(field): - return field.concrete and not (field.is_relation - or isinstance(field, (AutoField, BigAutoField))) + return field.concrete and not isinstance(field, (AutoField, BigAutoField)) class ModelSubterfuge:
Fixed embedded relations (#<I>)
nesdis_djongo
train
py
a932febde193d260dee734a50d3be91717723c03
diff --git a/charmhelpers/contrib/openstack/amulet/deployment.py b/charmhelpers/contrib/openstack/amulet/deployment.py index <HASH>..<HASH> 100644 --- a/charmhelpers/contrib/openstack/amulet/deployment.py +++ b/charmhelpers/contrib/openstack/amulet/deployment.py @@ -121,7 +121,7 @@ class OpenStackAmuletDeployment(AmuletDeployment): # Charms which should use the source config option use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph', - 'ceph-osd', 'ceph-radosgw'] + 'ceph-osd', 'ceph-radosgw', 'ceph-mon'] # Charms which can not use openstack-origin, ie. many subordinates no_origin = ['cinder-ceph', 'hacluster', 'neutron-openvswitch', 'nrpe',
[trivial] Add ceph-mon to the list of charms that use the source configuration option
juju_charm-helpers
train
py
35e6ed37ca5b010c2d152ed6821ea8cf51c71092
diff --git a/restapi/configure_mr_fusion.go b/restapi/configure_mr_fusion.go index <HASH>..<HASH> 100644 --- a/restapi/configure_mr_fusion.go +++ b/restapi/configure_mr_fusion.go @@ -236,6 +236,8 @@ func setupGlobalMiddleware(handler http.Handler) http.Handler { if strings.Contains(r.URL.Path, "/chronograf/v1") { handler.ServeHTTP(w, r) return + } else if r.URL.Path == "//" { + http.Redirect(w, r, "/index.html", http.StatusFound) } else { assets().Handler().ServeHTTP(w, r) return
Hotfix for double slash redirect
influxdata_influxdb
train
go
01e8ba26a402cf8f3808ba056334646ddbf68ec5
diff --git a/main.go b/main.go index <HASH>..<HASH> 100644 --- a/main.go +++ b/main.go @@ -39,7 +39,7 @@ var ( var usage = `Usage: boom [options...] <url> Options: - -n Number of requests to run. + -n Number of requests to run. Can not be -c Number of requests to run concurrently. Total number of requests cannot be smaller than the concurency level. @@ -63,6 +63,10 @@ func main() { n := *flagN c := *flagC + if n <= 0 || c <= 0 { + usageAndExit() + } + // If total number is smaller than concurrency level, // make the total number c. if c > n {
Sanity checks for n and c.
rakyll_hey
train
go
8c97b2d01a1cd388f1b95607ebd8eba85af89fe3
diff --git a/lib/ztk/background.rb b/lib/ztk/background.rb index <HASH>..<HASH> 100644 --- a/lib/ztk/background.rb +++ b/lib/ztk/background.rb @@ -95,6 +95,10 @@ module ZTK @parent_writer.close @parent_reader.close + STDOUT.reopen("/dev/null", "a") + STDERR.reopen("/dev/null", "a") + STDIN.reopen("/dev/null") + if !(data = block.call).nil? config.logger.debug { "write(#{data.inspect})" } @child_writer.write(Base64.encode64(Marshal.dump(data)))
reopen std out, err and in
zpatten_ztk
train
rb
5430524ebd1c580a65dc5dc3d352b2401e66a106
diff --git a/lib/puppet/provider/package/dnf.rb b/lib/puppet/provider/package/dnf.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/provider/package/dnf.rb +++ b/lib/puppet/provider/package/dnf.rb @@ -28,7 +28,7 @@ Puppet::Type.type(:package).provide :dnf, :parent => :yum do end end - defaultfor :operatingsystem => :fedora, :operatingsystemmajrelease => ['22', '23', '24', '25'] + defaultfor :operatingsystem => :fedora, :operatingsystemmajrelease => (22..30).to_a def self.update_command # In DNF, update is deprecated for upgrade
(PUP-<I>) Update dnf provider to support future Fedora releases The dnf provider is hard coded to work with Fedora <I>-<I>. This update converts the release list into a range which will work Fedora through version <I>.
puppetlabs_puppet
train
rb
c673d76979c8ad2f70ac3012489d42f04a318635
diff --git a/server.go b/server.go index <HASH>..<HASH> 100644 --- a/server.go +++ b/server.go @@ -118,12 +118,22 @@ func randomUint16Number(max uint16) uint16 { // AddRebroadcastInventory adds 'iv' to the list of inventories to be // rebroadcasted at random intervals until they show up in a block. func (s *server) AddRebroadcastInventory(iv *btcwire.InvVect) { + // Ignore if shutting down. + if atomic.LoadInt32(&s.shutdown) != 0 { + return + } + s.modifyRebroadcastInv <- broadcastInventoryAdd(iv) } // RemoveRebroadcastInventory removes 'iv' from the list of items to be // rebroadcasted if present. func (s *server) RemoveRebroadcastInventory(iv *btcwire.InvVect) { + // Ignore if shutting down. + if atomic.LoadInt32(&s.shutdown) != 0 { + return + } + s.modifyRebroadcastInv <- broadcastInventoryDel(iv) } @@ -802,6 +812,16 @@ out: timer.Stop() + // Drain channels before exiting so nothing is left waiting around + // to send. +cleanup: + for { + select { + case <-s.modifyRebroadcastInv: + default: + break cleanup + } + } s.wg.Done() }
Fix case where block mgr could hang on shutdown. This commit resolves an issue where it was possible the block manager could hang on shutdown due to inventory rebroadcasting. In particular, it adds checks to prevent modification of the of rebroadcast inventory during shutdown and adds a drain on the channel to ensure any outstanding messages are discarded. Found by @dajohi who also provided some of the code.
btcsuite_btcd
train
go
6ece9e2a4ff66324b27b691c32e9890abdb2cb88
diff --git a/lxd/storage/storage.go b/lxd/storage/storage.go index <HASH>..<HASH> 100644 --- a/lxd/storage/storage.go +++ b/lxd/storage/storage.go @@ -184,7 +184,12 @@ func UsedBy(ctx context.Context, s *state.State, pool Pool, firstOnly bool, memb } // Get all buckets using the storage pool. - buckets, err := tx.GetStoragePoolBuckets(pool.ID(), memberSpecific) + poolID := pool.ID() + filters := []db.StorageBucketFilter{{ + PoolID: &poolID, + }} + + buckets, err := tx.GetStoragePoolBuckets(memberSpecific, filters...) if err != nil { return fmt.Errorf("Failed loading storage buckets: %w", err) }
lxd/storage/storage: tx.GetStoragePoolBuckets usage
lxc_lxd
train
go
a9ac017cdf642cd6310cc3c02a6dc2ed2e7151bc
diff --git a/salt/pillar/varstack_pillar.py b/salt/pillar/varstack_pillar.py index <HASH>..<HASH> 100644 --- a/salt/pillar/varstack_pillar.py +++ b/salt/pillar/varstack_pillar.py @@ -22,8 +22,6 @@ __virtualname__ = 'varstack' def __virtual__(): if not HAS_VARSTACK: - log.error('Varstack ext_pillar is enabled in configuration but ' - 'could not be loaded because Varstack is not installed.') return False return __virtualname__
Don't log in __virtual__
saltstack_salt
train
py
69e4813db94a6a73666f3e821712388e629b5e0b
diff --git a/src/parsers/ini.js b/src/parsers/ini.js index <HASH>..<HASH> 100644 --- a/src/parsers/ini.js +++ b/src/parsers/ini.js @@ -157,7 +157,7 @@ module.exports = (function() { * @private */ function _isComment(line) { - return !line || regex.comment.test(line); + return regex.comment.test(line || ''); } /** @@ -165,11 +165,11 @@ module.exports = (function() { * * @method _getNewSection * @param [line] {String} The line to check. - * @returns {Boolean} + * @returns {String} The section name, if found. * @private */ function _getNewSection(line) { - var result = new RegExp(regex.section).exec(line); + var result = new RegExp(regex.section).exec(line || ''); return result && result[1]; } @@ -182,8 +182,8 @@ module.exports = (function() { * @private */ function _isNotValidIni(line) { - var check = line.match(regex.bad); - return check && check.length > 1; + var check = (line || '').match(regex.bad); + return !!(check && check.length > 1); } return Parser;
Correct documentation for private function and make all private functions safer to use
Skelware_node-file-parser
train
js
8ff2cf662d65ca7b2120e9288fd5dd7b1e857ca4
diff --git a/spikeextractors/extractors/yassextractors/yassextractors.py b/spikeextractors/extractors/yassextractors/yassextractors.py index <HASH>..<HASH> 100644 --- a/spikeextractors/extractors/yassextractors/yassextractors.py +++ b/spikeextractors/extractors/yassextractors/yassextractors.py @@ -19,7 +19,7 @@ class YassSortingExtractor(SortingExtractor): has_default_locations = False is_writable = False - installation_mesg = "YASS NOT INSTALLED" # error message when not installed + installation_mesg = "To use the Yass extractor, install pyyaml: \n\n pip install pyyaml\n\n" # error message when not installed def __init__(self, folder_path):
Update spikeextractors/extractors/yassextractors/yassextractors.py
SpikeInterface_spikeextractors
train
py
20a527db3fd420028d62d6e6da2db9601e920d89
diff --git a/test/test_pkcs11_crypt.rb b/test/test_pkcs11_crypt.rb index <HASH>..<HASH> 100644 --- a/test/test_pkcs11_crypt.rb +++ b/test/test_pkcs11_crypt.rb @@ -3,7 +3,7 @@ require "pkcs11" require "test/helper" require "openssl" -class TestPkcs11Session < Test::Unit::TestCase +class TestPkcs11Crypt < Test::Unit::TestCase attr_reader :slots attr_reader :slot attr_reader :session
bugfix: cypto-test class name doesn't match file name
larskanis_pkcs11
train
rb
807b4f560f36a0380d54b03c79c6eaaf45287c73
diff --git a/javascript/node/selenium-webdriver/lib/webdriver.js b/javascript/node/selenium-webdriver/lib/webdriver.js index <HASH>..<HASH> 100644 --- a/javascript/node/selenium-webdriver/lib/webdriver.js +++ b/javascript/node/selenium-webdriver/lib/webdriver.js @@ -989,7 +989,7 @@ class WebDriver { * @private */ findElementInternal_(locatorFn, context) { - return this.call(() => locatorFn(context)).then(function(result) { + return Promise.resolve(locatorFn(context)).then(function(result) { if (Array.isArray(result)) { result = result[0]; } @@ -1029,7 +1029,7 @@ class WebDriver { * @private */ findElementsInternal_(locatorFn, context) { - return this.call(() => locatorFn(context)).then(function(result) { + return Promise.resolve(locatorFn(context)).then(function(result) { if (result instanceof WebElement) { return [result]; }
[js] cleanup from bad rebase
SeleniumHQ_selenium
train
js
b9febbc28366cb19e45f0f1914373f46f0356663
diff --git a/glances/plugins/glances_raid.py b/glances/plugins/glances_raid.py index <HASH>..<HASH> 100644 --- a/glances/plugins/glances_raid.py +++ b/glances/plugins/glances_raid.py @@ -61,8 +61,7 @@ class Plugin(GlancesPlugin): if self.get_input() == 'local': # Update stats using the PyMDstat lib (https://github.com/nicolargo/pymdstat) try: - # !!! Path ONLY for dev - mds = MdStat('/home/nicolargo/dev/pymdstat/tests/mdstat.04') + mds = MdStat() self.stats = mds.get_stats()['arrays'] except Exception as e: logger.debug("Can not grab RAID stats (%s)" % e)
RAID plugin ok for beta testing
nicolargo_glances
train
py
ce3a29e5df5c2881a72d32f5af4c57e37fc28b93
diff --git a/molgenis-core-ui/src/main/resources/js/component/Questionnaire.js b/molgenis-core-ui/src/main/resources/js/component/Questionnaire.js index <HASH>..<HASH> 100644 --- a/molgenis-core-ui/src/main/resources/js/component/Questionnaire.js +++ b/molgenis-core-ui/src/main/resources/js/component/Questionnaire.js @@ -39,6 +39,7 @@ modal: false, enableOptionalFilter: false, saveOnBlur: true, + enableFormIndex: true, beforeSubmit: this._handleBeforeSubmit, onValueChange: this._handleValueChange }, SubmitButton);
Show index by default for Questionnaires
molgenis_molgenis
train
js
76dc48cb6a71255130980a1bc163c754bc0ad064
diff --git a/mod/assign/feedback/comments/locallib.php b/mod/assign/feedback/comments/locallib.php index <HASH>..<HASH> 100644 --- a/mod/assign/feedback/comments/locallib.php +++ b/mod/assign/feedback/comments/locallib.php @@ -204,7 +204,7 @@ class assign_feedback_comments extends assign_feedback_plugin { * @return void */ public function get_settings(MoodleQuickForm $mform) { - $default = get_config('assignfeedback_comments', 'inline'); + $default = $this->get_config('commentinline'); $mform->addElement('selectyesno', 'assignfeedback_comments_commentinline', get_string('commentinline', 'assignfeedback_comments'));
MDL-<I> Assign: Set up the commentinline form element properly.
moodle_moodle
train
php
f8b2c5eb571e46d99b88dab8498408b35f892f11
diff --git a/pkg/chartutil/create.go b/pkg/chartutil/create.go index <HASH>..<HASH> 100644 --- a/pkg/chartutil/create.go +++ b/pkg/chartutil/create.go @@ -195,7 +195,7 @@ const defaultNotes = `1. Get the application URL by running these commands: {{- else if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT/login + echo http://$NODE_IP:$NODE_PORT {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. You can watch the status of by running 'kubectl get svc -w {{ template "fullname" . }}'
fix(create): incorrect URL in default NOTES.txt
helm_helm
train
go
f36e755df45b4abdde85683e5c4e1b4d09660c73
diff --git a/backtrader/resamplerfilter.py b/backtrader/resamplerfilter.py index <HASH>..<HASH> 100644 --- a/backtrader/resamplerfilter.py +++ b/backtrader/resamplerfilter.py @@ -162,8 +162,8 @@ class _BaseResampler(with_metaclass(metabase.MetaParams, object)): return point def _barover_subdays(self, data): - # Put session end in context of current datetime - sessend = data.datetime.tm2dtime(data.sessionend) + # Put session end in context of last bar datetime + sessend = int(self.bar.datetime) + data.sessionend if data.datetime[0] > sessend: # Next session is on (defaults to next day)
Fixes #<I> by correctly calculating when the current session ends for the last bar (when next session data is already in)
backtrader_backtrader
train
py
bd4249b1f98cfec921f5c4628ac0cb28b7c56a5a
diff --git a/src/DI/ServiceManager.php b/src/DI/ServiceManager.php index <HASH>..<HASH> 100644 --- a/src/DI/ServiceManager.php +++ b/src/DI/ServiceManager.php @@ -27,11 +27,24 @@ class ServiceManager implements \Phalcon\DI\InjectionAwareInterface { use InjectionAwareTrait; + /** + * Alias for getService. + * + * @param $name + * @return object + */ public function get($name) { return $this->getService($name); } + /** + * Try to register and return service. + * + * @param $name + * @return object + * @throws Service\Exception + */ public function getService($name) { try { @@ -43,7 +56,34 @@ class ServiceManager implements \Phalcon\DI\InjectionAwareInterface throw new Exception($ex->getMessage().', using: '.$name); } } - + + /** + * Alias for hasService. + * + * @param $name + * @return bool + */ + public function has($name) + { + return $this->hasService($name); + } + + /** + * Try to register service and return information about service existence. + * + * @param $name + * @return bool + */ + public function hasService($name) + { + try { + $service = $this->getService($name); + return !empty($service); + } catch (\Phalcon\DI\Exception $ex) { + return false; + } + } + private function isRegisteredService($name) { if ($this->di->has($name)) {
added has & hasService method to serviceManager
vegas-cmf_core
train
php
fc1797f12caca337367f9f966933afd2f09ae4ae
diff --git a/keyring/backends/SecretService.py b/keyring/backends/SecretService.py index <HASH>..<HASH> 100644 --- a/keyring/backends/SecretService.py +++ b/keyring/backends/SecretService.py @@ -53,12 +53,23 @@ class Keyring(KeyringBackend): {"username": username, "service": service}) _, session = secret_service.OpenSession("plain", "") no_longer_locked, prompt = secret_service.Unlock(locked) - assert prompt == "/" + self._check_prompt(prompt) secrets = secret_service.GetSecrets(unlocked + locked, session, byte_arrays=True) for item_path, secret in secrets.iteritems(): return unicode(secret[2]) + def _check_prompt(self, prompt): + """ + Ensure we support the supplied prompt value. + + from http://standards.freedesktop.org/secret-service/re01.html: + Prompt is a prompt object which can be used to unlock the remaining + objects, or the special value '/' when no prompt is necessary. + """ + if not prompt == '/': + raise ValueError("Keyring does not support prompts") + @property def collection(self): import dbus
Documented the unsupported prompt values.
jaraco_keyring
train
py
af2719c08c5b991255db491462fc3846ab035d16
diff --git a/args4j/src/org/kohsuke/args4j/spi/ArrayFieldSetter.java b/args4j/src/org/kohsuke/args4j/spi/ArrayFieldSetter.java index <HASH>..<HASH> 100644 --- a/args4j/src/org/kohsuke/args4j/spi/ArrayFieldSetter.java +++ b/args4j/src/org/kohsuke/args4j/spi/ArrayFieldSetter.java @@ -101,7 +101,7 @@ final class ArrayFieldSetter implements Getter, Setter { f.set(bean, ary); } - public Object getValue() throws CmdLineException { + public Object getValue() { f.setAccessible(true); try { return f.get(bean);
Unnecessary exception declaration
kohsuke_args4j
train
java
578fa55db4fff2a683bbc21279387056b9fdabbd
diff --git a/config/auth.php b/config/auth.php index <HASH>..<HASH> 100644 --- a/config/auth.php +++ b/config/auth.php @@ -126,8 +126,11 @@ return [ |-------------------------------------------------------------------------- | | The login form is created independently of the admin template. It's just something - | on its own. The default view folder is "views/admin/login/admin_login_view_folder/". The default - | assets folder is "public/admin/login/admin_login_view_folder/" + | on its own. The default "root" view folder is: + | public/packages/usermanagement/admin/logout/ + | + | FYI: The default "root" admin view folder is: + | public/packages/lasallecmsadmin/ | */ //'admin_login_view_folder' => 'default',
Correct error in config file's comments. #<I>
lasallecms_lasallecms-l5-usermanagement-pkg
train
php
0dcc5e67aacbabc65f71c50f49707726d1466e5e
diff --git a/tests/example/BundleRoutingTest.php b/tests/example/BundleRoutingTest.php index <HASH>..<HASH> 100644 --- a/tests/example/BundleRoutingTest.php +++ b/tests/example/BundleRoutingTest.php @@ -12,7 +12,6 @@ namespace Sensio\Bundle\GeneratorBundle\Manipulator; use Gnugat\Redaktilo\EditorFactory; -use Symfony\Component\Filesystem\Exception\IOException; use Symfony\Component\Filesystem\Filesystem as SymfonyFilesystem; class RoutingManipulator extends \PHPUnit_Framework_TestCase @@ -30,10 +29,8 @@ class RoutingManipulator extends \PHPUnit_Framework_TestCase $copyFilename = sprintf(self::CONFIG, $rootPath, 'copies'); $expectationFilename = sprintf(self::CONFIG, $rootPath, 'expectations'); - $symfonyFilesystem = new SymfonyFilesystem(); - if ($symfonyFilesystem->exists($copyFilename)) { - $symfonyFilesystem->remove($copyFilename); - } + $fileCopier = new SymfonyFilesystem(); + $fileCopier->copy($sourceFilename, $copyFilename, true); $this->configPath = $copyFilename; $this->expectedConfigPath = $expectationFilename;
Made use case BundleRoutingTest similar to others tests
gnugat_redaktilo
train
php
43b0b17d9a934f22a9a89de4cbd9c3fd97db1877
diff --git a/core/commands/pubsub.go b/core/commands/pubsub.go index <HASH>..<HASH> 100644 --- a/core/commands/pubsub.go +++ b/core/commands/pubsub.go @@ -52,6 +52,18 @@ to be used in a production environment. To use, the daemon must be run with '--enable-pubsub-experiment'. `, + LongDescription: ` +ipfs pubsub sub subscribes to messages on a given topic. + +This is an experimental feature. It is not intended in its current state +to be used in a production environment. + +To use, the daemon must be run with '--enable-pubsub-experiment'. + +This command outputs data in the following encodings: + * "json" +(Specified by the "--encoding" or "--enc" flag) +`, }, Arguments: []cmds.Argument{ cmds.StringArg("topic", true, false, "String name of topic to subscribe to."),
Turns out, the Message will Marshal properly. License: MIT
ipfs_go-ipfs
train
go
6e831c74398d105cda7b48131150fbbd3f79c3c6
diff --git a/capture/noworkflow/now/persistence/models/trial_dot.py b/capture/noworkflow/now/persistence/models/trial_dot.py index <HASH>..<HASH> 100644 --- a/capture/noworkflow/now/persistence/models/trial_dot.py +++ b/capture/noworkflow/now/persistence/models/trial_dot.py @@ -74,7 +74,7 @@ class TrialDot(Model): self.synonyms = {} self.departing_arrows = {} self.arriving_arrows = {} - self.variables = {v.id: v for v in self.trial.variables} + self.variables = {} def _add_variable(self, variable, depth, config): """Create variable for graph @@ -415,6 +415,7 @@ class TrialDot(Model): self.synonyms = {} self.departing_arrows = defaultdict(dict) self.arriving_arrows = defaultdict(dict) + self.variables = {v.id: v for v in self.trial.variables} def export_text(self): """Export facts from trial as text"""
Fix performance issues with now list and now history
gems-uff_noworkflow
train
py
274c6ab9a32722c08ec464dc2535b446ed28eed4
diff --git a/src/Engine/SocketIO/Version1X.php b/src/Engine/SocketIO/Version1X.php index <HASH>..<HASH> 100644 --- a/src/Engine/SocketIO/Version1X.php +++ b/src/Engine/SocketIO/Version1X.php @@ -136,9 +136,12 @@ class Version1X extends AbstractSocketIO if (isset($this->url['query'])) { $query = array_replace($query, $this->url['query']); } + + $context = $this->options['context']; + $context['http'] = ['timeout' => (float) $this->options['timeout']]; $url = sprintf('%s://%s:%d/%s/?%s', $this->url['scheme'], $this->url['host'], $this->url['port'], trim($this->url['path'], '/'), http_build_query($query)); - $result = @file_get_contents($url, false, stream_context_create(['http' => ['timeout' => (float) $this->options['timeout']]])); + $result = @file_get_contents($url, false, stream_context_create($context)); if (false === $result) { throw new ServerConnectionFailureException;
Fix SSL handshake to allow self-signed certificates
Wisembly_elephant.io
train
php
f2fd719e8ee140d9dd748866dd49696b01c92360
diff --git a/lib/nodefs-handler.js b/lib/nodefs-handler.js index <HASH>..<HASH> 100644 --- a/lib/nodefs-handler.js +++ b/lib/nodefs-handler.js @@ -357,7 +357,7 @@ _handleFile(file, stats, initialAdd) { // kick off the watcher const closer = this._watchWithNodeFs(file, async (path, newStats) => { if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return; - if (!newStats || newStats && newStats.mtimeMs === 0) { + if (!newStats || newStats.mtimeMs === 0) { try { const newStats = await stat(file); if (this.fsw.closed) return;
nodefs-handler.js: fix variable always evaluating to true.
paulmillr_chokidar
train
js
47c1110166d3f472e6acabc1fe2224428a840144
diff --git a/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php b/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php index <HASH>..<HASH> 100644 --- a/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php +++ b/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php @@ -304,13 +304,13 @@ class StubIntlDateFormatterTest extends \PHPUnit_Framework_TestCase */ public function testGetCalendar() { - $formatter = new StubIntlDateFormatter('en'); + $formatter = new StubIntlDateFormatter('en', StubIntlDateFormatter::FULL, StubIntlDateFormatter::NONE); $formatter->setCalendar(StubIntlDateFormatter::GREGORIAN); } public function testSetCalendar() { - $formatter = new StubIntlDateFormatter('en'); + $formatter = new StubIntlDateFormatter('en', StubIntlDateFormatter::FULL, StubIntlDateFormatter::NONE); $this->assertEquals(StubIntlDateFormatter::GREGORIAN, $formatter->getCalendar()); } }
[Locale] Fixed two tests
symfony_symfony
train
php