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
75f91bab5c4d2655f9149f9851c559b456be9299
diff --git a/pkg/fileutil/purge_test.go b/pkg/fileutil/purge_test.go index <HASH>..<HASH> 100644 --- a/pkg/fileutil/purge_test.go +++ b/pkg/fileutil/purge_test.go @@ -86,7 +86,7 @@ func TestPurgeFileHoldingLock(t *testing.T) { stop := make(chan struct{}) errch := PurgeFile(dir, "test", 3, time.Millisecond, stop) - time.Sleep(5 * time.Millisecond) + time.Sleep(20 * time.Millisecond) fnames, err := ReadDir(dir) if err != nil { @@ -112,7 +112,7 @@ func TestPurgeFileHoldingLock(t *testing.T) { t.Fatal(err) } - time.Sleep(5 * time.Millisecond) + time.Sleep(20 * time.Millisecond) fnames, err = ReadDir(dir) if err != nil {
pkg/fileutil: wait longer before checking purge results multiple cpu running may be slower than single cpu running, so it may take longer time to remove files. Increase from 5ms to <I>ms to give it enough time.
etcd-io_etcd
train
go
119966b82666a7856b45f0ff438b9e95f4546526
diff --git a/raiden_contracts/tests/test_channel_settle.py b/raiden_contracts/tests/test_channel_settle.py index <HASH>..<HASH> 100644 --- a/raiden_contracts/tests/test_channel_settle.py +++ b/raiden_contracts/tests/test_channel_settle.py @@ -439,6 +439,14 @@ def test_settle_wrong_state_fail( # Channel is settled call_settle(token_network, channel_identifier, A, vals_A, B, vals_B) + (settle_block_number, state) = token_network.functions.getChannelInfo( + channel_identifier, + A, + B, + ).call() + assert state == ChannelState.REMOVED + assert settle_block_number == 0 + def test_settle_wrong_balance_hash( web3,
Add post settle check (PR review) As mentioned <URL>
raiden-network_raiden-contracts
train
py
17b83109a740028b0ab4fc325ddbbb251524bc8a
diff --git a/lxd/instance/drivers/driver_qemu_templates.go b/lxd/instance/drivers/driver_qemu_templates.go index <HASH>..<HASH> 100644 --- a/lxd/instance/drivers/driver_qemu_templates.go +++ b/lxd/instance/drivers/driver_qemu_templates.go @@ -279,9 +279,10 @@ mem-path = "{{$hugepages}}" prealloc = "on" discard-data = "on" {{- else}} -qom-type = "memory-backend-ram" +qom-type = "memory-backend-memfd" {{- end }} size = "{{$memory}}M" +share = "on" [numa] type = "node"
lxd/instance/drivers: Change memory backend This changes the memory backend to memory-backend-memfd. Also, this turns on `share`. Both are required for virtio-fs.
lxc_lxd
train
go
77135f9d1d86f60f2bbbf9d5704fd3ef5ec717b4
diff --git a/lib/rack/passbook_rack.rb b/lib/rack/passbook_rack.rb index <HASH>..<HASH> 100644 --- a/lib/rack/passbook_rack.rb +++ b/lib/rack/passbook_rack.rb @@ -7,11 +7,7 @@ module Rack end def call(env) - if env['HTTP_AUTHORIZATION'] - parameters_duplicate = env['HTTP_AUTHORIZATION'].dup - parameters_duplicate.gsub!(/ApplePass /,'') - @parameters['authToken'] = parameters_duplicate - end + @parameters['authToken'] = env['HTTP_AUTHORIZATION'].gsub(/ApplePass /,'') if env['HTTP_AUTHORIZATION'] @parameters.merge!(Rack::Utils.parse_nested_query(env['QUERY_STRING'])) method_and_params = find_method env['PATH_INFO'] if method_and_params
more effective code to get AuthToken
frozon_passbook
train
rb
ef6a737aa960b65d7ee3357f3691aa8e41f47d69
diff --git a/helpers/blog_helper.php b/helpers/blog_helper.php index <HASH>..<HASH> 100644 --- a/helpers/blog_helper.php +++ b/helpers/blog_helper.php @@ -24,5 +24,33 @@ if ( ! function_exists( 'blog_setting' ) ) } } + +// -------------------------------------------------------------------------- + + +/** + * Get latest blog posts + * + * @access public + * @param none + * @return void + */ +if ( ! function_exists( 'blog_latest_posts' ) ) +{ + function blog_latest_posts( $limit = 9 ) + { + // Load the model if it's not already loaded + if ( ! get_instance()->load->model_is_loaded( 'post' ) ) : + + get_instance()->load->model( 'blog/blog_post_model', 'post' ); + + endif; + + // -------------------------------------------------------------------------- + + return get_instance()->post->get_latest( $limit ); + } +} + /* End of file blog_helper.php */ /* Location: ./modules/blog/helpers/blog_helper.php */ \ No newline at end of file
added blog_get_latest() helper.
nails_common
train
php
db47ea850722f731f9e14adbaaaed8cd8d16088d
diff --git a/plugins/UserCountry/VisitorGeolocator.php b/plugins/UserCountry/VisitorGeolocator.php index <HASH>..<HASH> 100644 --- a/plugins/UserCountry/VisitorGeolocator.php +++ b/plugins/UserCountry/VisitorGeolocator.php @@ -189,7 +189,7 @@ class VisitorGeolocator $this->logger->debug('Updating visit with idvisit = {idVisit} (IP = {ip}). Changes: {changes}', array( 'idVisit' => $idVisit, 'ip' => $ip, - 'changes' => $valuesToUpdate + 'changes' => json_encode($valuesToUpdate) )); $this->dao->updateVisits($valuesToUpdate, $idVisit); @@ -309,4 +309,4 @@ class VisitorGeolocator } return self::$defaultLocationCache; } -} \ No newline at end of file +}
GeoIP re-attribution: debug output now shows changes to visits geo-location (#<I>) Re-create <URL>
matomo-org_matomo
train
php
dc2c0d848e0735054d05012ed49ba45e8129523f
diff --git a/lib/client.js b/lib/client.js index <HASH>..<HASH> 100644 --- a/lib/client.js +++ b/lib/client.js @@ -182,7 +182,7 @@ extend(Raven.prototype, { var shouldSend = true; if (!this._enabled) shouldSend = false; - if (this.shouldSendCallback && !this.shouldSendCallback()) shouldSend = false; + if (this.shouldSendCallback && !this.shouldSendCallback(kwargs)) shouldSend = false; if (shouldSend) { this.send(kwargs, cb);
sending kwargs into shouldSendCallback() (#<I>)
getsentry_sentry-javascript
train
js
e6bb7f92eaa65f78f9c489898d2748ca8d2be743
diff --git a/simuvex/s_procedure.py b/simuvex/s_procedure.py index <HASH>..<HASH> 100644 --- a/simuvex/s_procedure.py +++ b/simuvex/s_procedure.py @@ -77,19 +77,22 @@ class SimProcedure(SimRun): raise SimProcedureError("Unsupported calling convention %s for arguments", self.convention) + def get_arg_value(self, index): + return self.state.expr_value(self.get_arg_expr(index)) + # Sets an expression as the return value. Also updates state. def set_return_expr(self, expr): if self.state.arch.name == "AMD64": self.state.store_reg(16, expr) - else: - raise SimProcedureError("Unsupported calling convention %s for returns", self.convention) + else: + raise SimProcedureError("Unsupported calling convention %s for returns", self.convention) # Does a return (pop, etc) and returns an bitvector expression representing the return value. Also updates state. def do_return(self): if self.state.arch.name == "AMD64": return self.state.stack_pop() - else: - raise SimProcedureError("Unsupported platform %s for return emulation.", self.state.arch.name) + else: + raise SimProcedureError("Unsupported platform %s for return emulation.", self.state.arch.name) # Adds an exit representing the function returning. Modifies the state. def exit_return(self, expr=None):
fixed spacing, added get_arg_value
angr_angr
train
py
78318d79240ba228f1e7863a4a19ad4b25b63b85
diff --git a/generators/gae/index.js b/generators/gae/index.js index <HASH>..<HASH> 100644 --- a/generators/gae/index.js +++ b/generators/gae/index.js @@ -23,6 +23,7 @@ const execSync = require('child_process').execSync; const chalk = require('chalk'); const _ = require('lodash'); const BaseGenerator = require('../generator-base'); +const statistics = require('../statistics'); const constants = require('../generator-constants'); @@ -497,8 +498,7 @@ module.exports = class extends BaseGenerator { get configuring() { return { insight() { - const insight = this.insight(); - insight.trackWithEvent('generator', 'gae'); + statistics.sendSubGenEvent('generator', 'gae'); }, configureProject() {
Use the new statistics mechanism for GAE
jhipster_generator-jhipster
train
js
64b6f68b45b6453c4b4dbd6749533c1dad2e8dc5
diff --git a/salt/renderers/json_mako.py b/salt/renderers/json_mako.py index <HASH>..<HASH> 100644 --- a/salt/renderers/json_mako.py +++ b/salt/renderers/json_mako.py @@ -36,7 +36,7 @@ def render(template_file, env='', sls=''): # Ensure that we're not passing lines with a shebang in the JSON. to_return = [] for line in tmp_data['data'].split('\n'): - if line and line[0] != '#!': + if line and "#!" not in line: to_return.append(line) to_return = '\n'.join(to_return)
improved the shebang removal for JSON
saltstack_salt
train
py
d58ca9720725219fd25a4145b8b5adbe1ed2ebc5
diff --git a/docker/models/images.py b/docker/models/images.py index <HASH>..<HASH> 100644 --- a/docker/models/images.py +++ b/docker/models/images.py @@ -84,9 +84,9 @@ class Image(Model): Example: - >>> image = cli.get_image("busybox:latest") + >>> image = cli.images.get("busybox:latest") >>> f = open('/tmp/busybox-latest.tar', 'wb') - >>> for chunk in image: + >>> for chunk in image.save(): >>> f.write(chunk) >>> f.close() """
[DOCS] Update the Image.save documentation with a working example. Issue #<I>
docker_docker-py
train
py
9bb4a001f61b5e660788e407aea479eb3137ef85
diff --git a/src/main/java/de/cinovo/cloudconductor/api/IRestPath.java b/src/main/java/de/cinovo/cloudconductor/api/IRestPath.java index <HASH>..<HASH> 100644 --- a/src/main/java/de/cinovo/cloudconductor/api/IRestPath.java +++ b/src/main/java/de/cinovo/cloudconductor/api/IRestPath.java @@ -188,7 +188,7 @@ public interface IRestPath { /** * approve the started state of a service */ - public static final String SERVICE_APPROVE_STARTED = "/{" + IRestPath.VAR_SERVICE + "}/approvestarted/{" + IRestPath.VAR_PKG + "}"; + public static final String SERVICE_APPROVE_STARTED = "/{" + IRestPath.VAR_SERVICE + "}/approvestarted/{" + IRestPath.VAR_HOST + "}"; // ------------------------------------------------------- // SSH KEY
fixes the path for approveServiceStarted in service interface
cinovo_cloudconductor-api
train
java
04af583e9e711436d8a21250ba9dc8e9a0da7ab0
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,4 @@ -export { Alert } from './alert' +export { Alert, InlineAlert } from './alert' export { Autocomplete, AutocompleteItem } from './autocomplete' export { Avatar } from './avatar' export { BadgeAppearances, Badge, Pill } from './badges'
Fix the InlineAlert export
segmentio_evergreen
train
js
23aac9e9ecfd80630a21bbfa7ee6b772a21478f1
diff --git a/netty/src/main/java/io/grpc/transport/netty/NettyServer.java b/netty/src/main/java/io/grpc/transport/netty/NettyServer.java index <HASH>..<HASH> 100644 --- a/netty/src/main/java/io/grpc/transport/netty/NettyServer.java +++ b/netty/src/main/java/io/grpc/transport/netty/NettyServer.java @@ -121,7 +121,7 @@ public class NettyServer implements Server { @Override public void shutdown() { - if (channel == null || channel.isOpen()) { + if (channel == null || !channel.isOpen()) { return; } channel.close().addListener(new ChannelFutureListener() {
Fix netty closure check During Service removal a condition was inverted but incompletely, which caused the Netty server to never shutdown.
grpc_grpc-java
train
java
37a8cbde92d183e67b8b0a23de615576a5e47f46
diff --git a/subprojects/groovy-xml/src/main/java/groovy/xml/dom/DOMCategory.java b/subprojects/groovy-xml/src/main/java/groovy/xml/dom/DOMCategory.java index <HASH>..<HASH> 100644 --- a/subprojects/groovy-xml/src/main/java/groovy/xml/dom/DOMCategory.java +++ b/subprojects/groovy-xml/src/main/java/groovy/xml/dom/DOMCategory.java @@ -37,7 +37,6 @@ import javax.xml.xpath.XPath; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Iterator; @@ -585,4 +584,4 @@ public class DOMCategory { return nodes.get(index); } } -} \ No newline at end of file +}
Remove unused imports from DOMCategory. Testing the waters for committer access.
apache_groovy
train
java
978c09c9e6677cfd4d609145a8793b34dccfb1f8
diff --git a/xclim/ensembles/_robustness.py b/xclim/ensembles/_robustness.py index <HASH>..<HASH> 100644 --- a/xclim/ensembles/_robustness.py +++ b/xclim/ensembles/_robustness.py @@ -6,7 +6,7 @@ Ensemble Robustness metrics. Robustness metrics are used to estimate the confidence of the climate change signal of an ensemble. This submodule is inspired by and tries to follow the guidelines of the IPCC, more specifically the 12th chapter of the Working Group 1's contribution to -the AR5 (:footcite:p:`collins_long-term_2013`, see box 12.1). +the AR5 :cite:p:`collins_long-term_2013` (see box 12.1). """ from __future__ import annotations diff --git a/xclim/indices/_agro.py b/xclim/indices/_agro.py index <HASH>..<HASH> 100644 --- a/xclim/indices/_agro.py +++ b/xclim/indices/_agro.py @@ -465,7 +465,7 @@ def cool_night_index( References ---------- - :footcite:cts:`tonietto_multicriteria_2004` + :cite:cts:`tonietto_multicriteria_2004` """ tasmin = convert_units_to(tasmin, "degC")
Fix artefact `footcite` directives that were causing failures on LaTeX builds
Ouranosinc_xclim
train
py,py
013006cd1c93c8d96ccd29deaedeb7605e6b6530
diff --git a/user-switching.php b/user-switching.php index <HASH>..<HASH> 100644 --- a/user-switching.php +++ b/user-switching.php @@ -182,7 +182,7 @@ class user_switching { } else { wp_safe_redirect( add_query_arg( $args, admin_url() ) ); } - die(); + exit; } else { wp_die( esc_html__( 'Could not switch users.', 'user-switching' ) ); @@ -224,7 +224,7 @@ class user_switching { } else { wp_safe_redirect( add_query_arg( $args, admin_url( 'users.php' ) ) ); } - die(); + exit; } else { wp_die( esc_html__( 'Could not switch users.', 'user-switching' ) ); } @@ -252,7 +252,7 @@ class user_switching { } else { wp_safe_redirect( add_query_arg( $args, home_url() ) ); } - die(); + exit; } else { /* Translators: "switch off" means to temporarily log out */ wp_die( esc_html__( 'Could not switch off.', 'user-switching' ) );
Standardise on `exit` instead of `die()`.
johnbillion_user-switching
train
php
4f05cf7b1365a2955f0d570dc21002492a5a1227
diff --git a/xapian_backend.py b/xapian_backend.py index <HASH>..<HASH> 100755 --- a/xapian_backend.py +++ b/xapian_backend.py @@ -17,7 +17,7 @@ from django.core.exceptions import ImproperlyConfigured from django.utils.encoding import smart_unicode, force_unicode from haystack.backends import BaseSearchBackend, BaseSearchQuery, SearchNode, log_query -from haystack.exceptions import HaystackError, MissingDependency +from haystack.exceptions import HaystackError, MissingDependency, MoreLikeThisError from haystack.fields import DateField, DateTimeField, IntegerField, FloatField, BooleanField, MultiValueField from haystack.models import SearchResult from haystack.utils import get_identifier
Import MoreLikeThisError. This resolves issue <I>
notanumber_xapian-haystack
train
py
0bb37aafda60f79abe0d4aa4c04f43262c577e2a
diff --git a/src/views/Flat.js b/src/views/Flat.js index <HASH>..<HASH> 100644 --- a/src/views/Flat.js +++ b/src/views/Flat.js @@ -51,11 +51,9 @@ var planeCmp = [ ]; // A zoom of exactly 0 breaks some computations, so we force a minimum positive -// value. We use 9 decimal places for the epsilon value since this is the -// maximum number of significant digits for a 32-bit floating-point number. -// Note that after a certain zoom level, rendering quality will be affected -// by the loss of precision in floating-point computations. -var zoomLimitEpsilon = 0.000000001; +// value. We use 6 decimal places for the epsilon value to avoid broken +// rendering due to loss of precision in floating point computations. +var zoomLimitEpsilon = 0.000001; /**
Use a more conservative value for the min/max zoom epsilon. We had already done this for RectilinearView, but not for FlatView.
google_marzipano
train
js
a44ab6759fb6f3f33f65bee93ed8870388cc405c
diff --git a/src/com/google/javascript/jscomp/parsing/ParserRunner.java b/src/com/google/javascript/jscomp/parsing/ParserRunner.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/parsing/ParserRunner.java +++ b/src/com/google/javascript/jscomp/parsing/ParserRunner.java @@ -101,7 +101,7 @@ public final class ParserRunner { Node root = null; List<Comment> comments = ImmutableList.of(); FeatureSet features = p.getFeatures(); - if (tree != null && (!es6ErrorReporter.hadError() || config.preserveDetailedSourceInfo)) { + if (tree != null && (!es6ErrorReporter.hadError() || config.keepGoing)) { IRFactory factory = IRFactory.transformTree(tree, sourceFile, sourceString, config, errorReporter); root = factory.getResultNode();
Fix one more spot where we were reading the wrong IDE mode flag. ------------- Created by MOE: <URL>
google_closure-compiler
train
java
66c43152abc0c5780e5f50c865d2727f05835985
diff --git a/svg/charts/line.py b/svg/charts/line.py index <HASH>..<HASH> 100644 --- a/svg/charts/line.py +++ b/svg/charts/line.py @@ -28,6 +28,10 @@ class Line(Graph): stylesheet_names = Graph.stylesheet_names + ['plot.css'] + def __init__(self, fields, *args, **kargs): + self.fields = fields + super(Line, self).__init__(*args, **kargs) + def max_value(self): data = map(itemgetter('data'), self.data) if self.stacked: @@ -72,10 +76,11 @@ class Line(Graph): scale_division = self.scale_divisions or (scale_range / 10.0) if self.scale_integers: - scale_division = min(1, round(scale_division)) - - if max_value % scale_division == 0: + scale_division = max(1, round(scale_division)) + + if max_value % scale_division != 0: max_value += scale_division + labels = tuple(float_range(min_value, max_value, scale_division)) return labels
Thanks to Emmanuel Blot for patch: * Adds dedicated initializer to line.py consistent with bar.py to define the fields. * Corrected buggy logic in y-axis label rendering.
jaraco_svg.charts
train
py
4a451a2044902b8953f56729738bcff4ead3b339
diff --git a/Nf/Front/Response/Http.php b/Nf/Front/Response/Http.php index <HASH>..<HASH> 100644 --- a/Nf/Front/Response/Http.php +++ b/Nf/Front/Response/Http.php @@ -236,9 +236,16 @@ class Http extends AbstractResponse // sends header to allow the browser to cache the response a given time public function setCacheable($minutes) { - $this->setHeader('Expires', gmdate('D, d M Y H:i:s', time() + $minutes * 60) . ' GMT', true); - $this->setHeader('Cache-Control', 'max-age=' . $minutes * 60, true); - $this->setHeader('Pragma', 'public', true); + if($minutes <= 0) { + $this->setHeader('Cache-Control', 'private, no-cache, no-store, must-revalidate'); + $this->setHeader('Expires', '-1'); + $this->setHeader('Pragma', 'no-cache'); + } + else { + $this->setHeader('Expires', gmdate('D, d M Y H:i:s', time() + $minutes * 60) . ' GMT', true); + $this->setHeader('Cache-Control', 'max-age=' . $minutes * 60, true); + $this->setHeader('Pragma', 'public', true); + } } public function getContentType()
setCacheable 0 for no-cache
jarnix_nofussframework
train
php
8c37aeb5537c3917d4ccc843071ab8b80aa6a60b
diff --git a/lib/rabl/version.rb b/lib/rabl/version.rb index <HASH>..<HASH> 100644 --- a/lib/rabl/version.rb +++ b/lib/rabl/version.rb @@ -1,3 +1,3 @@ module Rabl - VERSION = "0.1.0" + VERSION = "0.1.1" end
Bumped to version <I>
nesquena_rabl
train
rb
2fefb8137c63cb6c729796d18a6ee7c634ff537b
diff --git a/dp_tornado/helper/web/url/__init__.py b/dp_tornado/helper/web/url/__init__.py index <HASH>..<HASH> 100644 --- a/dp_tornado/helper/web/url/__init__.py +++ b/dp_tornado/helper/web/url/__init__.py @@ -133,7 +133,13 @@ class UrlHelper(dpHelper): return self.unquote(*args, **kwargs) def quote(self, e, safe='', **kwargs): - return requests.utils.quote(e, safe=safe, **kwargs) + if self.helper.misc.system.py_version <= 2: + return requests.utils.quote(e, safe=safe) + else: + return requests.utils.quote(e, safe=safe, **kwargs) def unquote(self, e, **kwargs): - return requests.utils.unquote(e, **kwargs) + if self.helper.misc.system.py_version <= 2: + return requests.utils.unquote(e) + else: + return requests.utils.unquote(e, **kwargs)
python 2 and 3 compatibility.
why2pac_dp-tornado
train
py
0828074ee147c436bbe27fe1e83a26342bd7951f
diff --git a/spec/provider/gae_spec.rb b/spec/provider/gae_spec.rb index <HASH>..<HASH> 100644 --- a/spec/provider/gae_spec.rb +++ b/spec/provider/gae_spec.rb @@ -8,7 +8,7 @@ describe DPL::Provider::GAE do describe '#push_app' do example 'with defaults' do - allow(provider.context).to receive(:shell).with("#{DPL::Provider::GAE::GCLOUD} --quiet --verbosity \"warning\" --project \"test\" app deploy \"app.yaml\" --version \"\" --promote").and_return(true) + allow(provider.context).to receive(:shell).with("#{DPL::Provider::GAE::GCLOUD} --quiet --verbosity \"warning\" --project \"test\" app deploy \"app.yaml\" --promote").and_return(true) provider.push_app end end
Modify the test case of gae for #<I> If user didn't speicify the version, we should use empty string instead of `--version=""`
travis-ci_dpl
train
rb
2867ef3be5f0ab48663c5ddfd28ccf824612d8a8
diff --git a/spring-data-simpledb-impl/src/main/java/org/springframework/data/simpledb/repository/support/SimpleSimpleDbRepository.java b/spring-data-simpledb-impl/src/main/java/org/springframework/data/simpledb/repository/support/SimpleSimpleDbRepository.java index <HASH>..<HASH> 100644 --- a/spring-data-simpledb-impl/src/main/java/org/springframework/data/simpledb/repository/support/SimpleSimpleDbRepository.java +++ b/spring-data-simpledb-impl/src/main/java/org/springframework/data/simpledb/repository/support/SimpleSimpleDbRepository.java @@ -57,6 +57,8 @@ public class SimpleSimpleDbRepository<T, ID extends Serializable> implements Sim * @param simpledbOperations */ public SimpleSimpleDbRepository(SimpleDbEntityInformation<T, ?> entityInformation, SimpleDbOperations<T, ?> simpledbOperations) { + Assert.notNull(simpledbOperations); + this.operations = simpledbOperations; Assert.notNull(entityInformation);
not null assert on simple db operations
3pillarlabs_spring-data-simpledb
train
java
4954e72437b9691d0764f7f1ca355818cea3c90c
diff --git a/src/oidcservice/oauth2/service.py b/src/oidcservice/oauth2/service.py index <HASH>..<HASH> 100644 --- a/src/oidcservice/oauth2/service.py +++ b/src/oidcservice/oauth2/service.py @@ -279,11 +279,17 @@ class ProviderInfoDiscovery(Service): self.service_context.issuer = _pcr_issuer self.service_context.provider_info = resp - for key, val in resp.items(): - if key.endswith("_endpoint"): - for _srv in self.service_context.service.values(): - if _srv.endpoint_name == key: - _srv.endpoint = val + try: + _srvs = self.service_context.service + except AttributeError: + pass + else: + if self.service_context.service: + for key, val in resp.items(): + if key.endswith("_endpoint"): + for _srv in self.service_context.service.values(): + if _srv.endpoint_name == key: + _srv.endpoint = val try: kj = self.service_context.keyjar
If services are not stored in the service_context don't try to access them.
openid_JWTConnect-Python-OidcService
train
py
073d4cd1da2c718869d4ce96066e486f17e7eea1
diff --git a/abydos/_compat.py b/abydos/_compat.py index <HASH>..<HASH> 100644 --- a/abydos/_compat.py +++ b/abydos/_compat.py @@ -37,11 +37,11 @@ if sys.version_info[0] == 3: # pragma: no cover _range = range _unicode = str _unichr = chr - numeric_type = (int, float, complex) _long = int + numeric_type = (int, float, complex) else: # pragma: no cover _range = xrange _unicode = unicode _unichr = unichr - numeric_type = (int, long, float, complex) _long = long + numeric_type = (int, long, float, complex)
re-ordered definition in order to match description
chrislit_abydos
train
py
9cb63fcec9416963375adff9f22117281b250391
diff --git a/Service/GearmanClient.php b/Service/GearmanClient.php index <HASH>..<HASH> 100644 --- a/Service/GearmanClient.php +++ b/Service/GearmanClient.php @@ -281,7 +281,7 @@ class GearmanClient extends AbstractGearmanService public function callJob($name, $params = '', $unique = null) { $worker = $this->getJob($name); - $methodCallable = $worker['job']['defaultMethod'] . 'Job'; + $methodCallable = $worker['job']['defaultMethod']; return $this->enqueue($name, $params, $methodCallable, $unique); }
Fixed #<I>. Removed obsolete ‘Job’ concatenation in callJob
mmoreram_GearmanBundle
train
php
217b358b5e4b2cb0599b01bfc823ba298f00dbc8
diff --git a/packages/pageflow/src/editor/views/EditorView.js b/packages/pageflow/src/editor/views/EditorView.js index <HASH>..<HASH> 100644 --- a/packages/pageflow/src/editor/views/EditorView.js +++ b/packages/pageflow/src/editor/views/EditorView.js @@ -54,6 +54,7 @@ export const EditorView = Backbone.View.extend({ resizerTip: I18n.t('pageflow.editor.views.editor_views.resize_editor'), enableCursorHotkey: false, fxName: 'none', + maskIframesOnResize: true, onresize: function() { app.trigger('resize'); @@ -74,4 +75,4 @@ export const EditorView = Backbone.View.extend({ event.stopPropagation(); } } -}); \ No newline at end of file +});
Ensure resizing editor sidebar works over iframes The option prevents iframes from capturing mouse events, which can cause the dragged resizer to get stuck. This used to be a problem already with rich text editors, which are iframes. Now that the preview uses an iframe the problem got worse. REDMINE-<I>
codevise_pageflow
train
js
c6359595a0860b867502f8494384772779100f4b
diff --git a/tests/testmagics.py b/tests/testmagics.py index <HASH>..<HASH> 100644 --- a/tests/testmagics.py +++ b/tests/testmagics.py @@ -16,6 +16,7 @@ class ExtensionTestCase(IPTestCase): self.ip.run_line_magic("load_ext", "holoviews.ipython") def tearDown(self): + Store._custom_options = {k:{} for k in Store._custom_options.keys()} self.ip.run_line_magic("unload_ext", "holoviews.ipython") del self.ip super(ExtensionTestCase, self).tearDown()
Added custom tree teardown to testmagics.py
pyviz_holoviews
train
py
09fe93505b73c89d68369d6dd69e2d9ab7275df5
diff --git a/src/deckgrid.js b/src/deckgrid.js index <HASH>..<HASH> 100644 --- a/src/deckgrid.js +++ b/src/deckgrid.js @@ -47,7 +47,8 @@ angular.module('akoenig.deckgrid').factory('Deckgrid', [ // // Register model change. // - watcher = this.$$scope.$watch('model', this.$$onModelChange.bind(this), true); + watcher = this.$$scope.$watchCollection('model', this.$$onModelChange.bind(this)); + this.$$watchers.push(watcher); //
Switched from $watch to $watchCollection in order to gain a bit more performance.
akoenig_angular-deckgrid
train
js
abe8915dedee82c0a0723955c7d3b5bc181a4f25
diff --git a/core-bundle/src/Resources/contao/library/Contao/Model.php b/core-bundle/src/Resources/contao/library/Contao/Model.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/library/Contao/Model.php +++ b/core-bundle/src/Resources/contao/library/Contao/Model.php @@ -287,7 +287,7 @@ abstract class Model // Update the model data from the DB record (might be modified by default values or triggers) $res = \Database::getInstance()->prepare("SELECT * FROM " . static::$strTable . " WHERE " . static::$strPk . "=?") - ->execute($this->{static::$strPk}); + ->executeUncached($this->{static::$strPk}); $this->setRow($res->row()); return $this;
[Core] Use `executeUncached()` when refreshing the model data
contao_contao
train
php
0ced29acf4d4a3fec3cfa2c6dc4426f354ac6ace
diff --git a/collectors/languages.php b/collectors/languages.php index <HASH>..<HASH> 100644 --- a/collectors/languages.php +++ b/collectors/languages.php @@ -105,7 +105,7 @@ class QM_Collector_Languages extends QM_Collector { $this->data['languages'][ $domain ][] = array( 'caller' => $caller, - 'domain' => $domain . ' / ' . $handle, + 'domain' => $domain, 'file' => $file, 'found' => ( $file && file_exists( $file ) ) ? filesize( $file ) : false, 'handle' => $handle,
Don't unnecessarily expose the script handle as part of the script translation textdomain.
johnbillion_query-monitor
train
php
eb8e0dabc1fecab3547c20de2ad930c1c99597ff
diff --git a/src/Config.php b/src/Config.php index <HASH>..<HASH> 100644 --- a/src/Config.php +++ b/src/Config.php @@ -73,7 +73,9 @@ class Config const E_CUSTOMER_A_EMAIL = 'email'; const E_CUSTOMER_A_ENTITY_ID = self::E_COMMON_A_ENTITY_ID; const E_CUSTOMER_A_FIRSTNAME = 'firstname'; + const E_CUSTOMER_A_GROUP_ID = 'group_id'; const E_CUSTOMER_A_LASTNAME = 'lastname'; + const E_CUSTOMER_A_PASS_HASH = 'password_hash'; const E_CUSTOMER_A_WEBSITE_ID = 'website_id'; const E_PRODUCT_A_ATTR_SET_ID = 'attribute_set_id'; const E_PRODUCT_A_CRETED_AT = 'created_at';
MOBI-<I> - CLI commands for bonus cfg
praxigento_mobi_mod_core
train
php
a92f74447948558b98bce14e725df7c78095703a
diff --git a/test/dsl_test.go b/test/dsl_test.go index <HASH>..<HASH> 100644 --- a/test/dsl_test.go +++ b/test/dsl_test.go @@ -287,6 +287,12 @@ func initRoot() fileOp { }, IsInit} } +func custom(f func(func(fileOp) error) error) fileOp { + return fileOp{func(c *ctx) error { + return f(func(fop fileOp) error { return fop.operation(c) }) + }, Defaults} +} + func mkdir(name string) fileOp { return fileOp{func(c *ctx) error { _, _, err := c.getNode(name, createDir, resolveAllSyms) @@ -299,12 +305,16 @@ func write(name string, contents string) fileOp { } func writeBS(name string, contents []byte) fileOp { + return pwriteBS(name, contents, 0) +} + +func pwriteBS(name string, contents []byte, off int64) fileOp { return fileOp{func(c *ctx) error { f, _, err := c.getNode(name, createFile, resolveAllSyms) if err != nil { return err } - return c.engine.WriteFile(c.user, f, contents, 0, true) + return c.engine.WriteFile(c.user, f, contents, off, true) }, Defaults} }
test: Add operations custom and pwriteBS
keybase_client
train
go
912e8ad25e2f278c4331f9d47e0fe5991de84319
diff --git a/source/org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.java b/source/org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.java index <HASH>..<HASH> 100644 --- a/source/org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.java +++ b/source/org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.java @@ -55,7 +55,7 @@ public class OutgoingFileTransfer extends FileTransfer { * @param responseTimeout * The timeout time in milliseconds. */ - public void setResponseTimeout(int responseTimeout) { + public static void setResponseTimeout(int responseTimeout) { RESPONSE_TIMEOUT = responseTimeout; } @@ -262,7 +262,6 @@ public class OutgoingFileTransfer extends FileTransfer { } } setException(e); - return; } /**
Setter for response timeout was not static. git-svn-id: <URL>
igniterealtime_Smack
train
java
fa8485b59970b68d8206aa880b473b804ef7c8f3
diff --git a/moto/ec2/models.py b/moto/ec2/models.py index <HASH>..<HASH> 100644 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -7,6 +7,7 @@ from boto.ec2.spotinstancerequest import SpotInstanceRequest as BotoSpotRequest from boto.ec2.launchspecification import LaunchSpecification from moto.core import BaseBackend +from moto.core.models import Model from .exceptions import ( InvalidIdError, DependencyViolationError, @@ -933,6 +934,8 @@ class SpotInstanceRequest(BotoSpotRequest): class SpotRequestBackend(object): + __metaclass__ = Model + def __init__(self): self.spot_instance_requests = {} super(SpotRequestBackend, self).__init__() @@ -955,6 +958,7 @@ class SpotRequestBackend(object): requests.append(request) return requests + @Model.prop('SpotInstanceRequest') def describe_spot_instance_requests(self): return self.spot_instance_requests.values()
provide SpotRequestBackend with model accessor
spulec_moto
train
py
b845983549550ee09bc5ca3227469220ef14eb7a
diff --git a/examples/helloworld/Client.java b/examples/helloworld/Client.java index <HASH>..<HASH> 100644 --- a/examples/helloworld/Client.java +++ b/examples/helloworld/Client.java @@ -32,7 +32,7 @@ public class Client { */ org.voltdb.client.Client myApp; myApp = ClientFactory.createClient(); - myApp.createConnection("localhost", "program", "password"); + myApp.createConnection("localhost"); /* * Load the database.
Update the Hello World client to match the new connection syntax.
VoltDB_voltdb
train
java
9bf713ad673f0c43f28e1256245623e93af2a538
diff --git a/templates/add-ons.php b/templates/add-ons.php index <HASH>..<HASH> 100755 --- a/templates/add-ons.php +++ b/templates/add-ons.php @@ -198,7 +198,7 @@ $is_allowed_to_install = ( $fs->is_allowed_to_install() || - ( $fs->is_org_repo_compliant() && $is_free_only_wp_org_compliant ) + $is_free_only_wp_org_compliant ); $show_premium_activation_or_installation_action = true;
[add-ons] Any plugin can install free wp.org add-ons, regardless if it is on wp.org or not.
Freemius_wordpress-sdk
train
php
739fa603a2ffc02cf3ce767863b7250cf2d2f21d
diff --git a/escodegen.js b/escodegen.js index <HASH>..<HASH> 100644 --- a/escodegen.js +++ b/escodegen.js @@ -269,7 +269,7 @@ case Syntax.AssignmentExpression: result = parenthesize( - generateExpression(expr.left) + ' ' + expr.operator + ' ' + + generateExpression(expr.left, Precedence.Call) + ' ' + expr.operator + ' ' + generateExpression(expr.right, Precedence.Assignment), Precedence.Assignment, precedence @@ -705,7 +705,7 @@ } else { previousBase = base; base += indent; - result += generateExpression(stmt.left); + result += generateExpression(stmt.left, Precedence.Call); base = previousBase; }
handle LHS in for-in and assignment correctly
estools_escodegen
train
js
40232544a4b25508cfa9455bf064d85ef5286604
diff --git a/cli/helpers.go b/cli/helpers.go index <HASH>..<HASH> 100644 --- a/cli/helpers.go +++ b/cli/helpers.go @@ -283,7 +283,7 @@ func queryService(c *cli.Context) { request = map[string]interface{}{ "service": service, "method": method, - "request": []byte(strings.Join(c.Args()[2:], " ")), + "request": strings.Join(c.Args()[2:], " "), } b, err := json.Marshal(request)
Why the heck I was turning that into bytes...
micro_micro
train
go
e604108c47c1e143f890e77237675c34b53cc9d5
diff --git a/src/Charcoal/Admin/Widget/AttachmentWidget.php b/src/Charcoal/Admin/Widget/AttachmentWidget.php index <HASH>..<HASH> 100644 --- a/src/Charcoal/Admin/Widget/AttachmentWidget.php +++ b/src/Charcoal/Admin/Widget/AttachmentWidget.php @@ -278,10 +278,10 @@ class AttachmentWidget extends AdminWidget implements /** * Set the widget's data. * - * @param array|Traversable $data The widget data. + * @param array $data The widget data. * @return self */ - public function setData($data) + public function setData(array $data) { /** * @todo Kinda hacky, but works with the concept of form.
Upgrade to latest charcoal-config's requirement, regarding `setData()`
locomotivemtl_charcoal-attachment
train
php
3893e1ac5ee46f70b6a490da64ae36b511d4c006
diff --git a/aaf2/metadict.py b/aaf2/metadict.py index <HASH>..<HASH> 100644 --- a/aaf2/metadict.py +++ b/aaf2/metadict.py @@ -409,14 +409,17 @@ class MetaDictionary(core.AAFObject): return c def lookup_class(self, class_id): - if class_id in AAFClaseID_dict: - return AAFClaseID_dict[class_id] + aaf_class = AAFClaseID_dict.get(class_id, None) + if aaf_class: + return aaf_class - if class_id in AAFClassName_dict: - return AAFClassName_dict[class_id] + aaf_class = AAFClassName_dict.get(class_id, None) + if aaf_class: + return aaf_class - if class_id in self.typedefs_classes: - return self.typedefs_classes[class_id] + aaf_class = self.typedefs_classes.get(class_id, None) + if aaf_class: + return aaf_class return core.AAFObject
don't lookup dict twice
markreidvfx_pyaaf2
train
py
c2581526044f224e4b70beb83373e6bf4f62c0ae
diff --git a/lib/airbrake-ruby.rb b/lib/airbrake-ruby.rb index <HASH>..<HASH> 100644 --- a/lib/airbrake-ruby.rb +++ b/lib/airbrake-ruby.rb @@ -287,7 +287,7 @@ module Airbrake # Airbrake.notify('fruitception') # end # - # def load_veggies + # def load_veggies(veggies) # Airbrake.merge_context(veggies: veggies) # end #
airbrake-ruby: fix error in #merge_context docs
airbrake_airbrake-ruby
train
rb
e6a7c213149d52488ff8dceac496781899fbaa0c
diff --git a/lib/event_source/controls/category.rb b/lib/event_source/controls/category.rb index <HASH>..<HASH> 100644 --- a/lib/event_source/controls/category.rb +++ b/lib/event_source/controls/category.rb @@ -13,7 +13,7 @@ module EventSource category ||= 'Test' if randomize_category - category = "#{category}#{Identifier::UUID.random.gsub('-', '')}" + category = "#{category}#{SecureRandom.hex}" end category
SecureRandom hex achieves the same as UUID with dashes removed for the purposes of this control
eventide-project_message-store
train
rb
4e89fede54099bc3b5d52499ac2bdd71f455b249
diff --git a/src/Symfony/Component/HttpKernel/Profiler/Profiler.php b/src/Symfony/Component/HttpKernel/Profiler/Profiler.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/Profiler.php +++ b/src/Symfony/Component/HttpKernel/Profiler/Profiler.php @@ -231,7 +231,6 @@ class Profiler return; } - $response = $response; $response->headers->set('X-Debug-Token', $this->getToken()); foreach ($this->collectors as $collector) {
[HttpKernel] removed a stupid line of code
symfony_symfony
train
php
d1c2a904ea80cdcf384e65962a7780c48e16268f
diff --git a/lib/bud/provenance.rb b/lib/bud/provenance.rb index <HASH>..<HASH> 100644 --- a/lib/bud/provenance.rb +++ b/lib/bud/provenance.rb @@ -19,6 +19,7 @@ class Bud end def final(state) "agg[#{@budtime}](" + state.join(";") + ")" + end end @@ -26,17 +27,11 @@ class Bud [ProvConcatenate.new, x] end - # the scalar UDF for this particular provenance implementation def prov_cat(rule, *args) return "r#{rule}[#{@budtime}](" + args.join(": ") + ")" - args.each do |sg| - d.append(sg) - end - return d end - # pretty printing stuff def tabs(cnt) str = "" @@ -76,8 +71,9 @@ class Bud end def whence(datum) - print "WHENCE(#{datum.inspect}) ?\n\n" - prov = datum[datum.length - 1] + copy = datum.clone + prov = copy.pop + print "WHENCE(#{copy.inspect}) ?\n\n" whence_p(prov, 0) end
oops, a little cleanup
bloom-lang_bud
train
rb
29d11d9cf9f61cafed508ad0e8e0904f35b23121
diff --git a/core/src/main/java/com/datastax/oss/driver/api/core/config/DriverConfigLoader.java b/core/src/main/java/com/datastax/oss/driver/api/core/config/DriverConfigLoader.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/datastax/oss/driver/api/core/config/DriverConfigLoader.java +++ b/core/src/main/java/com/datastax/oss/driver/api/core/config/DriverConfigLoader.java @@ -376,7 +376,7 @@ public interface DriverConfigLoader extends AutoCloseable { boolean supportsReloading(); /** - * Called when the cluster closes. This is a good time to release any external resource, for + * Called when the session closes. This is a good time to release any external resource, for * example cancel a scheduled reloading task. */ @Override
Replace mention of "cluster" by "session" in DriverConfigLoader.close()
datastax_java-driver
train
java
326b55bffb79e546f349b966bb5f526e988254b6
diff --git a/src/main/java/com/googlecode/lanterna/gui/component/Panel.java b/src/main/java/com/googlecode/lanterna/gui/component/Panel.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/googlecode/lanterna/gui/component/Panel.java +++ b/src/main/java/com/googlecode/lanterna/gui/component/Panel.java @@ -136,7 +136,10 @@ public class Panel extends AbstractContainer @Override public TerminalSize getPreferredSize() { - return border.surroundAreaSize(layoutManager.getPreferredSize()); + TerminalSize preferredSize = border.surroundAreaSize(layoutManager.getPreferredSize()); + if(title.length() + 4 > preferredSize.getColumns()) + preferredSize.setColumns(title.length() + 4); + return preferredSize; } @Override
Make the window larger if the title doesn't fit
mabe02_lanterna
train
java
f8b25f44f79fbf30debe850c6460e63f957ead3f
diff --git a/test/test_committer.rb b/test/test_committer.rb index <HASH>..<HASH> 100644 --- a/test/test_committer.rb +++ b/test/test_committer.rb @@ -1,3 +1,4 @@ +# ~*~ encoding: utf-8 ~*~ require File.expand_path(File.join(File.dirname(__FILE__), "helper")) context "Wiki" do @@ -47,4 +48,4 @@ context "Wiki" do FileUtils.rm_rf(@path) end end -end \ No newline at end of file +end
i think ruby <I> needs this. can't live without it.
gollum_gollum-lib
train
rb
d562ee881ec0bfdee65e1f77d353f0a112c597a7
diff --git a/src/main/java/org/cryptomator/frontend/webdav/mount/VfsMountingStrategy.java b/src/main/java/org/cryptomator/frontend/webdav/mount/VfsMountingStrategy.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/cryptomator/frontend/webdav/mount/VfsMountingStrategy.java +++ b/src/main/java/org/cryptomator/frontend/webdav/mount/VfsMountingStrategy.java @@ -4,7 +4,7 @@ import java.util.concurrent.TimeUnit; abstract class VfsMountingStrategy implements MounterStrategy { - abstract class MountImpl implements Mount { + protected abstract class MountImpl implements Mount { ProcessBuilder revealCmd; ProcessBuilder isMountedCmd;
Make MountImpl protected to separate it from the other occurrences in the same package
cryptomator_webdav-nio-adapter
train
java
482abc399a4dbe13562b4764273f8080a3d248f8
diff --git a/spec/error_reporters_spec.rb b/spec/error_reporters_spec.rb index <HASH>..<HASH> 100644 --- a/spec/error_reporters_spec.rb +++ b/spec/error_reporters_spec.rb @@ -20,6 +20,10 @@ describe Pliny::ErrorReporters do allow(reporter_double).to receive(:notify) end + after do + Pliny::ErrorReporters.error_reporters = [] + end + it "notifies rollbar" do notify_reporter diff --git a/spec/metrics_spec.rb b/spec/metrics_spec.rb index <HASH>..<HASH> 100644 --- a/spec/metrics_spec.rb +++ b/spec/metrics_spec.rb @@ -6,12 +6,17 @@ describe Pliny::Metrics do subject(:metrics) { Pliny::Metrics } before do + @stdout = Pliny.stdout Pliny.stdout = io allow(io).to receive(:print) allow(Config).to receive(:app_name).and_return('pliny') end + after do + Pliny.stdout = @stdout + end + context "#count" do it "counts a single key with a default value" do metrics.count(:foo)
Fix doubles leaking through globals
interagent_pliny
train
rb,rb
27859316044504937c1d3e70d1421b4dc83e3c5f
diff --git a/js/wee.dom.js b/js/wee.dom.js index <HASH>..<HASH> 100644 --- a/js/wee.dom.js +++ b/js/wee.dom.js @@ -979,15 +979,21 @@ * @param {($|HTMLElement|string)} [context=document] */ $remove: function(target, context) { + var arr = []; + W.$each(target, function(el) { var par = el.parentNode; + arr.push(el); + par.removeChild(el); W.$setRef(par); }, { context: context }); + + return arr; }, /**
Return removed items in $remove method
weepower_wee-core
train
js
7d04e40f278540eeeb7c948230801eef3aa8dc22
diff --git a/src/PSCWS4.php b/src/PSCWS4.php index <HASH>..<HASH> 100644 --- a/src/PSCWS4.php +++ b/src/PSCWS4.php @@ -314,7 +314,12 @@ class PSCWS4 { // restore the offset $this->_off = $off; // sort it & return - $cmp_func = create_function('$a,$b', 'return ($b[\'weight\'] > $a[\'weight\'] ? 1 : -1);'); + if ( (float)substr(PHP_VERSION, 0, 3) >= 5.3 ) { + $cmp_func = function($a, $b) {return ($b['weight'] > $a['weight'] ? 1 : -1);}; + } else { + $cmp_func = create_function('$a,$b', 'return ($b[\'weight\'] > $a[\'weight\'] ? 1 : -1);'); + } + usort($list, $cmp_func); if (count($list) > $limit) $list = array_slice($list, 0, $limit); return $list;
add support for php<I> issue: create_function() method has been DEPRECATED after php<I>. solution: When PHP_VERSION over <I>, using anonymous function instead of it.
mylukin_pscws4
train
php
2fab23ab9a9288fb2ca4e9fb094075410b0995d3
diff --git a/searx/webapp.py b/searx/webapp.py index <HASH>..<HASH> 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -916,7 +916,7 @@ def page_not_found(e): def run(): - logger.debug('starting webserver on %s:%s', settings['server']['port'], settings['server']['bind_address']) + logger.debug('starting webserver on %s:%s', settings['server']['bind_address'], settings['server']['port']) app.run( debug=searx_debug, use_debugger=searx_debug,
[fix] fix the debug message "starting webserver on ip:port" was "port:ip"
asciimoo_searx
train
py
1e25ea97e6f686d6fbb9b401f3ebfabb525c0542
diff --git a/test/test-50-fs-runtime-layer/main.js b/test/test-50-fs-runtime-layer/main.js index <HASH>..<HASH> 100644 --- a/test/test-50-fs-runtime-layer/main.js +++ b/test/test-50-fs-runtime-layer/main.js @@ -39,7 +39,12 @@ right = right.split('\n'); // right may have less lines, premature exit, // less trusted, so using left.length here for (let i = 0; i < left.length; i += 1) { - assert.equal(left[i], right[i]); + if (left[i] !== right[i]) { + console.log('line', i); + console.log('<<left<<\n' + left); + console.log('>>right>>\n' + right); + throw new Error('Assertion'); + } } utils.vacuum.sync(path.dirname(output));
trying to figure out appveyor <I> build failure
zeit_pkg
train
js
32314ca678b58e945af08582674de6777c5ca12d
diff --git a/spec/unit/provider/package/pip_spec.rb b/spec/unit/provider/package/pip_spec.rb index <HASH>..<HASH> 100755 --- a/spec/unit/provider/package/pip_spec.rb +++ b/spec/unit/provider/package/pip_spec.rb @@ -30,6 +30,20 @@ describe provider_class do end + describe "cmd" do + + it "should return pip-python on RedHat systems" do + Facter.stubs(:value).with(:osfamily).returns("RedHat") + provider_class.cmd.should == 'pip-python' + end + + it "should return pip by default" do + Facter.stubs(:value).with(:osfamily).returns("Not RedHat") + provider_class.cmd.should == 'pip' + end + + end + describe "instances" do it "should return an array when pip is present" do
(#<I>) Tests to confirm functionality of the cmd function
puppetlabs_puppet
train
rb
49f0c6c445fa1ffd13cbc5dc55c0b031cb91da3f
diff --git a/src/Propel/Generator/Builder/Om/ExtensionQueryBuilder.php b/src/Propel/Generator/Builder/Om/ExtensionQueryBuilder.php index <HASH>..<HASH> 100644 --- a/src/Propel/Generator/Builder/Om/ExtensionQueryBuilder.php +++ b/src/Propel/Generator/Builder/Om/ExtensionQueryBuilder.php @@ -86,7 +86,7 @@ class ".$this->getUnqualifiedClassName()." extends $baseClassName protected function addClassClose(&$script) { $script .= " -} // " . $this->getUnqualifiedClassName() . " +} "; $this->applyBehaviorModifier('extensionQueryFilter', $script, ""); }
Removed comment at the closing brace of Extension Query Classes to conform psr-1/psr-2
propelorm_Propel2
train
php
aed0e96991f6eb5269c830b11d6235b5c85b2be8
diff --git a/__tests__/servers/socket.js b/__tests__/servers/socket.js index <HASH>..<HASH> 100644 --- a/__tests__/servers/socket.js +++ b/__tests__/servers/socket.js @@ -256,10 +256,10 @@ describe('Server: Socket', () => { describe('custom data delimiter', () => { afterEach(() => { api.config.servers.socket.delimiter = '\n' }) - test('will parse /newline data delimiter', async () => { - api.config.servers.socket.delimiter = '\n' + test('will parse custom newline data delimiter', async () => { + api.config.servers.socket.delimiter = 'xXxXxX' await api.utils.sleep(10) - let response = await makeSocketRequest(client, JSON.stringify({ action: 'status' }), '\n') + let response = await makeSocketRequest(client, JSON.stringify({ action: 'status' }), 'xXxXxX') expect(response.context).toEqual('response') })
newline socket test should make more sense
actionhero_actionhero
train
js
07171a8863c377fb14a44dee402dff9e1282bc49
diff --git a/fakeyagnats/fake_yagnats.go b/fakeyagnats/fake_yagnats.go index <HASH>..<HASH> 100644 --- a/fakeyagnats/fake_yagnats.go +++ b/fakeyagnats/fake_yagnats.go @@ -206,6 +206,13 @@ func (f *FakeYagnats) Subscriptions(subject string) []yagnats.Subscription { return f.subscriptions[subject] } +func (f *FakeYagnats) SubscriptionCount() int { + f.RLock() + defer f.RUnlock() + + return len(f.subscriptions) +} + func (f *FakeYagnats) WhenPublishing(subject string, callback func(*yagnats.Message) error) { f.Lock() defer f.Unlock() @@ -219,3 +226,17 @@ func (f *FakeYagnats) PublishedMessages(subject string) []yagnats.Message { return f.publishedMessages[subject] } + +func (f *FakeYagnats) PublishedMessageCount() int { + f.RLock() + defer f.RUnlock() + + return len(f.publishedMessages) +} + +func (f* FakeYagnats) ConnectedConnectionProvider() yagnats.ConnectionProvider { + f.RLock() + defer f.RUnlock() + + return f.connectedConnectionProvider +}
Exposed fake client methods for usage testing - Added SubscriptionCount, PublishedMessageCount & ConnectedConnectionProvider
cloudfoundry_yagnats
train
go
a5966ae8b3af65f28e3ec65ecee9cf5369e94b28
diff --git a/src/Console/Commands/Various/AllCommand.php b/src/Console/Commands/Various/AllCommand.php index <HASH>..<HASH> 100644 --- a/src/Console/Commands/Various/AllCommand.php +++ b/src/Console/Commands/Various/AllCommand.php @@ -21,7 +21,7 @@ class AllCommand extends Command { $this ->setName('all') - ->setDescription('All Fiesta commands'); + ->setDescription('All Pikia commands'); } @@ -57,7 +57,7 @@ class AllCommand extends Command $process = "\n"; // $process .=Console::setMessage(" info............Get info about the framework\n" , Console::nn ); - $process .=Console::setMessage(" all.............All Fiesta commands\n" , Console::nn ); + $process .=Console::setMessage(" all.............All Pikia commands\n" , Console::nn ); $process .=Console::setMessage("schema\n" , Console::lst ); $process .=Console::setMessage(" :new............make new schema file...............|".Console::setCyan(" <name>\n") , Console::nn ); $process .=Console::setMessage(" :exec...........Execute the last schema created\n" , Console::nn );
update all command put Pikia instead of Fiesta
vinala_kernel
train
php
68f98b3c5b6eef73b782d3216a9b12bd5f399a86
diff --git a/telemetry/telemetry/core/chrome/cros_util.py b/telemetry/telemetry/core/chrome/cros_util.py index <HASH>..<HASH> 100644 --- a/telemetry/telemetry/core/chrome/cros_util.py +++ b/telemetry/telemetry/core/chrome/cros_util.py @@ -90,7 +90,7 @@ def NavigateLogin(browser_backend, cri): """Navigates through oobe login screen""" # Dismiss the user image selection screen. try: - util.WaitFor(lambda: _IsLoggedIn(browser_backend, cri), 15) + util.WaitFor(lambda: _IsLoggedIn(browser_backend, cri), 30) except util.TimeoutException: raise exceptions.LoginException( 'Timed out going through oobe screen. Make sure the custom auth '
Increase time out for NavigateLogin. This timeout is cutting it too close, in rare situations, login can take a little longer. I'm seeing some flakes on this. BUG=NONE TEST=manual NOTRY=True Review URL: <URL>
catapult-project_catapult
train
py
3a3e8aecc35cb55588adec9857f35ce75b4b2456
diff --git a/pnc_cli/cli_types.py b/pnc_cli/cli_types.py index <HASH>..<HASH> 100644 --- a/pnc_cli/cli_types.py +++ b/pnc_cli/cli_types.py @@ -278,10 +278,13 @@ def valid_url(urlInput): raise argparse.ArgumentTypeError("invalid url") return urlInput + +# validation is different depnding on the PNC url. def valid_internal_url(urlInput): - if not urlInput.startswith("git+ssh://pnc-gerrit-stage@code-stage.eng.nay.redhat.com:29418"): - raise argparse.ArgumentTypeError("An internal SCM repository URL must start with: git+ssh://pnc-gerrit-stage@code-stage.eng.nay.redhat.com:29418") - if urlInput == "git+ssh://pnc-gerrit-stage@code-stage.eng.nay.redhat.com:29418": + repo_start = utils.get_internal_repo_start(uc.user.pnc_config.url) + if not urlInput.startswith(repo_start): + raise argparse.ArgumentTypeError("An internal SCM repository URL must start with: " + repo_start) + if urlInput == repo_start: raise argparse.ArgumentTypeError("No specific internal repository specified.") valid_url(urlInput) - return urlInput \ No newline at end of file + return urlInput
update cli_types internal SCM urls must be aware of what the PNC instance being used is; the required starting portion of the URL is different vs different instances
project-ncl_pnc-cli
train
py
028900df110a84603302468d9ee21502bd5a1d5e
diff --git a/saltcloud/clouds/ec2.py b/saltcloud/clouds/ec2.py index <HASH>..<HASH> 100644 --- a/saltcloud/clouds/ec2.py +++ b/saltcloud/clouds/ec2.py @@ -1177,7 +1177,8 @@ def create(vm_=None, call=None): if saltcloud.utils.wait_for_passwd( host=ip_address, username=user, - ssh_timeout=60, + ssh_timeout=config.get_config_value( + 'wait_for_passwd_timeout', vm_, __opts__, default=1) * 60, key_filename=key_filename, display_ssh_output=display_ssh_output ):
Configurable wait for `passwd` implemented for EC2
saltstack_salt
train
py
cefa87ef5eb3011beb2496962af1e45a5061ce98
diff --git a/java/client/test/org/openqa/selenium/io/TemporaryFilesystemTest.java b/java/client/test/org/openqa/selenium/io/TemporaryFilesystemTest.java index <HASH>..<HASH> 100644 --- a/java/client/test/org/openqa/selenium/io/TemporaryFilesystemTest.java +++ b/java/client/test/org/openqa/selenium/io/TemporaryFilesystemTest.java @@ -1,9 +1,9 @@ package org.openqa.selenium.io; -import org.openqa.selenium.WebDriverException; - import junit.framework.TestCase; + import org.junit.Test; +import org.openqa.selenium.WebDriverException; import java.io.File; import java.io.IOException; @@ -99,6 +99,15 @@ public class TemporaryFilesystemTest extends TestCase { } @Test + public void testShouldDeleteTempDir() { + final File tempDir = tmpFs.createTempDir("foo", "bar"); + assertTrue(tempDir.exists()); + tmpFs.deleteTemporaryFiles(); + tmpFs.deleteBaseDir(); + assertFalse(tempDir.exists()); + } + + @Test public void testShouldBeAbleToModifyDefaultInstance() throws IOException { // Create a temp file *outside* of the directory owned by the current // TemporaryFilesystem instance.
KristianRosenvold: Added unit test for method added in r<I> r<I>
SeleniumHQ_selenium
train
java
7106928ff822a8b2b2e5beae7450410b5431fdfc
diff --git a/symphony/content/content.systempreferences.php b/symphony/content/content.systempreferences.php index <HASH>..<HASH> 100755 --- a/symphony/content/content.systempreferences.php +++ b/symphony/content/content.systempreferences.php @@ -210,7 +210,7 @@ } Symphony::Configuration()->write(); - if(function_exists('opcache_invalidate')) opcache_invalidate(CONFIG); + if(function_exists('opcache_invalidate')) opcache_invalidate(CONFIG, true); redirect(SYMPHONY_URL . '/system/preferences/success/'); }
Force invalidation of config.php regardless of last modified value Some filesystems may be set not to record last modified dates if I remember correctly. Even if not, forcing shouldn’t be a problem and seems safest.
symphonycms_symphony-2
train
php
0eec3406d6de6d0c4850b49f3cf5536a19e1ed68
diff --git a/src/main/java/com/bernardomg/tabletop/dice/visitor/RollTransformer.java b/src/main/java/com/bernardomg/tabletop/dice/visitor/RollTransformer.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/bernardomg/tabletop/dice/visitor/RollTransformer.java +++ b/src/main/java/com/bernardomg/tabletop/dice/visitor/RollTransformer.java @@ -3,6 +3,7 @@ package com.bernardomg.tabletop.dice.visitor; import com.bernardomg.tabletop.dice.history.RollResult; +@FunctionalInterface public interface RollTransformer { public RollResult transform(final RollResult result, final Integer index);
Added annotation to ensure it always can be mapped to a lambda
Bernardo-MG_dice-notation-java
train
java
1a9b87c4b9fef1b6c3adf735e9d12dadde823c3e
diff --git a/lib/thinking_sphinx/search.rb b/lib/thinking_sphinx/search.rb index <HASH>..<HASH> 100644 --- a/lib/thinking_sphinx/search.rb +++ b/lib/thinking_sphinx/search.rb @@ -2,7 +2,7 @@ class ThinkingSphinx::Search < Array CORE_METHODS = %w( == class class_eval extend frozen? id instance_eval - instance_of? instance_values instance_variable_defined? + instance_exec instance_of? instance_values instance_variable_defined? instance_variable_get instance_variable_set instance_variables is_a? kind_of? member? method methods nil? object_id respond_to? respond_to_missing? send should should_not type )
Include instance_exec in ThinkingSphinx::Search::CORE_METHODS I ran into this when trying to instrument `ThinkingSphinx::Search#populate` with NewRelic 8, where `add_method_tracer :populate` relies on `instance_exec`. This would fail because ThinkingSphinx::Search undefs all instance methods not included in a safe-list.
pat_thinking-sphinx
train
rb
b59f058d41fdc82b442a703b97a03133bdd7c81d
diff --git a/lib/mail/body.rb b/lib/mail/body.rb index <HASH>..<HASH> 100644 --- a/lib/mail/body.rb +++ b/lib/mail/body.rb @@ -35,7 +35,7 @@ module Mail if string.blank? @raw_source = '' else - @raw_source = string + @raw_source = string.to_s end @encoding = nil set_charset diff --git a/spec/mail/body_spec.rb b/spec/mail/body_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mail/body_spec.rb +++ b/spec/mail/body_spec.rb @@ -39,6 +39,15 @@ describe Mail::Body do body.to_s.should == '' end + it "should accept an array as the body and join it" do + doing { Mail::Body.new(["line one\n", "line two\n"]) }.should_not raise_error + end + + it "should accept an array as the body and join it" do + body = Mail::Body.new(["line one\n", "line two\n"]) + body.encoded.should == "line one\r\nline two\r\n" + end + end describe "encoding" do
Body should call to_s on given input... incase someone gave it an IO.readlines result (Array)
mikel_mail
train
rb,rb
945013f8d1f92aaf93ee1512ca80a7970c8c968d
diff --git a/test/commands-test.js b/test/commands-test.js index <HASH>..<HASH> 100644 --- a/test/commands-test.js +++ b/test/commands-test.js @@ -29,6 +29,20 @@ describe('window commands', function () { }) }) + describe('waitUntilTextExists', function () { + it('resolves if the element contains the given text', function () { + return app.client.waitUntilTextExists('html', 'Hello').should.be.fulfilled + }) + + it('rejects if the element is missing', function () { + return app.client.waitUntilTextExists('#not-in-page', 'Hello', 50).should.be.rejectedWith(Error, 'waitUntilTextExists Promise was rejected') + }) + + it('rejects if the element never contains the text', function () { + return app.client.waitUntilTextExists('html', 'not on page', 50).should.be.rejectedWith(Error, 'waitUntilTextExists Promise was rejected') + }) + }) + describe('browserWindow.getBounds()', function () { it('gets the window bounds', function () { return app.browserWindow.getBounds().should.eventually.deep.equal({
Add specs for waitUntilTextExists
electron_spectron
train
js
fa3c521f958a4e8505f9e7e9841828b30c8f5ccd
diff --git a/examples/simple_pyramid_chat/chatter2/views.py b/examples/simple_pyramid_chat/chatter2/views.py index <HASH>..<HASH> 100644 --- a/examples/simple_pyramid_chat/chatter2/views.py +++ b/examples/simple_pyramid_chat/chatter2/views.py @@ -50,6 +50,10 @@ class ChatNamespace(BaseNamespace, NamedUsersRoomsMixin): def recv_disconnect(self): self.broadcast_event('user_disconnect') self.disconnect(silent=True) + + def on_join(self, channel): + self.join(channel) + def socketio_service(request):
Update examples/simple_pyramid_chat/chatter2/views.py Added an on_join function allow joining of rooms.
abourget_gevent-socketio
train
py
88d655d34ecce363582161b03f61e01921c8bd2b
diff --git a/templatetags/smiley_tags.py b/templatetags/smiley_tags.py index <HASH>..<HASH> 100644 --- a/templatetags/smiley_tags.py +++ b/templatetags/smiley_tags.py @@ -20,3 +20,4 @@ def replace_smileys(value): return value register.filter('smileys', replace_smileys) +replace_smileys.is_safe = True
adding is_safe attribut to True for the tag, thanks dmishe
Fantomas42_django-emoticons
train
py
da0fcccfaadc2816fe01f89a9b49aaf8d966c0a8
diff --git a/angr/procedures/libc/realloc.py b/angr/procedures/libc/realloc.py index <HASH>..<HASH> 100644 --- a/angr/procedures/libc/realloc.py +++ b/angr/procedures/libc/realloc.py @@ -23,8 +23,11 @@ class realloc(angr.SimProcedure): self.return_type = self.ty_ptr(SimTypeTop(size)) addr = self.state.libc.heap_location - v = self.state.memory.load(ptr, size_int) - self.state.memory.store(addr, v) + + if self.state.solver.eval(ptr) != 0: + v = self.state.memory.load(ptr, size_int) + self.state.memory.store(addr, v) + self.state.libc.heap_location += size_int return addr
Fixed false memory read of address NULL
angr_angr
train
py
572cac498c2bf4bd6a0923682fdb85a16cb230d0
diff --git a/models/classes/interface.ReadableResultStorage.php b/models/classes/interface.ReadableResultStorage.php index <HASH>..<HASH> 100644 --- a/models/classes/interface.ReadableResultStorage.php +++ b/models/classes/interface.ReadableResultStorage.php @@ -53,6 +53,7 @@ interface taoResultServer_models_classes_ReadableResultStorage { */ public function getVariables($callId); public function getVariable($callId, $variableIdentifier); + public function getVariableProperty($variableId, $property); public function getTestTaker($deliveryResultIdentifier); public function getDelivery($deliveryResultIdentifier);
add a method in readable interface to get a property of a variable
oat-sa_extension-tao-outcome
train
php
d2f2cb814cd9b70c32abc3548107518d46e2d42b
diff --git a/lib/metrics/instruments/counter.rb b/lib/metrics/instruments/counter.rb index <HASH>..<HASH> 100644 --- a/lib/metrics/instruments/counter.rb +++ b/lib/metrics/instruments/counter.rb @@ -2,7 +2,7 @@ module Metrics module Instruments class Counter < Base - @counter_value + def initialize @counter_value = 0 end
Removing un-needed line in Counter
johnewart_ruby-metrics
train
rb
c7113ae0644371b13558a223cf5cdda278dd9f58
diff --git a/package.php b/package.php index <HASH>..<HASH> 100644 --- a/package.php +++ b/package.php @@ -4,7 +4,7 @@ require_once 'PEAR/PackageFileManager2.php'; -$version = '1.4.65'; +$version = '1.4.66'; $notes = <<<EOT No release notes for you! EOT;
prepare for release of <I> svn commit r<I>
silverorange_swat
train
php
a22e2a6ef2face22c177014f9d7ebf8319695a91
diff --git a/doc/source/conf.py b/doc/source/conf.py index <HASH>..<HASH> 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -40,7 +40,7 @@ class Mock(object): else: return Mock() -MOCK_MODULES = ['PyQt4.QtGui', 'PyQt4.QtCore'] +MOCK_MODULES = ["PyQt4", 'PyQt4.QtGui', 'PyQt4.QtCore'] for mod_name in MOCK_MODULES: sys.modules[mod_name] = Mock()
#<I> This should definitely work
pyQode_pyqode.core
train
py
34ce2ca94576016f9389c21111ba9d99aa9807a0
diff --git a/app/models/social_networking/goal.rb b/app/models/social_networking/goal.rb index <HASH>..<HASH> 100644 --- a/app/models/social_networking/goal.rb +++ b/app/models/social_networking/goal.rb @@ -1,8 +1,10 @@ module SocialNetworking # Something to be completed by a Participant. class Goal < ActiveRecord::Base - ACTION_TYPES = %w( created completed ) - Actions = Struct.new(*ACTION_TYPES.map(&:to_sym)).new(*ACTION_TYPES) + # create a mini DSL for types of Goal actions + ACTION_TYPES = %w( created completed did_not_complete ) + Actions = Struct.new(*ACTION_TYPES.map(&:to_sym)) + .new(*(ACTION_TYPES.map { |t| t.gsub(/_/, " ") })) belongs_to :participant has_many :comments, as: "item" @@ -13,6 +15,10 @@ module SocialNetworking validate :not_due_in_the_past, on: :create validate :due_before_membership_ends, on: :create + scope :did_not_complete, (lambda do + where(is_completed: false).where(arel_table[:due_on].lt(Date.today)) + end) + def to_serialized if due_on {
augment Goal to simplify finding and sharing past due Goals [#<I>]
NU-CBITS_social_networking
train
rb
2f4cff4e2afdafe0ba437dffffd75fb3a59bc4c1
diff --git a/src/nu/validator/xml/UseCountingXMLReaderWrapper.java b/src/nu/validator/xml/UseCountingXMLReaderWrapper.java index <HASH>..<HASH> 100644 --- a/src/nu/validator/xml/UseCountingXMLReaderWrapper.java +++ b/src/nu/validator/xml/UseCountingXMLReaderWrapper.java @@ -238,6 +238,8 @@ public final class UseCountingXMLReaderWrapper "http://validator.nu/properties/style-in-body-found", true); } + } else if ("body".equals(localName)) { + inBody = true; } if (atts.getIndex("", "rel") > -1 && ("link".equals(localName) || "a".equals(localName))) {
Fix bug in use-counter statistics code
validator_validator
train
java
cc113cdd6c0974d497c7549ec88a99b769055ff9
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -285,7 +285,7 @@ FileStub.prototype.make = function() { }; /** - * Reverse make() stubbing. + * Undo make(). */ FileStub.prototype.unlink = function() { var name = this.get('name'); @@ -312,7 +312,7 @@ FileStub.prototype.unlink = function() { fsStub.readdir.withArgs(name).throws(err); fsStub.readdirSync.withArgs(name).throws(err); - //delete fileStubMap[name]; + delete fileStubMap[name]; }; var globalInjector = {
fix(unlink): Delete old stub map entry
codeactual_sinon-doublist-fs
train
js
52cc5dc2dccaccd56bd42134ac9cb6262b4e793a
diff --git a/artist/plot.py b/artist/plot.py index <HASH>..<HASH> 100644 --- a/artist/plot.py +++ b/artist/plot.py @@ -683,8 +683,6 @@ class PolarPlot(Plot): coordinates in degrees. The y values are the r coordinates in arbitrary units. - Histogram plots do not work properly when using the polar class. - """ def __init__(self, axis='', width=r'.67\linewidth', height=None):
Remove text from docstring which is no longer true
davidfokkema_artist
train
py
e7bb85fb7bc2f00ad316a1d0356582dfb142c603
diff --git a/discovery-client/src/main/java/io/micronaut/discovery/aws/route53/Route53ClientDiscoveryConfiguration.java b/discovery-client/src/main/java/io/micronaut/discovery/aws/route53/Route53ClientDiscoveryConfiguration.java index <HASH>..<HASH> 100644 --- a/discovery-client/src/main/java/io/micronaut/discovery/aws/route53/Route53ClientDiscoveryConfiguration.java +++ b/discovery-client/src/main/java/io/micronaut/discovery/aws/route53/Route53ClientDiscoveryConfiguration.java @@ -34,10 +34,12 @@ import javax.annotation.Nullable; * See https://docs.aws.amazon.com/Route53/latest/APIReference/overview-service-discovery.html for details info */ @Requires(env = Environment.AMAZON_EC2) -@ConfigurationProperties("aws.route53.discovery.client") +@Requires(property = Route53ClientDiscoveryConfiguration.PREFIX) +@ConfigurationProperties(Route53ClientDiscoveryConfiguration.PREFIX) public class Route53ClientDiscoveryConfiguration extends DiscoveryClientConfiguration { public static final String SERVICE_ID = "route53"; + public static final String PREFIX = "aws.route53.discovery.client"; private String awsServiceId; //ID of the service - required to find it private String namespaceId; // used to filter a list of available services attached to a namespace
Add requires condition for Route<I>ClientDiscoveryConfiguration
micronaut-projects_micronaut-core
train
java
5d485894ee2d6e90cad871e3b5ccda61ff554a53
diff --git a/lib/mosql/tailer.rb b/lib/mosql/tailer.rb index <HASH>..<HASH> 100644 --- a/lib/mosql/tailer.rb +++ b/lib/mosql/tailer.rb @@ -2,7 +2,7 @@ module MoSQL class Tailer < Mongoriver::AbstractPersistentTailer def self.create_table(db, tablename) if !db.table_exists?(tablename) - db.create_table?(tablename) do + db.create_table(tablename) do column :service, 'TEXT' column :timestamp, 'INTEGER' column :position, 'BYTEA'
No need for conditional create_table? inside conditional
stripe_mosql
train
rb
dea3d2dd203fe2008ccfae6b6575da0b0001e466
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -132,6 +132,23 @@ class AttributeMethodsTest < ActiveRecord::TestCase end end + def test_read_attributes_after_type_cast_on_datetime + in_time_zone "Pacific Time (US & Canada)" do + record = @target.new + + record.written_on = "2011-03-24" + assert_equal "2011-03-24", record.written_on_before_type_cast + assert_equal Time.zone.parse("2011-03-24"), record.written_on + assert_equal ActiveSupport::TimeZone["Pacific Time (US & Canada)"], + record.written_on.time_zone + + record.save + record.reload + + assert_equal Time.zone.parse("2011-03-24"), record.written_on + end + end + def test_hash_content topic = Topic.new topic.content = { "one" => 1, "two" => 2 }
adding a test for attributes after type cast. thanks nragaz. :heart:
rails_rails
train
rb
c01dc089bbf42ed6403bda1bfc01504381232d9d
diff --git a/packages/@vue/cli-ui/tests/e2e/specs/test.js b/packages/@vue/cli-ui/tests/e2e/specs/test.js index <HASH>..<HASH> 100644 --- a/packages/@vue/cli-ui/tests/e2e/specs/test.js +++ b/packages/@vue/cli-ui/tests/e2e/specs/test.js @@ -108,6 +108,6 @@ describe('Plugins', () => { cy.get('.loading-screen .vue-ui-loading-indicator').should('be.visible') cy.get('.prompts-list', { timeout: 250000 }).should('be.visible') cy.get('[data-testid="finish-install"]').should('not.have.class', 'disabled').click() - cy.get('.project-plugin-item').should('have.length', 3) + cy.get('.project-plugin-item', { timeout: 250000 }).should('have.length', 3) }) })
test: fix plugin install: command timeout
vuejs_vue-cli
train
js
ed3b046e1164c86d5080b25255c43f607347af4d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ extras_require = { "pytest-pythonpath>=0.3", "pytest-watch>=4.2,<5", "pytest-xdist>=1.29,<2", - "setuptools>=36.2.0", + "setuptools>=38.6.0", "tox>=1.8.0", "tqdm>4.32,<5", "twine>=1.13,<2", @@ -57,13 +57,16 @@ extras_require['dev'] = ( + extras_require['dev'] ) +with open('./README.md') as readme: + long_description = readme.read() + setup( name='web3', # *IMPORTANT*: Don't manually change the version here. Use the 'bumpversion' utility. version='5.12.2', description="""Web3.py""", long_description_content_type='text/markdown', - long_description_markdown_filename='README.md', + long_description=long_description, author='Piper Merriam', author_email='pipermerriam@gmail.com', url='https://github.com/ethereum/web3.py',
updated markdown metadata and bumped setuptools to <I>
ethereum_web3.py
train
py
71319e42443ef1b840df21036e39ddf362a7ff5f
diff --git a/lib/lemonad.js b/lib/lemonad.js index <HASH>..<HASH> 100644 --- a/lib/lemonad.js +++ b/lib/lemonad.js @@ -97,6 +97,12 @@ return _.uniq(arguments); }; + L.existy = function(x) { return x != null; }; + + L.truthy = function(x) { + return (x !== false) && exists(x); + }; + // Array selectors // ---------------
Adding the 'Just a sketch' functions
fogus_lemonad
train
js
fdffa7a929d7687821c339f39d2b81cd0950aec6
diff --git a/packages/docs/src/store/modules/notifications.js b/packages/docs/src/store/modules/notifications.js index <HASH>..<HASH> 100644 --- a/packages/docs/src/store/modules/notifications.js +++ b/packages/docs/src/store/modules/notifications.js @@ -3,8 +3,6 @@ import { make } from 'vuex-pathify' import { subDays } from 'date-fns' import bucket from '@/plugins/cosmicjs' -console.log(subDays(Date.now(), 40).getTime()) - const state = { all: [], }
chore(notifications): remove dev code
vuetifyjs_vuetify
train
js
ebe619b72ba1b23fd6ea1a69a945a3f8d9dc3557
diff --git a/dev/com.ibm.ws.logging_fat/fat/src/com/ibm/ws/logging/fat/TimeBasedLogRolloverTest.java b/dev/com.ibm.ws.logging_fat/fat/src/com/ibm/ws/logging/fat/TimeBasedLogRolloverTest.java index <HASH>..<HASH> 100644 --- a/dev/com.ibm.ws.logging_fat/fat/src/com/ibm/ws/logging/fat/TimeBasedLogRolloverTest.java +++ b/dev/com.ibm.ws.logging_fat/fat/src/com/ibm/ws/logging/fat/TimeBasedLogRolloverTest.java @@ -371,7 +371,7 @@ public class TimeBasedLogRolloverTest { /* * Tests that maxFileSize takes priority over timed log rollover. - */ + * @Test public void testMaxFileSizePriorityRolling() throws Exception { setUp(server_xml, "testMaxFileSizeRolling"); @@ -403,6 +403,7 @@ public class TimeBasedLogRolloverTest { //check Log is rolled over at next rollover time checkForRolledLogsAtTime(getNextRolloverTime(0,1)); } + */ private static String getLogsDirPath() throws Exception { return serverInUse.getDefaultLogFile().getParentFile().getAbsolutePath();
fixing log rollover tests (#<I>)
OpenLiberty_open-liberty
train
java
6fadaac316e726b3f58380ecb8c3e20db7a2f22c
diff --git a/bin/importjs.js b/bin/importjs.js index <HASH>..<HASH> 100755 --- a/bin/importjs.js +++ b/bin/importjs.js @@ -11,6 +11,8 @@ const packageJson = require('../package.json'); /** * Grab lines from stdin or directly from the file. + * @param {String} pathToFile + * @param {Function} callback */ function getLines(pathToFile, callback) { if (process.stdin.isTTY) { @@ -29,6 +31,8 @@ function getLines(pathToFile, callback) { /** * Run a command/method on an importer instance + * @param {Function} executor + * @param {String} pathToFile */ function runCommand(executor, pathToFile) { getLines(pathToFile, (lines) => {
Add JSDoc to bin/importjs.js These comments will help future explorers more easily understand this code.
Galooshi_import-js
train
js
e14cf0c9e0b8f86cb60fd13ea3351ac63165a41c
diff --git a/examples/gltf/index.js b/examples/gltf/index.js index <HASH>..<HASH> 100644 --- a/examples/gltf/index.js +++ b/examples/gltf/index.js @@ -313,6 +313,8 @@ function handleMesh (mesh, gltf, basePath) { if (primitive.material !== undefined) { const material = gltf.materials[primitive.material] materialCmp = handleMaterial(material, gltf, basePath) + } else { + materialCmp = renderer.material({}) } let components = [
Add default material if gltf mesh doesn’t have one
pex-gl_pex-renderer
train
js
ed48dc2eb59df1d176adae43086e74185fc186fa
diff --git a/src/Debug/Route/Wamp.php b/src/Debug/Route/Wamp.php index <HASH>..<HASH> 100644 --- a/src/Debug/Route/Wamp.php +++ b/src/Debug/Route/Wamp.php @@ -170,6 +170,9 @@ class Wamp implements RouteInterface */ public function onShutdown() { + if (!$this->metaPublished) { + return; + } // publish a "we're done" message $this->processLogEntry(new LogEntry( $this->debug,
Wamp: only publish endOutput if we've published meta (begin output)
bkdotcom_PHPDebugConsole
train
php
d55563d6ce032bb5d43d13d98f3bbf72e3fe31e1
diff --git a/bin/ugrid.js b/bin/ugrid.js index <HASH>..<HASH> 100755 --- a/bin/ugrid.js +++ b/bin/ugrid.js @@ -135,8 +135,11 @@ if (wsport) { sock.ws = true; handleConnect(sock); ws.on('close', function () { - console.log('## connection end'); - if (sock.client) sock.client.sock = null; + console.log('## connection closed'); + if (sock.client) { + pubmon({event: 'disconnect', uuid: sock.client.uuid}); + sock.client.sock = null; + } if (sock.crossIndex) delete crossbar[sock.crossIndex]; }); });
ugrid.js: fix a bug where websocket close was not monitored Former-commit-id: <I>a4f<I>d<I>df<I>a0ff3e3b<I>b<I>d4b7d<I>
skale-me_skale
train
js
0a1a164cb1b2060cf7bc115bbe9c9ca65218888f
diff --git a/subliminal/converters/thesubdb.py b/subliminal/converters/thesubdb.py index <HASH>..<HASH> 100644 --- a/subliminal/converters/thesubdb.py +++ b/subliminal/converters/thesubdb.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from babelfish import LanguageReverseConverter -from subliminal.exceptions import ConfigurationError + +from ..exceptions import ConfigurationError class TheSubDBConverter(LanguageReverseConverter):
Use relative imports in thesubdb
Diaoul_subliminal
train
py
4a814baf9d280391ae321fd8ce6585df6ddaba8f
diff --git a/src/loaders/loader.js b/src/loaders/loader.js index <HASH>..<HASH> 100644 --- a/src/loaders/loader.js +++ b/src/loaders/loader.js @@ -8,8 +8,10 @@ var ResourceLoader = require('resource-loader'), * The new loader, extends Resource Loader by Chad Engler : https://github.com/englercj/resource-loader * * ```js - * var loader = new PIXI.loader(); - * + * var loader = PIXI.loader; + * //or + * var loader = new PIXI.loaders.Loader(); + * * loader.add('bunny',"data/bunny.png"); * * loader.once('complete',onAssetsLoaded);
fixes #<I> outdated loader docs
pixijs_pixi.js
train
js
b3c12bd43500a417d69c69f7646404169c4a9002
diff --git a/test/e2e-api/admin/members.test.js b/test/e2e-api/admin/members.test.js index <HASH>..<HASH> 100644 --- a/test/e2e-api/admin/members.test.js +++ b/test/e2e-api/admin/members.test.js @@ -365,7 +365,7 @@ describe('Members API', function () { should.exist(importedMember2); importedMember2.name.should.equal('test'); should(importedMember2.note).equal('test note'); - importedMember2.subscribed.should.equal(true); + importedMember2.subscribed.should.equal(false); importedMember2.labels.length.should.equal(2); testUtils.API.isISO8601(importedMember2.created_at).should.be.true(); importedMember2.created_at.should.equal('1991-10-02T20:30:31.000Z');
Fixed Members importer tests no-issue These tests were incorrectly checking for a subscribed value of true, and thus failed to catch the bug fixed in the previous commit. The tests now reflect the intended behaviour.
TryGhost_Ghost
train
js
d571a6f49c0cf3ea09924d959f6b7c907bfc0116
diff --git a/test/spec/FindReplace-test.js b/test/spec/FindReplace-test.js index <HASH>..<HASH> 100644 --- a/test/spec/FindReplace-test.js +++ b/test/spec/FindReplace-test.js @@ -2303,7 +2303,7 @@ define(function (require, exports, module) { var kgPath = SpecRunnerUtils.getTestPath("/spec/FindReplace-known-goods/" + options.inMemoryKGFolder + filePath), kgFile = FileSystem.getFileForPath(kgPath); return promisify(kgFile, "read").then(function (contents) { - expect(doc.getText()).toEqual(contents); + expect(doc.getText(true)).toEqual(contents); }); }), "check in memory file contents"); });
Use original line endings when comparing in-memory doc to known goods in Replace in Files unit tests
adobe_brackets
train
js
10e51c267dc22ec292ecf6ac195fc33559d8d51e
diff --git a/spec/unit/mongoid/document_spec.rb b/spec/unit/mongoid/document_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/mongoid/document_spec.rb +++ b/spec/unit/mongoid/document_spec.rb @@ -656,7 +656,7 @@ describe Mongoid::Document do end - describe "#root" do + describe "#_root" do before do @person = Person.new(:title => "Mr") @@ -694,12 +694,32 @@ describe Mongoid::Document do describe ".store_in" do - before do - Patient.store_in :population + context "on a parent class" do + + before do + Patient.store_in :population + end + + it "sets the collection name for the document" do + Patient.collection_name.should == "population" + end + end - it "sets the collection name for the document" do - Patient.collection_name.should == "population" + context "on a subclass" do + + before do + Firefox.store_in :browsers + end + + after do + Firefox.store_in :canvases + end + + it "changes the collection name for the entire hierarchy" do + Canvas.collection_name.should == "browsers" + end + end end
Adding specs for Document.store_in on subclasses
mongodb_mongoid
train
rb
58bab2051e8b475ad04f039f2bce91cf653c6143
diff --git a/src/txkube/_swagger.py b/src/txkube/_swagger.py index <HASH>..<HASH> 100644 --- a/src/txkube/_swagger.py +++ b/src/txkube/_swagger.py @@ -785,6 +785,7 @@ class VersionedPClasses(object): def __getattr__(self, name): + name = name.decode("ascii") constant_fields = {} if self.name_field is not None: constant_fields[self.name_field] = name diff --git a/src/txkube/test/test_swagger.py b/src/txkube/test/test_swagger.py index <HASH>..<HASH> 100644 --- a/src/txkube/test/test_swagger.py +++ b/src/txkube/test/test_swagger.py @@ -703,7 +703,10 @@ class VersionedPClassesTests(TestCase): ``VersionedPClasses``. """ a = VersionedPClasses(self.spec, u"a", name_field=u"name") - self.assertThat(a.foo().name, Equals(u"foo")) + self.assertThat( + a.foo().name, + MatchesAll(IsInstance(unicode), Equals(u"foo")), + ) def test_version(self):
Make sure that ``kind`` ends up as unicode.
LeastAuthority_txkube
train
py,py