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
|
---|---|---|---|---|---|
65316ef59d251d116c14fcb30d245d347d08bbfb | diff --git a/lib/requester/requester.rb b/lib/requester/requester.rb
index <HASH>..<HASH> 100644
--- a/lib/requester/requester.rb
+++ b/lib/requester/requester.rb
@@ -40,7 +40,7 @@ module Testbot::Requester
end
rsync_ignores = config.rsync_ignores.to_s.split.map { |pattern| "--exclude='#{pattern}'" }.join(' ')
- system "rsync -az --delete -e ssh #{rsync_ignores} . #{rsync_uri}"
+ system "rsync -az --delete --delete-excluded -e ssh #{rsync_ignores} . #{rsync_uri}"
files = adapter.test_files(dir)
sizes = adapter.get_sizes(files)
diff --git a/lib/runner/runner.rb b/lib/runner/runner.rb
index <HASH>..<HASH> 100644
--- a/lib/runner/runner.rb
+++ b/lib/runner/runner.rb
@@ -123,7 +123,7 @@ module Testbot::Runner
end
def fetch_code(job)
- system "rsync -az --delete -e ssh #{job.root}/ #{job.project}"
+ system "rsync -az --delete --delete-excluded -e ssh #{job.root}/ #{job.project}"
end
def before_run(job) | Delete excluded files when syncing | joakimk_testbot | train | rb,rb |
9452f9a2778e13df3d33aaa517da9fa3078c2c75 | diff --git a/frog/static/j/libs/frog.viewer.js b/frog/static/j/libs/frog.viewer.js
index <HASH>..<HASH> 100644
--- a/frog/static/j/libs/frog.viewer.js
+++ b/frog/static/j/libs/frog.viewer.js
@@ -328,7 +328,12 @@ Frog.Viewer = new Class({
this.countLabel.set('text', id + '/' + images.length);
var data = Frog.util.hashData();
- data.viewer = this.objects.slice(0, this.LIMIT).map(function(item) { return item.guid; });
+ if (images.length > this.LIMIT) {
+ data.viewer = [images[id].guid];
+ }
+ else {
+ data.viewer = this.objects.map(function(item) { return item.guid; });
+ }
location.hash = JSON.stringify(data);
},
setIndex: function(idx) { | Fixed a bug that would generate urls too long to parse | theiviaxx_Frog | train | js |
a13cf549b93c4198ae42983f472de55f26069195 | diff --git a/lib/predictor/base.rb b/lib/predictor/base.rb
index <HASH>..<HASH> 100644
--- a/lib/predictor/base.rb
+++ b/lib/predictor/base.rb
@@ -75,7 +75,7 @@ module Predictor::Base
end
end
- def respond_to?(method)
+ def respond_to?(method, include_all = false)
input_matrices.has_key?(method) ? true : super
end | make respond_to compatible with Ruby 2.x | Pathgather_predictor | train | rb |
747e26ccc0a83aa82a7cb3fa4606f64f6cbc83b1 | diff --git a/lib/rocket_pants/railtie.rb b/lib/rocket_pants/railtie.rb
index <HASH>..<HASH> 100644
--- a/lib/rocket_pants/railtie.rb
+++ b/lib/rocket_pants/railtie.rb
@@ -2,7 +2,7 @@ module RocketPants
class Railtie < Rails::Railtie
config.rocket_pants = ActiveSupport::OrderedOptions.new
- config.rocket_pants.use_caching
+ config.rocket_pants.use_caching = nil
config.i18n.railties_load_path << File.expand_path('../locale/en.yml', __FILE__)
@@ -25,8 +25,8 @@ module RocketPants
initializer "rocket_pants.setup_caching" do |app|
rp_config = app.config.rocket_pants
rp_config.use_caching = Rails.env.production? if rp_config.use_caching.nil?
- if app.config.rocket_pants.use_caching
- RocketPants.caching_enabled = app.config.rocket_pants.use_caching
+ RocketPants.caching_enabled = rp_config.use_caching
+ if RocketPants.caching_enabled?
app.middleware.insert 'Rack::Runtime', RocketPants::CacheMiddleware
end
end | Enable the caching setup in the railtie | Sutto_rocket_pants | train | rb |
6b8c635e2ccbb6d7d758b319bb16aea588cb4aed | diff --git a/test/index.js b/test/index.js
index <HASH>..<HASH> 100644
--- a/test/index.js
+++ b/test/index.js
@@ -65,6 +65,7 @@ testEncodeDecode(1)
testEncodeDecode(-1)
testEncodeDecode(-100)
testEncodeDecode(123.456)
+testEncodeDecode(2200000000)
testEncodeDecode(-123.456)
testEncodeDecode(true)
testEncodeDecode(false) | test encode/decode a non-int<I> large int | dominictarr_bipf | train | js |
3952a7c485d420b9df35118ce6202a15b15c7e5f | diff --git a/rapidoid-commons/src/main/java/org/rapidoid/commons/AnyObj.java b/rapidoid-commons/src/main/java/org/rapidoid/commons/AnyObj.java
index <HASH>..<HASH> 100644
--- a/rapidoid-commons/src/main/java/org/rapidoid/commons/AnyObj.java
+++ b/rapidoid-commons/src/main/java/org/rapidoid/commons/AnyObj.java
@@ -37,9 +37,14 @@ public class AnyObj extends RapidoidThing {
if (arrOrColl instanceof Object[]) {
Object[] arr = (Object[]) arrOrColl;
return Arr.indexOf(arr, value) >= 0;
+
} else if (arrOrColl instanceof Collection<?>) {
Collection<?> coll = (Collection<?>) arrOrColl;
return coll.contains(value);
+
+ } else if (arrOrColl == null) {
+ return false;
+
} else {
throw Err.illegalArg("Expected array or collection, but found: %s", U.str(arrOrColl));
} | Fixed NPE when no value for multi-value input field is provided. | rapidoid_rapidoid | train | java |
8756dd75b257b17ddda92674d4cc0db307d2153b | diff --git a/activerecord/lib/active_record/calculations.rb b/activerecord/lib/active_record/calculations.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/calculations.rb
+++ b/activerecord/lib/active_record/calculations.rb
@@ -260,7 +260,14 @@ module ActiveRecord
# column_alias_for("count(*)") # => "count_all"
# column_alias_for("count", "id") # => "count_id"
def column_alias_for(*keys)
- connection.table_alias_for(keys.join(' ').downcase.gsub(/\*/, 'all').gsub(/\W+/, ' ').strip.gsub(/ +/, '_'))
+ table_name = keys.join(' ')
+ table_name.downcase!
+ table_name.gsub!(/\*/, 'all')
+ table_name.gsub!(/\W+/, ' ')
+ table_name.strip!
+ table_name.gsub!(/ +/, '_')
+
+ connection.table_alias_for(table_name)
end
def column_for(field) | Performance: reduce garbage created by ActiveRecord::Calculations#column_alias_for | rails_rails | train | rb |
705bd670b1099f8504ae0baa3b004eea189e9009 | diff --git a/pyhocon/config_parser.py b/pyhocon/config_parser.py
index <HASH>..<HASH> 100644
--- a/pyhocon/config_parser.py
+++ b/pyhocon/config_parser.py
@@ -250,9 +250,9 @@ class ConfigParser(object):
period_value = int(tokens.value)
period_identifier = tokens.unit
- period_unit = [single_unit for single_unit, values
- in get_supported_period_type_map().items()
- if period_identifier in values][0]
+ period_unit = next((single_unit for single_unit, values
+ in get_supported_period_type_map().items()
+ if period_identifier in values))
return period(period_value, period_unit) | use next instead of [0] when finding relevant period unit | chimpler_pyhocon | train | py |
a9f2937ef6ca0f5bab971bb78cc550bbd78f6c9f | diff --git a/src/Core/functions.php b/src/Core/functions.php
index <HASH>..<HASH> 100644
--- a/src/Core/functions.php
+++ b/src/Core/functions.php
@@ -23,7 +23,8 @@ if (!function_exists('h')) {
* Arrays will be mapped and have all their elements escaped. Objects will be string cast if they
* implement a `__toString` method. Otherwise the class name will be used.
* @param bool $double Encode existing html entities
- * @param string $charset Character set to use when escaping. Defaults to config value in 'App.encoding' or 'UTF-8'
+ * @param string $charset Character set to use when escaping. Defaults to config value in `mb_internal_encoding()`
+ * or 'UTF-8'
* @return string Wrapped text
* @link http://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#h
*/ | Removing reference to App.encoding | cakephp_cakephp | train | php |
1e6ba45db408729410de8a84c11a4eb0376d363d | diff --git a/salt/states/snapper.py b/salt/states/snapper.py
index <HASH>..<HASH> 100644
--- a/salt/states/snapper.py
+++ b/salt/states/snapper.py
@@ -180,7 +180,7 @@ def baseline_snapshot(name, number=None, tag=None, include_diff=True, config='ro
number = snapshot['id']
status = __salt__['snapper.status'](
- config, num_pre=number, num_post=0)
+ config, num_pre=0, num_post=number)
for target in ignore:
if os.path.isfile(target): | Fixes pre/post snapshot order to get the inverse status | saltstack_salt | train | py |
0455b960adcfacb93011f6db2db89a61cda83580 | diff --git a/core2/main.go b/core2/main.go
index <HASH>..<HASH> 100644
--- a/core2/main.go
+++ b/core2/main.go
@@ -288,6 +288,13 @@ func (c *Core) ScheduleAgentStatusCheckTasks(f *db.AgentFilter) {
log.Errorf("error scheduling status check of agent %s: %s", agent.Name, err)
continue
}
+ if agent.Status == "pending" {
+ agent.Status = "checking"
+ if err := c.db.UpdateAgent(agent); err != nil {
+ log.Errorf("error update agent '%s' status to 'checking': %s", err)
+ continue
+ }
+ }
}
} | Don't constantly re-check in-flight agents
Previously, pending agents were checked multiple times while they were
still pending, because of a loophole in scheduling. Now, once a pending
agent has been scheduled for a status check, it changes its status to
'checking', exempting it from a subsequent "immediate" check.
This cuts down on CPU usage, as one would expect. | starkandwayne_shield | train | go |
0052820aaa383167e7bc571f908e7238973d8182 | diff --git a/isambard_dev/ampal/non_canonical.py b/isambard_dev/ampal/non_canonical.py
index <HASH>..<HASH> 100644
--- a/isambard_dev/ampal/non_canonical.py
+++ b/isambard_dev/ampal/non_canonical.py
@@ -32,9 +32,9 @@ def convert_pro_to_hyp(pro):
to_remove.append(label)
for label in to_remove:
del pro.atoms[label]
- for k, v in hyp_ref.atoms.items():
- if k not in pro.atoms.keys():
- pro.atoms[k] = v
+ for key, val in hyp_ref.atoms.items():
+ if key not in pro.atoms.keys():
+ pro.atoms[key] = val
pro.mol_code = 'HYP'
pro.mol_letter = 'X'
pro.is_hetero = True | Renamed k and v to key and value. | woolfson-group_isambard | train | py |
4631b0cad4a2208ef156a21c1d0056bce4ada1d0 | diff --git a/model-test/src/main/java/org/jboss/as/model/test/FailedOperationTransformationConfig.java b/model-test/src/main/java/org/jboss/as/model/test/FailedOperationTransformationConfig.java
index <HASH>..<HASH> 100644
--- a/model-test/src/main/java/org/jboss/as/model/test/FailedOperationTransformationConfig.java
+++ b/model-test/src/main/java/org/jboss/as/model/test/FailedOperationTransformationConfig.java
@@ -380,7 +380,10 @@ public class FailedOperationTransformationConfig {
@Override
public boolean expectFailedWriteAttributeOperation(ModelNode operation) {
String name = operation.get(NAME).asString();
- return !noWriteFailureAttributes.contains(name) && hasExpressions(name, operation.clone().get(VALUE));
+ if (attributes.contains(name)) {
+ return !noWriteFailureAttributes.contains(name) && hasExpressions(name, operation.clone().get(VALUE));
+ }
+ return false;
}
boolean hasExpressions(String attrName, ModelNode attribute) { | messaging: fix resource transformation
* add resource transformation for UNDEFINE op to
discard new attributes
* do not discard new attributes when calling write-operation. Instead
fail the operation if its outcome is != IGNORED
* fix FailedOperationTransformationConfig to ensure the attribute
we check is handled by this config object
was: <I>f<I>e<I>b<I>f<I>bd<I>b<I>a | wildfly_wildfly-core | train | java |
213c48667294302e6c061227a9076c5e54fba5e8 | diff --git a/test/test_service.py b/test/test_service.py
index <HASH>..<HASH> 100644
--- a/test/test_service.py
+++ b/test/test_service.py
@@ -185,8 +185,7 @@ def start(service):
"""
Start a service and wait until it's running.
"""
- service.start()
- time.sleep(DELAY)
+ ok(service.start(block=DELAY))
assert_running()
return service | Do more checks when starting services during tests | torfsen_service | train | py |
13b0869c3ad03eb9a08562b79cbe0b5b861de0b3 | diff --git a/salt/states/file.py b/salt/states/file.py
index <HASH>..<HASH> 100644
--- a/salt/states/file.py
+++ b/salt/states/file.py
@@ -3615,8 +3615,8 @@ def serialize(name,
# TODO remove json round-trip when all dataset will use
# utils.serializers
contents = pprint.pformat(
- json.json.loads(
- json.json.dumps(dataset),
+ json.loads(
+ json.dumps(dataset),
object_hook=salt.utils.decode_dict
)
) | Json is not going through serializers anymore. Refs #<I> | saltstack_salt | train | py |
86c4083c0fce0f965b414a002a839141b93b90ae | diff --git a/src/main/java/pro/zackpollard/telegrambot/api/keyboards/ReplyKeyboardRemove.java b/src/main/java/pro/zackpollard/telegrambot/api/keyboards/ReplyKeyboardRemove.java
index <HASH>..<HASH> 100644
--- a/src/main/java/pro/zackpollard/telegrambot/api/keyboards/ReplyKeyboardRemove.java
+++ b/src/main/java/pro/zackpollard/telegrambot/api/keyboards/ReplyKeyboardRemove.java
@@ -55,11 +55,11 @@ public class ReplyKeyboardRemove implements Keyboard {
*/
@Override
public ReplyMarkupType getType() {
- return ReplyMarkupType.KEYBOARD_HIDE;
+ return ReplyMarkupType.KEYBOARD_REMOVE;
}
@ToString
- private static class ReplyKeyboardRemoveBuilder {
+ public static class ReplyKeyboardRemoveBuilder {
private boolean selective = false; | Fixed ReplyKeyboardRemove (#<I>) | zackpollard_JavaTelegramBot-API | train | java |
5dea0fda51fe0cc7ce1e2fdb17f2dabe16b7213f | diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go
index <HASH>..<HASH> 100644
--- a/pkg/setting/setting.go
+++ b/pkg/setting/setting.go
@@ -359,12 +359,12 @@ func loadConfiguration(args *CommandLineArgs) {
configFiles = append(configFiles, defaultConfigFile)
Cfg, err = ini.Load(defaultConfigFile)
- Cfg.BlockMode = false
-
if err != nil {
log.Fatal(3, "Failed to parse defaults.ini, %v", err)
}
+ Cfg.BlockMode = false
+
// command line props
commandLineProps := getCommandLineProperties(args.Args)
// load default overrides | fix(settings): remove nil pointer exception | grafana_grafana | train | go |
fd84fb83e310a2d3a9b7cb36246c7423c495e637 | diff --git a/src/core/mixins/source.js b/src/core/mixins/source.js
index <HASH>..<HASH> 100644
--- a/src/core/mixins/source.js
+++ b/src/core/mixins/source.js
@@ -52,7 +52,7 @@ module.exports = mixin((superclass) => class Source extends mix(superclass).with
}
get fullPath(){
- return Path.resolve(this.get('path'));
+ return this.get('path') ? Path.resolve(this.get('path')) : null;
}
get relPath() { | Fix fullpath bug when no component directory is specified | frctl_fractal | train | js |
4c5aaaca21bcd8f04607ee08bfa8c403a4123bc5 | diff --git a/closure/goog/labs/structs/map_test.js b/closure/goog/labs/structs/map_test.js
index <HASH>..<HASH> 100644
--- a/closure/goog/labs/structs/map_test.js
+++ b/closure/goog/labs/structs/map_test.js
@@ -422,6 +422,11 @@ function testMapWithModifiedObjectPrototype() {
}
+/**
+ * @param {T} entry
+ * @param {!Array<T>} entryList
+ * @template T
+ */
function assertContainsEntry(entry, entryList) {
for (var i = 0; i < entryList.length; ++i) {
if (entry[0] == entryList[i][0] && entry[1] === entryList[i][1]) {
diff --git a/closure/goog/labs/structs/multimap_test.js b/closure/goog/labs/structs/multimap_test.js
index <HASH>..<HASH> 100644
--- a/closure/goog/labs/structs/multimap_test.js
+++ b/closure/goog/labs/structs/multimap_test.js
@@ -328,6 +328,11 @@ function testClear() {
}
+/**
+ * @param {T} entry
+ * @param {!Array<T>} entryList
+ * @template T
+ */
function assertContainsEntry(entry, entryList) {
for (var i = 0; i < entryList.length; ++i) {
if (entry[0] == entryList[i][0] && entry[1] === entryList[i][1]) { | Fix some lint warnings in goog.labs.structs
RELNOTES: none
-------------
Created by MOE: <URL> | google_closure-library | train | js,js |
a935b0b74763058e49bd10af7622d2f640832406 | diff --git a/Pygling/Platform/Unix.py b/Pygling/Platform/Unix.py
index <HASH>..<HASH> 100644
--- a/Pygling/Platform/Unix.py
+++ b/Pygling/Platform/Unix.py
@@ -42,7 +42,7 @@ class Unix(Platform):
# library_file_names
def library_file_names(self, name):
- return ['lib' + name + '.a', 'lib' + name + '.dylib']
+ return ['lib' + name + '.a', 'lib' + name + '.dylib', 'lib' + name + '.so']
# header_file_names
def header_file_names(self, name, filename): | Added so as library file extension for *nix | dmsovetov_pygling | train | py |
22a451e33e90b0c719b50a7ffefcd2ea2cf82f9c | diff --git a/test/test_ttlser.py b/test/test_ttlser.py
index <HASH>..<HASH> 100644
--- a/test/test_ttlser.py
+++ b/test/test_ttlser.py
@@ -32,14 +32,14 @@ class TestTtlser(unittest.TestCase):
goodpath = 'test/good.ttl'
self.badpath = 'test/nasty.ttl'
- actualpath = 'test/actual.ttl'
+ self.actualpath = 'test/actual.ttl'
self.actualpath2 = 'test/actual2.ttl'
with open(goodpath, 'rb') as f:
self.good = f.read()
self.actual = self.serialize()
- with open(actualpath, 'wb') as f:
+ with open(self.actualpath, 'wb') as f:
f.write(self.actual)
def make_ser(self):
@@ -84,9 +84,17 @@ class TestTtlser(unittest.TestCase):
actual2 = out
if self.actual != actual2:
print('Determinism failure!')
+ hit = False
+ for _1, _2 in zip(self.actual.decode(), actual2.decode()):
+ if _1 != _2 and not hit:
+ hit = True
+ if hit:
+ print(_1, _2)
nofail = False
with open(self.actualpath2, 'wb') as f:
f.write(actual2)
+ with open(self.actualpath, 'wb') as f:
+ f.write(self.actual)
break
assert nofail | test_ttlser.py added checks to try to figure out why serialized outputs sometimes are not different | tgbugs_pyontutils | train | py |
621ea96f2f130805b00e0eccdb14618e7cd31de1 | diff --git a/tests/AuditingTestCase.php b/tests/AuditingTestCase.php
index <HASH>..<HASH> 100644
--- a/tests/AuditingTestCase.php
+++ b/tests/AuditingTestCase.php
@@ -21,7 +21,6 @@ use OwenIt\Auditing\Resolvers\IpAddressResolver;
use OwenIt\Auditing\Resolvers\UrlResolver;
use OwenIt\Auditing\Resolvers\UserAgentResolver;
use OwenIt\Auditing\Resolvers\UserResolver;
-use OwenIt\Auditing\Tests\Models\User;
class AuditingTestCase extends TestCase
{
@@ -39,7 +38,11 @@ class AuditingTestCase extends TestCase
]);
// Audit
- $app['config']->set('audit.user.model', User::class);
+ $app['config']->set('audit.user.morph_prefix', 'user');
+ $app['config']->set('audit.user.guards', [
+ 'web',
+ 'api',
+ ]);
$app['config']->set('audit.resolver.user', UserResolver::class);
$app['config']->set('audit.resolver.url', UrlResolver::class);
$app['config']->set('audit.resolver.ip_address', IpAddressResolver::class); | fix(Tests): env setup method | owen-it_laravel-auditing | train | php |
f62440a65ef1c87243ff7be832c55d9046d31d56 | diff --git a/pkg/cloudcfg/resource_printer.go b/pkg/cloudcfg/resource_printer.go
index <HASH>..<HASH> 100644
--- a/pkg/cloudcfg/resource_printer.go
+++ b/pkg/cloudcfg/resource_printer.go
@@ -44,7 +44,7 @@ func (i *IdentityPrinter) Print(data []byte, w io.Writer) error {
}
func (i *IdentityPrinter) PrintObj(obj interface{}, output io.Writer) error {
- data, err := api.EncodeIndent(obj)
+ data, err := api.Encode(obj)
if err != nil {
return err
} | Fix call to removed function EncodeIndent | kubernetes_kubernetes | train | go |
acffc67d65430a415f4fa24219a5c8136695e5e8 | diff --git a/lib/builderator/tasks/packer.rb b/lib/builderator/tasks/packer.rb
index <HASH>..<HASH> 100644
--- a/lib/builderator/tasks/packer.rb
+++ b/lib/builderator/tasks/packer.rb
@@ -1,5 +1,6 @@
require 'aws-sdk'
require 'thor'
+require 'retryable'
require_relative '../control/data'
require_relative '../interface/packer' | Retryable is requirable | rapid7_builderator | train | rb |
65a5c27eb4c1084be4750e9170412e0a650f88ec | diff --git a/config/doctrine.php b/config/doctrine.php
index <HASH>..<HASH> 100644
--- a/config/doctrine.php
+++ b/config/doctrine.php
@@ -12,7 +12,7 @@ return [
| paths setting to the appropriate path and replace App namespace
| by your own namespace.
|
- | Available meta drivers: annotations|yaml|xml|config|static_php
+ | Available meta drivers: fluent|annotations|yaml|xml|config|static_php
|
| Available connections: mysql|oracle|pgsql|sqlite|sqlsrv
| (Connections can be configured in the database config) | Add fluent to list of available mapping drivers | laravel-doctrine_orm | train | php |
9c3800ce9b82c7788cc052a00ecc79f076163e3c | diff --git a/internal/service/synthetics/retry.go b/internal/service/synthetics/retry.go
index <HASH>..<HASH> 100644
--- a/internal/service/synthetics/retry.go
+++ b/internal/service/synthetics/retry.go
@@ -28,17 +28,17 @@ func retryCreateCanary(conn *synthetics.Synthetics, d *schema.ResourceData, inpu
// delete canary because it is the only way to reprovision if in an error state
err = deleteCanary(conn, d.Id())
if err != nil {
- return output, err
+ return output, fmt.Errorf("error deleting Synthetics Canary on retry (%s): %w", d.Id(), err)
}
_, err = conn.CreateCanary(input)
if err != nil {
- return output, err
+ return output, fmt.Errorf("error creating Synthetics Canary on retry (%s): %w", d.Id(), err)
}
_, err = waitCanaryReady(conn, d.Id())
if err != nil {
- return output, err
+ return output, fmt.Errorf("error waiting on Synthetics Canary on retry (%s): %w", d.Id(), err)
}
}
} | r/aws_synthetics_canary: early return on error from failed retry | terraform-providers_terraform-provider-aws | train | go |
f1e04da86b1714a4e22f7cdbc2cc539e27be1126 | diff --git a/lib/rack/lti/middleware.rb b/lib/rack/lti/middleware.rb
index <HASH>..<HASH> 100644
--- a/lib/rack/lti/middleware.rb
+++ b/lib/rack/lti/middleware.rb
@@ -32,8 +32,7 @@ module Rack::LTI
private
def config_action(request, env)
- # TODO: remove this hard-coded URL.
- response = [@config.to_xml(launch_url: 'http://localhost:9393/lti/launch')]
+ response = [@config.to_xml(launch_url: request.url.sub(@config.config_path, @config.launch_path))]
[200, { 'Content-Type' => 'application/xml', 'Content-Length' => response[0].length.to_s }, response]
end | replace hard-coded launch_url with dynamic one. | instructure_rack-lti | train | rb |
f011be30118332e64c154c9fabdf0f3ca320aade | diff --git a/src/extensions/export/bootstrap-table-export.js b/src/extensions/export/bootstrap-table-export.js
index <HASH>..<HASH> 100644
--- a/src/extensions/export/bootstrap-table-export.js
+++ b/src/extensions/export/bootstrap-table-export.js
@@ -84,8 +84,11 @@
if (that.options.exportDataType === 'all' && that.options.pagination) {
that.togglePagination();
- doExport();
- that.togglePagination();
+ that.$el.on('load-success.bs.table', function () {
+ doExport();
+ that.$el.off('load-success.bs.table');
+ that.togglePagination();
+ });
} else if (that.options.exportDataType === 'selected') {
var data = that.getData(),
selectedData = that.getAllSelections(); | Update bootstrap-table-export.js
resolve export when data is loaded from server, see issue #<I> | wenzhixin_bootstrap-table | train | js |
60f360ee30d93da1951be3fd6392f21ea866ff52 | diff --git a/news-bundle/src/Resources/contao/News.php b/news-bundle/src/Resources/contao/News.php
index <HASH>..<HASH> 100644
--- a/news-bundle/src/Resources/contao/News.php
+++ b/news-bundle/src/Resources/contao/News.php
@@ -125,6 +125,11 @@ class News extends Frontend
->limit(1)
->execute($arrArchive['jumpTo']);
+ if ($objParent->numRows < 1)
+ {
+ return;
+ }
+
$objParent = $this->getPageDetails($objParent->id);
$strUrl = $this->generateFrontendUrl($objParent->row(), ($GLOBALS['TL_CONFIG']['useAutoItem'] ? '/%s' : '/items/%s'), $objParent->language); | [News] Do not generate news or calendar feeds if there is no target page (see #<I>) | contao_contao | train | php |
017a4a4be49085c0e3d174aec9e50c2ad0a29b7d | diff --git a/onedrive/api_v5.py b/onedrive/api_v5.py
index <HASH>..<HASH> 100644
--- a/onedrive/api_v5.py
+++ b/onedrive/api_v5.py
@@ -313,7 +313,8 @@ class OneDriveAPIWrapper(OneDriveAuth):
def _translate_api_flag(self, val, name=None, special_vals=None):
if special_vals and val in special_vals:
return val
- flag_val_dict = {None: None, False: 'false', 'true': 'true', True: 'true'}
+ flag_val_dict = {None: None, 'false': 'false',
+ False: 'false', 'true': 'true', True: 'true'}
try:
return flag_val_dict[val]
except KeyError:
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,7 @@ except IOError:
setup(
name='python-onedrive',
- version='14.10.3',
+ version='14.10.4',
author='Mike Kazantsev, Antonio Chen',
author_email='[email protected]',
license='WTFPL', | api: allow string-ish "false" as onedrive flag vals as well | mk-fg_python-onedrive | train | py,py |
46c7edcaf417f323e80b207004317a116be4b367 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -41,12 +41,14 @@ PACKAGE_INFO = dict(
license='Apache',
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
install_requires=[
- 'requests', 'futures; python_version == "2.7"'],
+ 'requests>=2.9.0',
+ # Python 2.7 compatibility
+ 'futures>=3.1.1; python_version == "2.7"'],
extras_require={
# Storage specific requirements
- 'oss': ['oss2'],
- 's3': ['boto3'],
- 'swift': ['python-swiftclient[keystone]']},
+ 'oss': ['oss2>=2.3.0'],
+ 's3': ['boto3>=1.5.0'],
+ 'swift': ['python-swiftclient[keystone]>=3.3.0']},
setup_requires=['setuptools'],
tests_require=['pytest'],
packages=find_packages(exclude=['docs', 'tests']), | Add requirements version minimum based on changelog or at least on date | Accelize_pycosio | train | py |
7b5f094930ea2a931bc4c2a01403e09d473fd2af | diff --git a/hgvs/dataproviders/uta.py b/hgvs/dataproviders/uta.py
index <HASH>..<HASH> 100644
--- a/hgvs/dataproviders/uta.py
+++ b/hgvs/dataproviders/uta.py
@@ -41,11 +41,16 @@ def connect(db_url=default_db_url):
A local postgresql database:
postgresql://localhost/uta
+
+ A local SQLite database:
+ sqlite:////tmp/uta-0.0.6.db
"""
url = urlparse.urlparse(db_url)
- if url.scheme == 'postgresql':
+ if url.scheme == 'sqlite':
+ conn = UTA_sqlite(url)
+ elif url.scheme == 'postgresql':
conn = UTA_postgresql(url)
else:
# fell through connection scheme cases | revert sqlite support in hgvs.dataproviders.uta.py (needed for test, but not test-quick) | biocommons_hgvs | train | py |
9dbf452993ef52f10fa87abe6da4601d1c362db9 | diff --git a/lib/parslet/atoms/base.rb b/lib/parslet/atoms/base.rb
index <HASH>..<HASH> 100644
--- a/lib/parslet/atoms/base.rb
+++ b/lib/parslet/atoms/base.rb
@@ -32,13 +32,8 @@ class Parslet::Atoms::Base
fail "Assertion failed: success was true when parsing with reporter" \
if success
- if value && value.respond_to?(:raise)
- # Value is a Parslet::Cause, which can be turned into an exception:
- value.raise
- else
- warn "Failure cause could not be generated, raise a generic error..."
- raise Parslet::ParseFailed, "Parse failed."
- end
+ # Value is a Parslet::Cause, which can be turned into an exception:
+ value.raise
end
# assert: success is true | . removes a polymorphism that was not really useful | kschiess_parslet | train | rb |
bd02ebf4a1669542a1f2725ab66c7c7bdf5d7adc | diff --git a/lib/node_modules/@stdlib/math/base/special/lib/index.js b/lib/node_modules/@stdlib/math/base/special/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/node_modules/@stdlib/math/base/special/lib/index.js
+++ b/lib/node_modules/@stdlib/math/base/special/lib/index.js
@@ -766,15 +766,6 @@ setReadOnly( special, 'tan', require( '@stdlib/math/base/special/tan' ) );
setReadOnly( special, 'tanh', require( '@stdlib/math/base/special/tanh' ) );
/**
-* @name tanKernel
-* @memberof special
-* @readonly
-* @type {Function}
-* @see {@link module:@stdlib/math/base/special/tan-kernel}
-*/
-setReadOnly( special, 'tanKernel', require( '@stdlib/math/base/special/tan-kernel' ) );
-
-/**
* @name trunc
* @memberof special
* @readonly | Remove export of uncommitted module
This commit removes the prematurely committed addition of tanKernel to the math/base/special namespace. | stdlib-js_stdlib | train | js |
365c872dd041b9c9d9816aba03023c609726afc7 | diff --git a/pkglib-testing/setup.py b/pkglib-testing/setup.py
index <HASH>..<HASH> 100644
--- a/pkglib-testing/setup.py
+++ b/pkglib-testing/setup.py
@@ -63,8 +63,7 @@ def main():
break
# TODO: split these up into optional deps
- install_requires = ['six',
- 'pytest',
+ install_requires = ['pytest',
'pytest-cov',
'mock',
'contextlib2', | Removing six as a dependency to pkglib-testing.
This will probably make tests fail (as they should!) because pypirc.py
references six directly still. | manahl_pytest-plugins | train | py |
305ef5f66301112d9a50a01dc201174e6a246a29 | diff --git a/Ui/Component/Listing/Column/MenuList/PageActions.php b/Ui/Component/Listing/Column/MenuList/PageActions.php
index <HASH>..<HASH> 100644
--- a/Ui/Component/Listing/Column/MenuList/PageActions.php
+++ b/Ui/Component/Listing/Column/MenuList/PageActions.php
@@ -65,11 +65,11 @@ class PageActions extends Column
'edit' => $this->getEditButton($menuId),
'delete' => $this->getDeleteButton($menuId),
'export' => [
- "href" => $this->getContext()->getUrl(
- "snowmenu/menu/export",
- ["id" => $menuId]
+ 'href' => $this->getContext()->getUrl(
+ 'snowmenu/menu/export',
+ ['id'=> $menuId]
),
- "label" => __("Export")
+ 'label' => __('Export')
]
];
} | [<I>] Replace some double quotes with single quotes in UI Component menu list page actions | SnowdogApps_magento2-menu | train | php |
ca200b1da7ba77f9aa753fd20b8eb09ea4a95838 | diff --git a/bigchaindb/commands/utils.py b/bigchaindb/commands/utils.py
index <HASH>..<HASH> 100644
--- a/bigchaindb/commands/utils.py
+++ b/bigchaindb/commands/utils.py
@@ -198,6 +198,7 @@ base_parser.add_argument('-c', '--config',
'(use "-" for stdout)')
base_parser.add_argument('-l', '--log-level',
+ type=lambda l: l.upper(), # case insensitive conversion
choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'],
default='INFO',
help='Log level') | Treat --log-level argument as case-insensitive | bigchaindb_bigchaindb | train | py |
ab27428b1c137627e16388fffa146c507735653e | diff --git a/queue/queue.go b/queue/queue.go
index <HASH>..<HASH> 100644
--- a/queue/queue.go
+++ b/queue/queue.go
@@ -958,7 +958,7 @@ func (t Time) MarshalJSON() ([]byte, error) {
// See golang.org/issue/4556#c15 for more discussion.
return nil, errors.New("queue.Time.MarshalJSON: year outside of range [0,9999]")
}
- return []byte(time.Time(t).UTC().Format(`"2006-01-02T15:04:05.000Z"`)), nil
+ return []byte(`"` + t.String() + `"`), nil
}
// UnmarshalJSON implements the json.Unmarshaler interface.
@@ -970,3 +970,9 @@ func (t *Time) UnmarshalJSON(data []byte) (err error) {
*t = Time(*x)
return
}
+
+// Returns the Time in canonical RFC3339 representation, e.g.
+// 2015-10-27T20:36:19.255Z
+func (t Time) String() string {
+ return time.Time(t).UTC().Format("2006-01-02T15:04:05.000Z")
+} | Added String() method for taskcluster time objects | taskcluster_taskcluster-client-go | train | go |
a353686ebac64ecd106d39bddb8808898a7959a9 | diff --git a/code/libraries/joomlatools/library/dispatcher/behavior/resettable.php b/code/libraries/joomlatools/library/dispatcher/behavior/resettable.php
index <HASH>..<HASH> 100644
--- a/code/libraries/joomlatools/library/dispatcher/behavior/resettable.php
+++ b/code/libraries/joomlatools/library/dispatcher/behavior/resettable.php
@@ -31,7 +31,7 @@ class KDispatcherBehaviorResettable extends KControllerBehaviorAbstract
$mixer = $this->getMixer();
$request = $mixer->getRequest();
- if(!$request->isSafe() && $request->getReferrer() && $request->getContentType() == 'application/x-www-form-urlencoded') {
+ if(!$request->isSafe() && !$request->isAjax() && $request->getContentType() == 'application/x-www-form-urlencoded') {
return true;
}
@@ -51,8 +51,8 @@ class KDispatcherBehaviorResettable extends KControllerBehaviorAbstract
$response = $context->response;
$request = $context->request;
- if($response->isSuccess()) {
- $response->setRedirect($request->getReferrer());
+ if($response->isSuccess() && $referrer = $request->getReferrer()) {
+ $response->setRedirect($referrer);
}
}
} | #<I> - Don't not perform a RAP for AJAX requests and double check the referrer exists. | joomlatools_joomlatools-framework | train | php |
bfc7867aa55fa2c421b91b5012031607c77e9611 | diff --git a/pd.js b/pd.js
index <HASH>..<HASH> 100644
--- a/pd.js
+++ b/pd.js
@@ -461,6 +461,11 @@ var PdObject = function (proto, pd, type, args) {
/** Converts a Pd message to a float **/
this.tofloat = function(data) {
+ // first check if we just got an actual float, return it if so
+ if (!isNaN(data)) {
+ return data;
+ }
+ // otherwise parse this thing
var element = data.split(" ")[0];
var foundfloat = parseFloat(element);
if (!isNaN(foundfloat)) { | If float value is already an actual float in pd.tofloat(), return that. | sebpiq_WebPd | train | js |
b93a1426de7ffeb368b266486028c578c02489a3 | diff --git a/config/web.php b/config/web.php
index <HASH>..<HASH> 100644
--- a/config/web.php
+++ b/config/web.php
@@ -30,7 +30,7 @@ return [
'class' => \hiqdev\yii2\cart\Module::class,
'termsPage' => $params['organization.termsUrl'] ?: $params['organization.url'],
'orderPage' => '/finance/cart/select',
- 'paymentMethodsProvider' => \hipanel\modules\finance\providers\PaymentMethodsProvider::class,
+ 'paymentMethodsProvider' => \yii\di\Instance::of(\hipanel\modules\finance\providers\PaymentMethodsProvider::class),
'shoppingCartOptions' => [
'on cartChange' => [\hipanel\modules\finance\cart\CartCalculator::class, 'handle'],
'session' => \hipanel\modules\finance\cart\storage\CartStorageInterface::class, | fixed payment methods provider config (#<I>)
* fixed payment methods provider config
* minor | hiqdev_hipanel-module-finance | train | php |
706dee2a93f91dc45887d4f0cca32a41ff457ba1 | diff --git a/reversal.go b/reversal.go
index <HASH>..<HASH> 100644
--- a/reversal.go
+++ b/reversal.go
@@ -24,6 +24,7 @@ type Reversal struct {
Currency Currency `json:"currency"`
Transfer string `json:"transfer"`
Meta map[string]string `json:"metadata"`
+ Tx *Transaction `json:"balance_transaction"`
}
// ReversalList is a list of object for reversals. | Add balance transaction to reversals | stripe_stripe-go | train | go |
fd89bd136fce0cbb2c7e9eaf146d4b9a0ba1e68a | diff --git a/packages/babel-core/src/api/node.js b/packages/babel-core/src/api/node.js
index <HASH>..<HASH> 100644
--- a/packages/babel-core/src/api/node.js
+++ b/packages/babel-core/src/api/node.js
@@ -30,6 +30,9 @@ export function Plugin(alias) {
throw new Error(`The (${alias}) Babel 5 plugin is being run with Babel 6.`);
}
+// Sorry about all the MBs...
+export const guy = "https://medium.com/friendship-dot-js/i-peeked-into-my-node-modules-directory-and-you-wont-believe-what-happened-next-b89f63d21558";
+
//
import Pipeline from "../transformation/pipeline"; | Fix exports of babel-core | babel_babel | train | js |
68505dcf12a5bfb94be872cdc05c397bee2c677f | diff --git a/tests/gorepo/run.go b/tests/gorepo/run.go
index <HASH>..<HASH> 100644
--- a/tests/gorepo/run.go
+++ b/tests/gorepo/run.go
@@ -154,6 +154,7 @@ var knownFails = map[string]failReason{
"fixedbugs/issue46938.go": {category: notApplicable, desc: "tests -d=checkptr compiler mode, which GopherJS doesn't support"},
"fixedbugs/issue47928.go": {category: notApplicable, desc: "//go:nointerface is a part of GOEXPERIMENT=fieldtrack and is not supported by GopherJS"},
"fixedbugs/issue49665.go": {category: other, desc: "attempts to pass -gcflags=-G=3 to enable generics, GopherJS doesn't expect the flag; re-enable in Go 1.19 where the flag is removed"},
+ "fixedbugs/issue48898.go": {category: other, desc: "https://github.com/gopherjs/gopherjs/issues/1128"},
}
type failCategory uint8 | Skip fixedbugs/issue<I>.go
This isn't a new regression in Go <I> and there seem to be several
distinct bugs affecting it, so it's reasonable to address it as a
separate issue: <URL> | gopherjs_gopherjs | train | go |
5420fd839b661aec32e73ed1e19d3670304b7f2f | diff --git a/amino/either.py b/amino/either.py
index <HASH>..<HASH> 100644
--- a/amino/either.py
+++ b/amino/either.py
@@ -1,5 +1,6 @@
+import abc
import importlib
-from typing import TypeVar, Generic, Callable, Union, Any, cast, Iterator
+from typing import TypeVar, Generic, Callable, Union, Any, cast, Iterator, Type
from types import ModuleType # noqa
from pathlib import Path
@@ -111,6 +112,13 @@ class Either(Generic[A, B], F[B], implicits=True):
Right(attr)
)
+ @staticmethod
+ def catch(f: Callable[[], B], exc: Type[E]) -> 'Either[E, B]':
+ try:
+ return Right(f())
+ except exc as e:
+ return Left(e)
+
@property
def is_right(self) -> 'amino.Boolean':
return boolean.Boolean(isinstance(self, Right)) | `Either.catch` | tek_amino | train | py |
62810d454c45fdc02d72487a66c768b7a36670a7 | diff --git a/juicer/utils/__init__.py b/juicer/utils/__init__.py
index <HASH>..<HASH> 100644
--- a/juicer/utils/__init__.py
+++ b/juicer/utils/__init__.py
@@ -133,7 +133,7 @@ def get_login_info():
connections[section] = jc(cfg)
- if cfg['base'] == True:
+ if cfg['base'] == 'True':
_defaults['cart_dest'] = section
juicer.utils.Log.log_debug("[%s] username: %s, base_url: %s" % \ | Default cart dest was broken. Fixed it. | juicer_juicer | train | py |
5639a743d580eebd242d995e63de928346083557 | diff --git a/tests/dummy/app/components/cart-marker/component.js b/tests/dummy/app/components/cart-marker/component.js
index <HASH>..<HASH> 100644
--- a/tests/dummy/app/components/cart-marker/component.js
+++ b/tests/dummy/app/components/cart-marker/component.js
@@ -58,7 +58,7 @@ export default Ember.Component.extend(GraphicSupport, {
selection = selection.selectAll('.shape');
this.get('applyAt').forEach(styleName => {
- selection.style(styleName, 'url(/gallery/bars/waterfall#tick)');
+ selection.style(styleName, 'url(#tick)');
});
}, | initial support for <base> tag workaround | ming-codes_ember-cli-d3 | train | js |
d64caa29eac404a36d2d52f3b2ce55c2b91d50e1 | diff --git a/example/config/decoy/site.php b/example/config/decoy/site.php
index <HASH>..<HASH> 100644
--- a/example/config/decoy/site.php
+++ b/example/config/decoy/site.php
@@ -43,9 +43,8 @@
* @var array
*/
'roles' => [
- // 'super' => '<b>Super admin</b> - Can manage all content.',
- // 'general' => '<b>General</b> - Can manage sub pages of services and buildings (except for forms).',
- // 'forms' => '<b>Forms</b> - Can do everything a general admin can but can also manage forms.',
+ 'admin' => '<b>Super admin</b> - Can manage all content.',
+ 'viewer' => '<b>Viewer</b> - Can only read.',
],
/**
@@ -54,15 +53,16 @@
* @var array
*/
'permissions' => [
- // 'general' => [
- // 'cant' => [
- // 'create.categories',
- // 'destroy.categories',
- // 'manage.slides',
- // 'manage.sub-categories',
- // 'manage.forms',
- // ],
- // ],
+ 'viewer' => [
+ 'can' => [
+ 'read.articles',
+ 'read.admins',
+ 'manage.tags',
+ ],
+ 'cant' => [
+ 'destroy.tags',
+ ]
+ ],
],
/** | setting up example app for testing permissions | BKWLD_decoy | train | php |
46e427ef1f2608584d0a37036ce96bd673be697e | diff --git a/adjustText/adjustText.py b/adjustText/adjustText.py
index <HASH>..<HASH> 100644
--- a/adjustText/adjustText.py
+++ b/adjustText/adjustText.py
@@ -526,8 +526,8 @@ def adjust_text(texts, x=None, y=None, add_objects=None, ax=None,
dy = (np.array(d_y_text) * force_text[1] +
np.array(d_y_points) * force_points[1] +
np.array(d_y_objects) * force_objects[1])
- qx = np.sum([i[0] for i in [q1, q2, q3]])
- qy = np.sum([i[1] for i in [q1, q2, q3]])
+ qx = np.sum([q[0] for q in [q1, q2, q3]])
+ qy = np.sum([q[1] for q in [q1, q2, q3]])
histm = np.mean(np.array(history), axis=0)
if (qx < precision_x and qy < precision_y) or np.all([qx, qy] >= histm):
break | Fix bug caused by variable shadowing. | Phlya_adjustText | train | py |
b0d3bbffe349117fa324ef104b13925ef0fa0d2a | diff --git a/lib/hermann/producer.rb b/lib/hermann/producer.rb
index <HASH>..<HASH> 100644
--- a/lib/hermann/producer.rb
+++ b/lib/hermann/producer.rb
@@ -62,7 +62,9 @@ module Hermann
if RUBY_PLATFORM == "java"
result = @internal.push_single(value, topic)
- @children << result
+ unless result.nil?
+ @children << result
+ end
# Reaping children on the push just to make sure that it does get
# called correctly and we don't leak memory
reap_children | Avoid adding non-existent children to our internal list.
This really only affects testing where we might be returning nil after a
push_single expectation has been met | reiseburo_hermann | train | rb |
2aa4a74e22e5963e1876e43c201751c4c914d0b7 | diff --git a/java/client/src/org/openqa/selenium/remote/tracing/HttpTracing.java b/java/client/src/org/openqa/selenium/remote/tracing/HttpTracing.java
index <HASH>..<HASH> 100644
--- a/java/client/src/org/openqa/selenium/remote/tracing/HttpTracing.java
+++ b/java/client/src/org/openqa/selenium/remote/tracing/HttpTracing.java
@@ -56,7 +56,7 @@ public class HttpTracing {
Objects.requireNonNull(request, "Request must be set.");
StackTraceElement caller = Thread.currentThread().getStackTrace()[2];
- LOG.info(String.format("Injecting %s into %s at %s:%d", request, span, caller.getClassName(), caller.getLineNumber()));
+ LOG.fine(String.format("Injecting %s into %s at %s:%d", request, span, caller.getClassName(), caller.getLineNumber()));
span.setTag(Tags.HTTP_METHOD.getKey(), request.getMethod().toString());
span.setTag(Tags.HTTP_URL.getKey(), request.getUri()); | Reduce verbosity of logging message | SeleniumHQ_selenium | train | java |
8a1236d353aef6a8418108e50490a223de7d000b | diff --git a/lib/active_merchant/billing/gateways/card_stream.rb b/lib/active_merchant/billing/gateways/card_stream.rb
index <HASH>..<HASH> 100644
--- a/lib/active_merchant/billing/gateways/card_stream.rb
+++ b/lib/active_merchant/billing/gateways/card_stream.rb
@@ -147,9 +147,9 @@ module ActiveMerchant #:nodoc:
def add_address(post, creditcard, options)
address = options[:billing_address] || options[:address]
- return if address.nil?
+ return unless address
- add_pair(post, :customerAddress, (address[:address1].nil? ? "" : address[:address1]) + " " + (address[:address2].nil? ? "" : address[:address2]))
+ add_pair(post, :customerAddress, "#{address[:address1]} #{address[:address2]}".strip)
add_pair(post, :customerPostCode, address[:zip])
end | Cardstream: Simplify street address | activemerchant_active_merchant | train | rb |
156050027516389f9815b8c93e90c80b53d9d749 | diff --git a/migrations/Version202203101426253772_taoLti.php b/migrations/Version202203101426253772_taoLti.php
index <HASH>..<HASH> 100644
--- a/migrations/Version202203101426253772_taoLti.php
+++ b/migrations/Version202203101426253772_taoLti.php
@@ -30,7 +30,6 @@ use oat\taoLti\models\classes\Platform\Repository\LtiPlatformRepositoryInterface
final class Version202203101426253772_taoLti extends AbstractMigration
{
-
public function getDescription(): string
{
return 'Populate LTI 1.3 platform registration table';
@@ -38,10 +37,10 @@ final class Version202203101426253772_taoLti extends AbstractMigration
public function up(Schema $schema): void
{
- /** @var LtiPlatformRepositoryInterface $rdfRepository */
+ /** @var LtiPlatformRepositoryInterface $ltiRepository */
$ltiRepository = $this->getServiceLocator()->get(LtiPlatformRepositoryInterface::SERVICE_ID);
- /** @var Lti1p3RegistrationSnapshotRepository $snaptshotRepository */
+ /** @var Lti1p3RegistrationSnapshotRepository $snapshotRepository */
$snapshotRepository = $this->getServiceLocator()->getContainer()->get(RegistrationRepositoryInterface::class);
foreach ($ltiRepository->findAll() as $registration) { | chore: update variable name in doc block | oat-sa_extension-tao-lti | train | php |
dbb1b2d8102227c983cfe10bb60f6cdcfd58d3b8 | diff --git a/demo_project/settings.py b/demo_project/settings.py
index <HASH>..<HASH> 100644
--- a/demo_project/settings.py
+++ b/demo_project/settings.py
@@ -35,6 +35,7 @@ ugettext = lambda s: s
LANGUAGES = (
('en', ugettext('English')),
('nl', ugettext('Dutch')),
+ ('pl', ugettext('Polish')),
)
SITE_ID = 1 | Added polish to LANGUAGES | bread-and-pepper_django-userena | train | py |
fd7fb7ade0fc879e24543f13c39b00de073004bc | diff --git a/setuptools/tests/py26compat.py b/setuptools/tests/py26compat.py
index <HASH>..<HASH> 100644
--- a/setuptools/tests/py26compat.py
+++ b/setuptools/tests/py26compat.py
@@ -8,4 +8,7 @@ def _tarfile_open_ex(*args, **kwargs):
"""
return contextlib.closing(tarfile.open(*args, **kwargs))
-tarfile_open = _tarfile_open_ex if sys.version_info < (2,7) else tarfile.open
+if sys.version_info[:2] < (2, 7) or (3, 0) <= sys.version_info[:2] < (3, 2):
+ tarfile_open = _tarfile_open_ex
+else:
+ tarfile_open = tarfile.open | Fix "AttributeError: 'TarFile' object has no attribute '__exit__'" with Python <I>. | pypa_setuptools | train | py |
60d6a093713be47a51b27217fa5baa115fa1bba1 | diff --git a/salt/utils/cloud.py b/salt/utils/cloud.py
index <HASH>..<HASH> 100644
--- a/salt/utils/cloud.py
+++ b/salt/utils/cloud.py
@@ -2604,9 +2604,9 @@ def run_func_until_ret_arg(fun, kwargs, fun_call=None, argument_being_watched=No
f_result = fun(kwargs, call=fun_call)
r_set = {}
for d in f_result:
- if type(d) is list:
+ if isinstance(d, list):
d0 = d[0]
- if type(d0) is dict:
+ if isinstance(d0, dict):
for k, v in d0.items():
r_set[k] = v
status = _unwrap_dict(r_set, argument_being_watched) | Changed from using type() to isinstance() per pull request comment | saltstack_salt | train | py |
0bb9245762d25c8f135d89051eeb369ed76010bc | diff --git a/publish/scripts/installer.js b/publish/scripts/installer.js
index <HASH>..<HASH> 100755
--- a/publish/scripts/installer.js
+++ b/publish/scripts/installer.js
@@ -846,7 +846,7 @@ module.exports = function($logger, hookArgs) {
});
}
- var buildType = isReleaseBuild || isProdEnv ? 'production' : 'development';
+ var buildType = (isReleaseBuild && isProdEnv) || (!isReleaseBuild && isProdEnv) ? 'production' : 'development';
/*
Detect if we have nativescript-plugin-firebase temp file created during after-prepare hook, so we know | Fix bug on iOS platform occurring when application is built in release mode with development environment. In this case, before this patch, the plugin copies firebase prod file in place of the firebase dev file. | EddyVerbruggen_nativescript-plugin-firebase | train | js |
9ff243c4393f79c2a026398f8c3dae71d81bc9cb | diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/CosmosResponseDiagnostics.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/CosmosResponseDiagnostics.java
index <HASH>..<HASH> 100644
--- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/CosmosResponseDiagnostics.java
+++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/CosmosResponseDiagnostics.java
@@ -18,10 +18,6 @@ public class CosmosResponseDiagnostics {
private static final Logger logger = LoggerFactory.getLogger(CosmosResponseDiagnostics.class);
private static final ObjectMapper objectMapper = new ObjectMapper();
- static {
- objectMapper.registerModule(new AfterburnerModule());
- }
-
private ClientSideRequestStatistics clientSideRequestStatistics;
CosmosResponseDiagnostics() { | removing afterBurner from CosmosResponseDiagnostics (#<I>) | Azure_azure-sdk-for-java | train | java |
2392b88433a0c4d36d17c7ba7158970216a0d2e6 | diff --git a/dshelpers.py b/dshelpers.py
index <HASH>..<HASH> 100644
--- a/dshelpers.py
+++ b/dshelpers.py
@@ -145,6 +145,7 @@ def _download_without_backoff(url, as_file=True, **kwargs):
response = requests.get(url, **kwargs_copy)
if logging.getLogger().isEnabledFor(logging.DEBUG):
+ # This can be slow on large responses, due to chardet.
L.debug('"{}"'.format(response.text))
response.raise_for_status() | Add a warning comment about chardet
Explains why we check if it's really necessary to do this. | scraperwiki_data-services-helpers | train | py |
aa6625e62aaff2f336ea66239b739afebd7122c6 | diff --git a/python/ray/serve/backend_worker.py b/python/ray/serve/backend_worker.py
index <HASH>..<HASH> 100644
--- a/python/ray/serve/backend_worker.py
+++ b/python/ray/serve/backend_worker.py
@@ -355,7 +355,8 @@ class RayServeReplica:
# We set the del method to noop after succssifully calling it so the
# destructor is called only once.
try:
- self.callable.__del__()
+ if hasattr(self.callable, "__del__"):
+ self.callable.__del__()
except Exception:
logger.exception("Exception during graceful shutdown of replica.")
finally: | [Serve] gate __del__ call behind hasattr check (#<I>) | ray-project_ray | train | py |
025384d635fae115bd1b56008c322629b26ee402 | diff --git a/test/unit/test_runner.py b/test/unit/test_runner.py
index <HASH>..<HASH> 100644
--- a/test/unit/test_runner.py
+++ b/test/unit/test_runner.py
@@ -29,6 +29,7 @@ def rc(request, tmpdir):
rc.job_timeout = .1
rc.idle_timeout = 0
rc.pexpect_timeout = .1
+ rc.pexpect_use_poll = True
return rc | Set pexpect_use_poll for unittests
This is a follow-up patch for issue/<I> which broke unittests. | ansible_ansible-runner | train | py |
6565b89ea70b377981a0e19e98bedf989bbfb62e | diff --git a/lib/rom.rb b/lib/rom.rb
index <HASH>..<HASH> 100644
--- a/lib/rom.rb
+++ b/lib/rom.rb
@@ -1,4 +1,3 @@
-require 'descendants_tracker'
require 'equalizer'
require 'inflecto' | No need to require unused DescendantsTracker
It was removed in <I>c<I>a3c<I>e<I>aa<I>b | rom-rb_rom | train | rb |
5ae69e31a9b900e16a2a7d110dc0b544fa55887e | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@ setup(
, include_package_data = True
, install_requires =
- [ "delfick_app==0.9.3"
+ [ "delfick_app==0.9.4"
, "option_merge==1.4.4"
, "input_algorithms==0.5.8"
, "option_merge_addons==0.2" | Upgrading delfick_app | delfick_harpoon | train | py |
085f4857cce04712020daff96f70254459dc8fad | diff --git a/library/src/main/java/com/carlosdelachica/easyrecycleradapters/recycler_view_manager/EasyRecyclerViewManager.java b/library/src/main/java/com/carlosdelachica/easyrecycleradapters/recycler_view_manager/EasyRecyclerViewManager.java
index <HASH>..<HASH> 100644
--- a/library/src/main/java/com/carlosdelachica/easyrecycleradapters/recycler_view_manager/EasyRecyclerViewManager.java
+++ b/library/src/main/java/com/carlosdelachica/easyrecycleradapters/recycler_view_manager/EasyRecyclerViewManager.java
@@ -222,6 +222,9 @@ public class EasyRecyclerViewManager {
emptyLoadingListTextView.setVisibility(visible ? View.VISIBLE : View.GONE);
}
+ public void setLayoutManager(LayoutManager layoutManager) {
+ recyclerView.setLayoutManager(layoutManager);}
+
public static class Builder extends EasyRecyclerViewManagerBuilder {
public Builder(RecyclerView recyclerView, EasyRecyclerAdapter adapter) {
super(recyclerView, adapter); | Change layout manager at runtime (when the user wants) | CarlosMChica_easyrecycleradapters | train | java |
d8800d61322c8a37bcb0765b5385bc67960eb9b7 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -8,6 +8,6 @@ setup(
author='Niklas Rosenstein',
author_email='[email protected]',
url='https://github.com/NiklasRosenstein/myo-python',
- packages=['myo'],
+ packages=['myo', 'myo.lowlevel', 'myo.utils'],
install_requires=['six'],
) | fixed setup.py not taking subpackages into account | NiklasRosenstein_myo-python | train | py |
988e241014ac5c6734e71d30c91f5af3bec53e8a | diff --git a/packages/build-tools/tasks/task-collections.js b/packages/build-tools/tasks/task-collections.js
index <HASH>..<HASH> 100644
--- a/packages/build-tools/tasks/task-collections.js
+++ b/packages/build-tools/tasks/task-collections.js
@@ -121,7 +121,7 @@ async function clean(cleanAll = false) {
dirs = [config.buildDir];
break;
}
- if (cleanAll === true) {
+ if (cleanAll === true && config.env !== 'pwa') {
dirs = [config.wwwDir];
}
await internalTasks.clean(dirs); | test: re-test optimized webpack build | bolt-design-system_bolt | train | js |
5eed39aea076c1ed64b58461fa3b041dc7694614 | diff --git a/spec/functional/resource/msu_package_spec.rb b/spec/functional/resource/msu_package_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/functional/resource/msu_package_spec.rb
+++ b/spec/functional/resource/msu_package_spec.rb
@@ -26,11 +26,12 @@ describe Chef::Resource::MsuPackage, :win2012r2_only do
let(:package_identity) { "Package_for_KB2959977~31bf3856ad364e35~amd64~~6.3.1.1" }
let(:timeout) { 3600 }
+ let(:run_context) do
+ Chef::RunContext.new(Chef::Node.new, {}, Chef::EventDispatch::Dispatcher.new)
+ end
+
let(:new_resource) { Chef::Resource::CabPackage.new("windows_test_pkg") }
let(:cab_provider) do
- node = Chef::Node.new
- events = Chef::EventDispatch::Dispatcher.new
- run_context = Chef::RunContext.new(node, {}, events)
Chef::Provider::Package::Cab.new(new_resource, run_context)
end | Fix a missing reference to run_context. | chef_chef | train | rb |
2f95e3e76f4e504f79899a33ef89d59c534c7076 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -299,22 +299,23 @@ export default function youTubeSource(uw, opts = {}) {
return playlists;
}
- async function getPlaylistMetasForUser(url) {
- const channel = await getChannelMeta(url);
-
- const specials = youTubeGetPlaylists({
+ function getSpecialChannelPlaylists(channel) {
+ return youTubeGetPlaylists({
...params,
...getPlaylistsOptions,
id: values(channel.playlists)
- });
+ }).then(result => result.items);
+ }
+
+ async function getPlaylistMetasForUser(url) {
+ const channel = await getChannelMeta(url);
+
+ const specials = getSpecialChannelPlaylists(channel);
const playlists = getChannelPlaylists(channel.id);
const result = await Promise.all([specials, playlists]);
- const allPlaylists = [
- ...result[0][0].items,
- ...result[1]
- ];
+ const allPlaylists = result[0].concat(result[1]);
return {
channel: { id: channel.id, title: channel.title }, | fix crash during retrieval of "special" playlists for a channel | u-wave_u-wave-source-youtube | train | js |
0301c1ec3b86b66f5765c3b45d9e1fda448b0333 | diff --git a/src/GraphQL/SubscriptionsManager.php b/src/GraphQL/SubscriptionsManager.php
index <HASH>..<HASH> 100644
--- a/src/GraphQL/SubscriptionsManager.php
+++ b/src/GraphQL/SubscriptionsManager.php
@@ -104,6 +104,8 @@ class SubscriptionsManager
if (is_array($context) && is_array($this->context)) {
$this->context = array_merge($this->context, $context);
+ } else if (is_array($context) && $this->context === null) {
+ $this->context = $context;
}
} catch (Exception $e) {
$response = [ | if connection init sets context it should be set anyway | leocavalcante_siler | train | php |
b13dcc7243041d17c002245b9c9c6027d0a8f412 | diff --git a/pupa/tests/scrape/test_event_scrape.py b/pupa/tests/scrape/test_event_scrape.py
index <HASH>..<HASH> 100644
--- a/pupa/tests/scrape/test_event_scrape.py
+++ b/pupa/tests/scrape/test_event_scrape.py
@@ -50,6 +50,16 @@ def test_agenda_add_person():
e.validate()
+def test_agenda_add_vote():
+ e = event_obj()
+ agenda = e.add_agenda_item("foo bar")
+ assert agenda['related_entities'] == []
+
+ agenda.add_vote(vote='Roll no. 12')
+ assert len(e.agenda[0]['related_entities']) == 1
+ e.validate()
+
+
def test_agenda_add_subject():
e = event_obj()
agenda = e.add_agenda_item("foo bar") | add test for agenda add_vote method | opencivicdata_pupa | train | py |
835e8e0850c811128a91f01bdf3ba7b98ac88787 | diff --git a/resource/meta.go b/resource/meta.go
index <HASH>..<HASH> 100644
--- a/resource/meta.go
+++ b/resource/meta.go
@@ -158,7 +158,6 @@ func (meta *Meta) UpdateMeta() {
}
scopeField, _ := scope.FieldByName(meta.Alias)
- relationship := scopeField.Relationship
if meta.Setter == nil {
meta.Setter = func(resource interface{}, metaValues *MetaValues, context *qor.Context) {
@@ -172,6 +171,7 @@ func (meta *Meta) UpdateMeta() {
field := reflect.Indirect(reflect.ValueOf(resource)).FieldByName(meta.Alias)
if field.IsValid() && field.CanAddr() {
+ relationship := scopeField.Relationship
if relationship != nil && relationship.Kind == "many_to_many" {
context.DB().Where(ToArray(value)).Find(field.Addr().Interface())
if !scope.PrimaryKeyZero() { | Fix exception in case of scopeField is nil | qor_qor | train | go |
8d6c7ce4dc9c48a64ac284ff2d6bec06b1a8bbcf | diff --git a/lib/protobuf/rpc/connectors/base.rb b/lib/protobuf/rpc/connectors/base.rb
index <HASH>..<HASH> 100644
--- a/lib/protobuf/rpc/connectors/base.rb
+++ b/lib/protobuf/rpc/connectors/base.rb
@@ -137,13 +137,6 @@ module Protobuf
ENV.key?("PB_RPC_PING_PORT")
end
- def request_fields
- { :service_name => @options[:service].name,
- :method_name => @options[:method].to_s,
- :request_proto => @options[:request],
- :caller => request_caller }
- end
-
def request_bytes
validate_request_type!
return ::Protobuf::Socketrpc::Request.encode(request_fields)
@@ -155,6 +148,13 @@ module Protobuf
@options[:client_host] || ::Protobuf.client_host
end
+ def request_fields
+ { :service_name => @options[:service].name,
+ :method_name => @options[:method].to_s,
+ :request_proto => @options[:request],
+ :caller => request_caller }
+ end
+
def send_request
fail 'If you inherit a Connector from Base you must implement send_request'
end | Alphabetically sorting class methods | ruby-protobuf_protobuf | train | rb |
65de08bddb334129a9baa6a872a8aa3bced5d07c | diff --git a/spotbugs/src/main/java/edu/umd/cs/findbugs/SAXBugCollectionHandler.java b/spotbugs/src/main/java/edu/umd/cs/findbugs/SAXBugCollectionHandler.java
index <HASH>..<HASH> 100644
--- a/spotbugs/src/main/java/edu/umd/cs/findbugs/SAXBugCollectionHandler.java
+++ b/spotbugs/src/main/java/edu/umd/cs/findbugs/SAXBugCollectionHandler.java
@@ -587,10 +587,8 @@ public class SAXBugCollectionHandler extends DefaultHandler {
// The qName should equal to its classname, so we can reflect the class by 'qName'.
annotationClazz = plugin.getClassLoader().loadClass(k);
return annotationClazz.getMethod("fromXML", String.class, Attributes.class);
- } catch (NoSuchMethodException | ClassCastException e) {
- e.printStackTrace();
- } catch (ClassNotFoundException ignored) {
- LOG.warn("{} not found in Plugin({})", k, plugin.getPluginId());
+ } catch (NoSuchMethodException | ClassCastException | ClassNotFoundException ignored) {
+ LOG.warn("{} not found in Plugin({})", k, plugin.getPluginId(), ignored);
// The current plugin classloader doesn't have the annotation class called 'qName', ignore.
}
} | fix: fix the security hotspot reported by SQ
<URL> | spotbugs_spotbugs | train | java |
7ad8fef282459220e2dc33c8e848dbb37167d838 | diff --git a/test/slice_object_test.go b/test/slice_object_test.go
index <HASH>..<HASH> 100644
--- a/test/slice_object_test.go
+++ b/test/slice_object_test.go
@@ -210,6 +210,20 @@ func TestSliceObjectNestedGet1(t *testing.T) {
ASSERT_EQ(slice, mustSlice(slice.Get()), t)
}
+func TestSliceObjectGetLength1(t *testing.T) {
+ // Test fast path with single object field
+ slice := velocypack.Slice{0x0b,
+ 0x07, // Bytesize
+ 0x01, // NoItems
+ 0x41, 0x61, 0x1a, // "a": true
+ 0x03, // Index of "a"
+ }
+
+ a := mustSlice(slice.Get("a"))
+ ASSERT_EQ(velocypack.Bool, a.Type(), t)
+ ASSERT_TRUE(mustBool(a.GetBool()), t)
+}
+
func TestSliceObjectNestedHasKey(t *testing.T) {
slice := mustSlice(velocypack.ParseJSONFromString(`{"a":{"b":{"c":55},"d":true}}`)) | Test object with length 1 -> Get | arangodb_go-velocypack | train | go |
af27794e653a73933b436016e5866f66a2e8c5f2 | diff --git a/src/Statements/DropStatement.php b/src/Statements/DropStatement.php
index <HASH>..<HASH> 100644
--- a/src/Statements/DropStatement.php
+++ b/src/Statements/DropStatement.php
@@ -39,6 +39,7 @@ class DropStatement extends Statement
'SCHEMA' => 1,
'SERVER' => 1,
'TABLE' => 1,
+ 'VIEW' => 1,
'TABLESPACE' => 1,
'TRIGGER' => 1, | Fix DROP VIEW statement is not constructed properly by the parser, Issue #<I> | phpmyadmin_sql-parser | train | php |
1cfd12a5cf6381faa07edcb797fa824953bf99d6 | diff --git a/salt/modules/boto_sqs.py b/salt/modules/boto_sqs.py
index <HASH>..<HASH> 100644
--- a/salt/modules/boto_sqs.py
+++ b/salt/modules/boto_sqs.py
@@ -178,7 +178,7 @@ def _get_conn(region, key, keyid, profile):
_profile = profile
key = _profile.get('key', None)
keyid = _profile.get('keyid', None)
- region = _profile.get('keyid', None)
+ region = _profile.get('region', None)
if not region and __salt__['config.option']('sqs.region'):
region = __salt__['config.option']('sqs.region') | Fix region key fetching from profiles in boto_sqs
I was pulling the wrong key in profiles for regions in boto_sqs.
This change addresses that. | saltstack_salt | train | py |
5383041e765a2b9f280e117939a31c1920728f84 | diff --git a/lib/Gregwar/Image.php b/lib/Gregwar/Image.php
index <HASH>..<HASH> 100644
--- a/lib/Gregwar/Image.php
+++ b/lib/Gregwar/Image.php
@@ -98,10 +98,9 @@ class Image
*/
protected function guessType()
{
- $infos = @getimagesize($this->file);
+ $type = @exif_imagetype($this->file);
- if ($infos !== false) {
- $type = $infos[2];
+ if (false !== $type) {
if ($type == IMAGETYPE_JPEG)
return 'jpeg';
if ($type == IMAGETYPE_GIF) | Using exif_imagetype() to determine the image type | Gregwar_Image | train | php |
356c504b207eadd6bf588c5336cc6951f91e14b1 | diff --git a/plenum/test/view_change/test_different_last_ordered_before_view_change.py b/plenum/test/view_change/test_different_last_ordered_before_view_change.py
index <HASH>..<HASH> 100644
--- a/plenum/test/view_change/test_different_last_ordered_before_view_change.py
+++ b/plenum/test/view_change/test_different_last_ordered_before_view_change.py
@@ -46,6 +46,9 @@ def test_different_last_ordered_on_backup_before_view_change(looper, txnPoolNode
eventually(last_ordered,
txnPoolNodeSet,
slow_instance))
+ last_ordered(txnPoolNodeSet,
+ txnPoolNodeSet[0].master_replica.instId,
+ (old_last_ordered[0], old_last_ordered[1] + 1))
sdk_send_random_and_check(looper, txnPoolNodeSet, sdk_pool_handle,
sdk_wallet_client, 1)
assert all(0 == node.spylog.count(node.request_propagates) | INDY-<I>: added check in test_different_last_ordered_before_view_change
Changes:
- added check in test_different_last_ordered_on_backup_before_view_change for last_order on master instance. | hyperledger_indy-plenum | train | py |
6bfa48a667fe91bb1de1b680769aeb7260af3a49 | diff --git a/js/reveal.js b/js/reveal.js
index <HASH>..<HASH> 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -165,6 +165,9 @@
},
+ // Flags if Reveal.initialize() has been called
+ initialized = false,
+
// Flags if reveal.js is loaded (has dispatched the 'ready' event)
loaded = false,
@@ -257,6 +260,11 @@
*/
function initialize( options ) {
+ // Make sure we only initialize once
+ if( initialized === true ) return;
+
+ initialized = true;
+
checkCapabilities();
if( !features.transforms2d && !features.transforms3d ) { | prevent repeated initialization #<I> | hakimel_reveal.js | train | js |
257c10c17e25d261b4bbfb167ca926b9c884d072 | diff --git a/src/PeskyCMF/Config/CmfConfig.php b/src/PeskyCMF/Config/CmfConfig.php
index <HASH>..<HASH> 100644
--- a/src/PeskyCMF/Config/CmfConfig.php
+++ b/src/PeskyCMF/Config/CmfConfig.php
@@ -393,7 +393,7 @@ class CmfConfig extends ConfigsContainer {
* @return string
*/
static public function home_page_url() {
- return '/' . self::getInstance()->url_prefix() . '/page/dashboard';
+ return route('cmf_start_page');
}
/** | CmfConfig - updated home_page_url() to use 'cmf_start_page' route | swayok_PeskyCMF | train | php |
32c3d4b02a0ad9dea4211741bc730adcf874d3ed | diff --git a/reveal-code-focus.js b/reveal-code-focus.js
index <HASH>..<HASH> 100644
--- a/reveal-code-focus.js
+++ b/reveal-code-focus.js
@@ -40,7 +40,7 @@
forEach(document.querySelectorAll('pre code'), function(element) {
// Trim whitespace if the `data-trim` attribute is present.
if (element.hasAttribute('data-trim') && typeof element.innerHTML.trim == 'function') {
- element.innerHTML = element.innerHTML.trim();
+ element.innerHTML = element.innerHTML.trim() + "\n";
}
// Highlight code using highlight.js. | Fix focusing last line when using data-trim (#<I>).
The last line was not being wrapped in a `<span>` when using `data-trim`
because the trailing newline was removed. | bnjmnt4n_reveal-code-focus | train | js |
514a64563bf584cfb496fc400798728d704af72f | diff --git a/src/main/java/edu/jhu/featurize/GetFeatures.java b/src/main/java/edu/jhu/featurize/GetFeatures.java
index <HASH>..<HASH> 100644
--- a/src/main/java/edu/jhu/featurize/GetFeatures.java
+++ b/src/main/java/edu/jhu/featurize/GetFeatures.java
@@ -121,7 +121,9 @@ public class GetFeatures {
}
for (CoNLL09Token word : sent) {
for (int j = 0; j< word.getApreds().size(); j++) {
- knownRoles.add(word.getApreds().get(j));
+ String[] splitRole = word.getApreds().get(j).split("-");
+ String role = splitRole[0];
+ knownRoles.add(role);
}
String wordForm = word.getForm();
String cleanWord = normalize.clean(wordForm); | Less than optimal theta removal. | mgormley_pacaya | train | java |
49e3e4daddddae92be74e649bd3260e7a376fd89 | diff --git a/hepnames/fields/bd1xx.py b/hepnames/fields/bd1xx.py
index <HASH>..<HASH> 100644
--- a/hepnames/fields/bd1xx.py
+++ b/hepnames/fields/bd1xx.py
@@ -289,7 +289,7 @@ def positions2marc(self, key, value):
't': value.get('end_date'),
'm': value.get('emails'),
'o': value.get('old_emails'),
- 'z': value.get('current'),
+ 'z': 'Current' if value.get('current') else None,
} | authors: email and old_email handling
* Keeps emails and old_emails inside the positions objects to not be
detected as a change.
* Extracts all current emails into a `public_emails` form field, keeping as
well the original value of the email. (closes #<I>)
* When a user modifies a current email, a new <I> field is created with the
modified value in $$a and the old value in $$o. This will allow to apply
the | inspirehep_inspire-dojson | train | py |
768a535ae44e4878882dd29fbe9dd0a5eb489911 | diff --git a/shapefile.py b/shapefile.py
index <HASH>..<HASH> 100644
--- a/shapefile.py
+++ b/shapefile.py
@@ -549,11 +549,13 @@ class Reader:
"""Returns all records in a dbf file."""
if not self.numRecords:
self.__dbfHeader()
+ records = []
f = self.__getFileObj(self.dbf)
f.seek(self.__dbfHeaderLength())
- flat = unpack(self.__recStruct.format * self.numRecords, f.read(self.__recStruct.size * self.numRecords))
- rowlen = len(self.fields) - 1
- records = list(izip(*(iter(flat),) * rowlen))
+ for i in range(self.numRecords):
+ r = self.__record()
+ if r:
+ records.append(r)
return records
def iterRecords(self): | Revert back to original records() method
Fixes issue introduced in PR #<I>, see issue #<I>.
Previously tried fixing it in PR #<I>, but reverting to original was better. | GeospatialPython_pyshp | train | py |
c13dcaab9e9293d4b01dccd22ef616e745eefefa | diff --git a/packages/neo-one-client-core/src/common.js b/packages/neo-one-client-core/src/common.js
index <HASH>..<HASH> 100644
--- a/packages/neo-one-client-core/src/common.js
+++ b/packages/neo-one-client-core/src/common.js
@@ -194,7 +194,7 @@ const privateKeyToBuffer = (value: PrivateKey | PrivateKeyHex): Buffer =>
typeof value === 'string' ? hexToPrivateKey(value) : value;
const privateKeyToString = (value: PrivateKey | PrivateKeyHex): string =>
- typeof value === 'string' ? value : ecPointToHex(value);
+ typeof value === 'string' ? value : privateKeyToHex(value);
const stringToPrivateKey = (value: string): PrivateKey =>
hexToPrivateKey(value); | Minor fix to privateKeyToString | neo-one-suite_neo-one | train | js |
e7b0e760e676b79b87db7b654b97dcfdb6469253 | diff --git a/setuptools_rust/build.py b/setuptools_rust/build.py
index <HASH>..<HASH> 100644
--- a/setuptools_rust/build.py
+++ b/setuptools_rust/build.py
@@ -622,7 +622,7 @@ def _detect_unix_cross_compile_info() -> Optional["_CrossCompileInfo"]:
linker = None
linker_args = None
else:
- [linker, linker_args] = bldshared.split(maxsplit=1)
+ [linker, _, linker_args] = bldshared.partition(" ")
return _CrossCompileInfo(host_type, cross_lib, linker, linker_args) | Fix handling when BLDSHARED has no flags | PyO3_setuptools-rust | train | py |
b81ec082e783ecfdc9aab27600d96400ff36c382 | diff --git a/lib/jets/resource/api_gateway/method.rb b/lib/jets/resource/api_gateway/method.rb
index <HASH>..<HASH> 100644
--- a/lib/jets/resource/api_gateway/method.rb
+++ b/lib/jets/resource/api_gateway/method.rb
@@ -10,7 +10,6 @@ module Jets::Resource::ApiGateway
# route - Jets::Route
def initialize(route)
@route = route
- super() # super initializer takes 0 arguments
end
def definition
diff --git a/lib/jets/resource/api_gateway/resource.rb b/lib/jets/resource/api_gateway/resource.rb
index <HASH>..<HASH> 100644
--- a/lib/jets/resource/api_gateway/resource.rb
+++ b/lib/jets/resource/api_gateway/resource.rb
@@ -2,7 +2,6 @@ module Jets::Resource::ApiGateway
class Resource < Jets::Resource::Base
def initialize(path)
@path = path # Examples: "posts/:id/edit" or "posts"
- super() # super initializer takes no arguments
end
def definition | add attr_reader :definition, :replacements to simplify initializer | tongueroo_jets | train | rb,rb |
7ee7d7fa67474c9473333e3f78c7611adf02a7b5 | diff --git a/src/Preload.js b/src/Preload.js
index <HASH>..<HASH> 100644
--- a/src/Preload.js
+++ b/src/Preload.js
@@ -250,7 +250,10 @@ html2canvas.Preload = function(element, opts){
// load <img> images
for (i = 0; i < imgLen; i+=1){
- methods.loadImage( domImages[i].getAttribute( "src" ) );
+ var imgSrc = domImages[i].getAttribute( "src" );
+ if ( imgSrc ) {
+ methods.loadImage( imgSrc );
+ }
}
// remove 'start' | It is possible for image tags not to have a 'src' (or background-image) attribute specified. This case currently crashes html2canvas. I know its an edge case but it bit me. I set the image src programatically much later (element is actually not visible at the time I call html2canvas). | niklasvh_html2canvas | train | js |
eca7b6bd1a6094ec6f86e59707afa830f45e287f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -30,6 +30,7 @@ setup(
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3.3',
),
tests_require=read_requires('./tools/test-requires'),
install_requires=read_requires('./tools/pip-requires'), | Adding Python <I> to setup.py | jmvrbanac_Specter | train | py |
c8ce9fa92ff9bb1f05a6ceed21ffd7fe2e52931e | diff --git a/tests/AbstractTestCase.php b/tests/AbstractTestCase.php
index <HASH>..<HASH> 100644
--- a/tests/AbstractTestCase.php
+++ b/tests/AbstractTestCase.php
@@ -33,6 +33,6 @@ abstract class AbstractTestCase extends AbstractPackageTestCase
return $this->{$property};
};
- return $propertyAccessor->call($object, $property);
+ return $propertyAccessor->bindTo($object, $object)($property);
}
} | Ensure compatability with PHP 5
Closure::call was introduced in PHP 7 | bugsnag_bugsnag-laravel | train | php |
8a3a741769ca38b1f7bff0a07176e1e3c773a66d | diff --git a/lib/safe_yaml/transform/to_integer.rb b/lib/safe_yaml/transform/to_integer.rb
index <HASH>..<HASH> 100644
--- a/lib/safe_yaml/transform/to_integer.rb
+++ b/lib/safe_yaml/transform/to_integer.rb
@@ -10,8 +10,8 @@ module SafeYAML
def transform?(value)
MATCHERS.each_with_index do |matcher, idx|
- value = value.gsub("_", "") if idx == 0
- return true, Integer(value.gsub(",", "")) if matcher.match(value)
+ value = value.gsub(/[_,]/, "") if idx == 0
+ return true, Integer(value) if matcher.match(value)
end
try_edge_cases?(value)
end | updated ToInteger#transform? to only do gsub where appropriate
This is marginally more efficient since it no longer performs a superfluous
gsub for every matcher. | dtao_safe_yaml | train | rb |
ed3a53ead5789965e1943dbb02b86dfc5afbaa7b | diff --git a/lib/menilite/version.rb b/lib/menilite/version.rb
index <HASH>..<HASH> 100644
--- a/lib/menilite/version.rb
+++ b/lib/menilite/version.rb
@@ -1,3 +1,3 @@
module Menilite
- VERSION = "0.5.7"
+ VERSION = "0.5.8"
end | Bump menilite to <I> | youchan_menilite | train | rb |
2cca3cbdc1852147d652be176793ed3c26e33faa | diff --git a/builder/pattern_assembler.js b/builder/pattern_assembler.js
index <HASH>..<HASH> 100644
--- a/builder/pattern_assembler.js
+++ b/builder/pattern_assembler.js
@@ -125,11 +125,6 @@
console.log('processPatternIterative:', 'filename:', filename);
// skip non-pattern files
- //ignore dotfiles and non-variant .json files
- if(filename.charAt(0) === '.' || (ext === '.json' && filename.indexOf('~') === -1)){
- return;
- }
-
if (!isPatternFile(filename, patternlab)) { return; }
console.log('found pattern', file); | eliminate redundant "is this really a pattern" checking | pattern-lab_patternengine-node-underscore | train | js |
318e844272dff8498acd050639e6778e673691b9 | diff --git a/core/ClientController.js b/core/ClientController.js
index <HASH>..<HASH> 100644
--- a/core/ClientController.js
+++ b/core/ClientController.js
@@ -433,7 +433,16 @@ class ClientController extends EventEmitter {
};
this._history = new History();
- this._history.on(this._historyListener);
+ var init = () => this._history.on(this._historyListener);
+
+ // Need to go _after_ 'load' callbacks complete.
+ // Safari fires a 'popstate' on load (RED-67600).
+ // https://developer.mozilla.org/en-US/docs/Web/Events/popstate
+ if (document.readyState === 'complete'){
+ init();
+ } else {
+ window.addEventListener('load', ()=>setTimeout(init,0));
+ }
}
_setupLateArrivalHandler () { | Deal with browsers that fire popstate on load
We want consistent behavior across browsers, so this patch avoids the onload
'popstate' in browsers that fire it.
> Browsers tend to handle the popstate event differently on page load. Chrome
> (prior to <I>) and Safari always emit a popstate event on page load, but
> Firefox doesn't.
<URL>.
It likely _also_ addresses the blink on mobile search (RED-<I>). | redfin_react-server | train | js |
a11c5e0c266e5696e0ed51338f38c2d8d631dac2 | diff --git a/iterator.go b/iterator.go
index <HASH>..<HASH> 100644
--- a/iterator.go
+++ b/iterator.go
@@ -435,6 +435,7 @@ func (txn *Txn) NewKeyIterator(key []byte, opt IteratorOptions) *Iterator {
}
opt.Prefix = key // This key must be without the timestamp.
opt.prefixIsKey = true
+ opt.AllVersions = true
return txn.NewIterator(opt)
}
@@ -459,6 +460,9 @@ func (it *Iterator) Valid() bool {
if it.item == nil {
return false
}
+ if it.opt.prefixIsKey {
+ return bytes.Equal(it.item.key, it.opt.Prefix)
+ }
return bytes.HasPrefix(it.item.key, it.opt.Prefix)
} | Fix prefix bug in key iterator and allow all versions (#<I>)
The key iterator is supposed to iterate over all versions of the same
key but the current implementation would iterate over all keys with the
given prefix. For example, A key iterator for "foo" would return true
for "foo" and "foobar". This commit fixes the issue.
This commit also sets the value of `allVersions` to true in the key
iterator. | dgraph-io_badger | train | go |
d84420fc2f7602323d35d73f0e46438d4c1aef64 | diff --git a/specter/spec.py b/specter/spec.py
index <HASH>..<HASH> 100644
--- a/specter/spec.py
+++ b/specter/spec.py
@@ -1,3 +1,4 @@
+import sys
from random import shuffle
from time import time
from types import FunctionType
@@ -75,7 +76,12 @@ class Describe(EventDispatcher):
@property
def __members__(self):
- return {key: val for key, val in vars(type(self)).items()}
+ if sys.version_info<(2,7,0):
+ results = dict((key, val)
+ for key, val in vars(type(self)).items())
+ else:
+ results = {key: val for key, val in vars(type(self)).items()}
+ return results
@property
def describe_types(self): | Adding back-compatibility for dict comprehension | jmvrbanac_Specter | train | py |
6670cd12e36640c8916e88b5561f1645950aa0fc | diff --git a/exercises/9_todo_template/exercise.js b/exercises/9_todo_template/exercise.js
index <HASH>..<HASH> 100644
--- a/exercises/9_todo_template/exercise.js
+++ b/exercises/9_todo_template/exercise.js
@@ -28,7 +28,7 @@ var run = {
}
]
},
- expect: "<ul>\n<li>Tom\n<ul><li><b>URGENT</b>Learn Lo-Dash</li>\n<li>Become a Lo-Dash master</li>\n<li>Clean kitchen</li>\n</ul>\n</li>\n<li>Tim\n<ul><li><b>URGENT</b>Contribute to an Open-Source-Project</li>\n</ul>\n</li>\n</ul>"
+ expect: "<ul>\n<li>Tom\n<ul><li><b>URGENT</b> Learn Lo-Dash</li>\n<li>Become a Lo-Dash master</li>\n<li>Clean kitchen</li>\n</ul>\n</li>\n<li>Tim\n<ul><li><b>URGENT</b> Contribute to an Open-Source-Project</li>\n</ul>\n</li>\n</ul>"
}; | fix error in tests
without these spaces it's not possible to provide a solution.
neither solution from this project, nor mine passes tests without this fix. | mdunisch_lololodash | train | js |
59652d4c66e65f02614fafb5cbbfbb7d9c39a18a | diff --git a/src/Form/ProjectXSetup.php b/src/Form/ProjectXSetup.php
index <HASH>..<HASH> 100644
--- a/src/Form/ProjectXSetup.php
+++ b/src/Form/ProjectXSetup.php
@@ -52,8 +52,13 @@ class ProjectXSetup implements FormInterface
]);
if ($platform_options = $this->getPlatformOptions()) {
- $form->addField((new SelectField('platform', 'Select platform', false))
- ->setOptions($platform_options));
+ $platform_field = (new SelectField('platform', 'Select platform', false))
+ ->setOptions($platform_options);
+
+ if (count($platform_options) === 1) {
+ $platform_field->setDefault(key($platform_options));
+ }
+ $form->addField($platform_field);
}
$form->addFields([ | If only one platform then auto select it as the default. | droath_project-x | train | php |
ddd0431f77b9748f636f1501d7ece17ebdbf08ff | diff --git a/src/Model/Table/SavedSearchesTable.php b/src/Model/Table/SavedSearchesTable.php
index <HASH>..<HASH> 100644
--- a/src/Model/Table/SavedSearchesTable.php
+++ b/src/Model/Table/SavedSearchesTable.php
@@ -38,7 +38,15 @@ class SavedSearchesTable extends Table
const DELETE_OLDER_THAN = '-3 hours';
/**
+ * List of display fields to be skipped.
+ *
+ * @var array
+ */
+ protected $_skipDisplayFields = ['id'];
+
+ /**
* Search query default properties
+ *
* @var array
*/
protected $_queryDefaults = [
@@ -316,6 +324,10 @@ class SavedSearchesTable extends Table
// by default, all fields are searchable
$result = $collection->describe($table->table())->columns();
}
+ /*
+ skip display fields
+ */
+ $result = array_diff($result, $this->_skipDisplayFields);
return $result;
}
@@ -390,6 +402,10 @@ class SavedSearchesTable extends Table
}
}
}
+ /*
+ skip display fields
+ */
+ $result = array_diff($result, $this->_skipDisplayFields);
return $result;
} | define list of fields to skip for displaying on search results (task #<I>) | QoboLtd_cakephp-search | train | php |
f2d20521b63299cf171cb3385e508fdca405001c | diff --git a/tests/Maker/MakeAuthenticatorTest.php b/tests/Maker/MakeAuthenticatorTest.php
index <HASH>..<HASH> 100644
--- a/tests/Maker/MakeAuthenticatorTest.php
+++ b/tests/Maker/MakeAuthenticatorTest.php
@@ -342,6 +342,12 @@ class MakeAuthenticatorTest extends MakerTestCase
// plaintext password: needed for entities, simplifies overall
$runner->modifyYamlFile('config/packages/security.yaml', function (array $config) {
+ if (isset($config['when@test']['security']['password_hashers'])) {
+ $config['when@test']['security']['password_hashers'] = [PasswordAuthenticatedUserInterface::class => 'plaintext'];
+
+ return $config;
+ }
+
// legacy check for 5.2 and lower "encoders"
if (isset($config['security']['password_hashers'])) {
$config['security']['password_hashers'] = [PasswordAuthenticatedUserInterface::class => 'plaintext']; | [tests] handle when@test config in auth tests | symfony_maker-bundle | train | php |
Subsets and Splits