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
|
---|---|---|---|---|---|
7f0a0857c01344bd52fa90f57c8eb190a2a13d30 | diff --git a/src/Composer/Command/SelfUpdateCommand.php b/src/Composer/Command/SelfUpdateCommand.php
index <HASH>..<HASH> 100644
--- a/src/Composer/Command/SelfUpdateCommand.php
+++ b/src/Composer/Command/SelfUpdateCommand.php
@@ -59,7 +59,10 @@ EOT
// free the variable to unlock the file
unset($phar);
rename($tempFilename, $localFilename);
- } catch (\UnexpectedValueException $e) {
+ } catch (\Exception $e) {
+ if (!$e instanceof \UnexpectedValueException && !$e instanceof \PharException) {
+ throw $e;
+ }
unlink($tempFilename);
$output->writeln('<error>The download is corrupt ('.$e->getMessage().').</error>');
$output->writeln('<error>Please re-run the self-update command to try again.</error>'); | Catch PharException as well in self-update failures | mothership-ec_composer | train | php |
58f11ad9976598ffd0a8fbec1794decb9b918de4 | diff --git a/lib/infer.js b/lib/infer.js
index <HASH>..<HASH> 100644
--- a/lib/infer.js
+++ b/lib/infer.js
@@ -658,6 +658,8 @@
var computeRet = fn.computeRet = function(self, args) {
// Prevent recursion
this.computeRet = null;
+ var oldOrigin = cx.curOrigin;
+ cx.curOrigin = fn.origin;
var scopeCopy = new Scope(scope.prev);
for (var v in scope.props) {
var local = scopeCopy.defProp(v);
@@ -674,9 +676,9 @@
walk.recursive(node.body, scopeCopy, null, scopeGatherer);
walk.recursive(node.body, scopeCopy, null, inferWrapper);
this.computeRet = computeRet;
+ cx.curOrigin = oldOrigin;
return scopeCopy.fnType.retval;
};
- return true;
}
function maybeTagAsGeneric(node, scope) { | Assign proper origins in instantiated functions | ternjs_tern | train | js |
77b9897bc951d260d2e1b8bd27536b34d4c73914 | diff --git a/routes/account.js b/routes/account.js
index <HASH>..<HASH> 100644
--- a/routes/account.js
+++ b/routes/account.js
@@ -114,6 +114,7 @@ function accountRoutes (server, options, next) {
validate: {
headers: validations.bearerTokenHeader,
payload: validations.accountPayload,
+ query: validations.accountQuery,
failAction: joiFailAction
}
}, | fix(routes): PATCH /session/account?include=foobar
* * *
This commit was sponsored by Neighbourhoodie
You can hire Neighbourhoodie for all your
Hoodie / CouchDB / Offline First needs
<URL> | hoodiehq_hoodie-account-server | train | js |
e3688f51d3cd1e85c310fe35e19129c64b2d08bc | diff --git a/package_test.go b/package_test.go
index <HASH>..<HASH> 100644
--- a/package_test.go
+++ b/package_test.go
@@ -52,6 +52,9 @@ func TestPackageBinfile(t *testing.T) {
}
got := pkg.Binfile()
want := filepath.Join(ctx.Bindir(), tt.want)
+ if pkg.gotargetos == "windows" {
+ want += ".exe"
+ }
if want != got {
t.Errorf("(%s).Binfile(): want %s, got %s", tt.pkg, want, got)
} | Add ".exe" to the TestPackageBinfile test for windows binaries | constabulary_gb | train | go |
77bc335443e03f38772a15b0d4a13c645da07bf4 | diff --git a/lib/WebRtcPeer.js b/lib/WebRtcPeer.js
index <HASH>..<HASH> 100644
--- a/lib/WebRtcPeer.js
+++ b/lib/WebRtcPeer.js
@@ -249,7 +249,6 @@ function WebRtcPeer(mode, options, callback) {
var audioStream = options.audioStream
var mediaConstraints = options.mediaConstraints
- var connectionConstraints = options.connectionConstraints
var pc = options.peerConnection
var sendSource = options.sendSource || 'webcam' | Delete unused "connectionConstraints" | Kurento_kurento-utils-js | train | js |
aa7211fa5dd3c821914acc3fde86c9644f013c11 | diff --git a/lib/rest-ftp-daemon/api/root.rb b/lib/rest-ftp-daemon/api/root.rb
index <HASH>..<HASH> 100644
--- a/lib/rest-ftp-daemon/api/root.rb
+++ b/lib/rest-ftp-daemon/api/root.rb
@@ -33,6 +33,12 @@ module RestFtpDaemon
# Extract message lines
lines = exception.message.lines
+ # Add some backtrace lines
+ http500_backtrace = LOG_HTP500_BACKTRACE.to_i
+ unless LOG_HTP500_BACKTRACE.to_i.zero?
+ lines += exception.backtrace[0..http500_backtrace] if exception.backtrace.is_a?(Array)
+ end
+
# Log error to file
log_error "[#{error}] [#{http_code}] #{lines.shift} ", lines
diff --git a/lib/rest-ftp-daemon/constants.rb b/lib/rest-ftp-daemon/constants.rb
index <HASH>..<HASH> 100644
--- a/lib/rest-ftp-daemon/constants.rb
+++ b/lib/rest-ftp-daemon/constants.rb
@@ -54,6 +54,7 @@ context: {
# Constants: logger to be cleaned up
LOG_PIPE_LEN = 10
LOG_INDENT = "\t"
+LOG_HTP500_BACKTRACE = 5
# Jobs statuses | api: unknown exception: add LOG_HTP<I>_BACKTRACE lines of backtrace to logs | bmedici_rest-ftp-daemon | train | rb,rb |
2349e1a9c3e4d74e6cf15d6f5df18e781d562993 | diff --git a/cli/doInit.go b/cli/doInit.go
index <HASH>..<HASH> 100644
--- a/cli/doInit.go
+++ b/cli/doInit.go
@@ -3,8 +3,10 @@ package cli
import (
log "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
+ "os"
)
func doInit(c *cli.Context) {
log.Info("[BITRISE_CLI] - Init -- Coming soon!")
+ os.Exit(1)
}
diff --git a/cli/doSetup.go b/cli/doSetup.go
index <HASH>..<HASH> 100644
--- a/cli/doSetup.go
+++ b/cli/doSetup.go
@@ -3,6 +3,7 @@ package cli
import (
log "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
+ "os"
)
const (
@@ -14,4 +15,5 @@ const (
func doSetup(c *cli.Context) {
log.Info("[BITRISE_CLI] - Setup -- Coming soon!")
+ os.Exit(1)
} | exit with code 1 for not-yet-implemented commands | bitrise-io_bitrise | train | go,go |
e00fec15571157f1241c8347893cb030ee28e034 | diff --git a/txscript/script.go b/txscript/script.go
index <HASH>..<HASH> 100644
--- a/txscript/script.go
+++ b/txscript/script.go
@@ -521,13 +521,12 @@ func calcWitnessSignatureHash(subScript []parsedOpcode, sigHashes *TxSigHashes,
func CalcWitnessSigHash(script []byte, sigHashes *TxSigHashes, hType SigHashType,
tx *wire.MsgTx, idx int, amt int64) ([]byte, error) {
- parsedScript, err := parseScript(script)
- if err != nil {
- return nil, fmt.Errorf("cannot parse output script: %v", err)
+ const scriptVersion = 0
+ if err := checkScriptParses(scriptVersion, script); err != nil {
+ return nil, err
}
- return calcWitnessSignatureHash(parsedScript, sigHashes, hType, tx, idx,
- amt)
+ return calcWitnessSignatureHashRaw(script, sigHashes, hType, tx, idx, amt)
}
// shallowCopyTx creates a shallow copy of the transaction for use when | txscript: Use optimized calcWitnessSignatureHashRaw w/o parsing | btcsuite_btcd | train | go |
b614aa711b3583636f0f762d5b0f3dc4ecad88d8 | diff --git a/hammer.js b/hammer.js
index <HASH>..<HASH> 100644
--- a/hammer.js
+++ b/hammer.js
@@ -565,6 +565,7 @@ function Hammer(element, options, undefined)
});
}
_setup();
+ _mousedown = true;
if(options.prevent_default) {
cancelEvent(event);
@@ -588,7 +589,11 @@ function Hammer(element, options, undefined)
_event_move = event;
_pos.move = getXYfromEvent(event);
- if(!gestures.transform(event)) {
+ if (_has_touch) {
+ _mousedown = true;
+ }
+
+ if(!gestures.transform(event) && _mousedown) {
gestures.drag(event);
}
break;
@@ -668,8 +673,6 @@ function Hammer(element, options, undefined)
left: box.left + scrollLeft - clientLeft
};
- _mousedown = true;
-
// hold gesture
gestures.hold(event);
} | I followed Mr. Davis's suggested fixes for the _mousedown/drag event being fired. | hammerjs_hammer.js | train | js |
d7c5f0ed9694cc9aebaf8804c200f15c26cde1d7 | diff --git a/src/strongtyping.js b/src/strongtyping.js
index <HASH>..<HASH> 100644
--- a/src/strongtyping.js
+++ b/src/strongtyping.js
@@ -102,6 +102,10 @@ StrongTyping.value = function(value, types){
}else if( typeof(type) === 'string' && type.toLowerCase() === 'never' ){
// return immediatly as a failed validator
return false;
+ }else if( typeof(type) === 'string' && type.toLowerCase() === 'nonnull' ){
+ var valid = value !== null;
+ if( valid === false ) return false;
+ continue; // continue as it is a validator
}else if( typeof(type) === 'string' && type.toLowerCase() === 'nonan' ){
var valid = value === value;
if( valid === false ) return false; | added support for "nonnull" type | jeromeetienne_better.js | train | js |
3e61730463899a27e368d6e537056dc3968e5da2 | diff --git a/question/format/blackboard_six/format.php b/question/format/blackboard_six/format.php
index <HASH>..<HASH> 100644
--- a/question/format/blackboard_six/format.php
+++ b/question/format/blackboard_six/format.php
@@ -152,8 +152,7 @@ class qformat_blackboard_six extends qformat_blackboard_six_base {
}
if ($examfile->getAttribute('type') == 'assessment/x-bb-pool') {
if ($examfile->getAttribute('baseurl')) {
- $fileobj->filebase = clean_param($this->tempdir . '/'
- . $examfile->getAttribute('baseurl'), PARAM_SAFEPATH);
+ $fileobj->filebase = $this->tempdir. '/' . $examfile->getAttribute('baseurl');
}
if ($content = $this->get_filecontent($examfile->getAttribute('file'))) {
$fileobj->filetype = self::FILETYPE_POOL; | MDL-<I> qformat_blackboard_six: Revert MDL-<I>
This reverts commit 3cafb<I>ded. | moodle_moodle | train | php |
44e7875436d760d91062e28552f73612b7be3b66 | diff --git a/definitions/npm/lodash_v4.x.x/flow_v0.63.x-/lodash_v4.x.x.js b/definitions/npm/lodash_v4.x.x/flow_v0.63.x-/lodash_v4.x.x.js
index <HASH>..<HASH> 100644
--- a/definitions/npm/lodash_v4.x.x/flow_v0.63.x-/lodash_v4.x.x.js
+++ b/definitions/npm/lodash_v4.x.x/flow_v0.63.x-/lodash_v4.x.x.js
@@ -328,7 +328,7 @@ declare module "lodash" {
remove<T>(array?: ?Array<T>, predicate?: ?Predicate<T>): Array<T>;
reverse<T>(array: Array<T>): Array<T>;
reverse<T: void | null>(array: T): T;
- slice<T>(array?: ?Array<T>, start?: ?number, end?: ?number): Array<T>;
+ slice<T>(array?: ?$ReadOnlyArray<T>, start?: ?number, end?: ?number): Array<T>;
sortedIndex<T>(array: Array<T>, value: T): number;
sortedIndex<T>(array: void | null, value: ?T): 0;
sortedIndexBy<T>( | lodash: slice should support read only array (#<I>) | flow-typed_flow-typed | train | js |
02f08f31cb8fba90bc53395cd49b57f95ed466a6 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -16,9 +16,9 @@ Capybara.default_driver = :rack_test
Capybara.default_selector = :css
# Run migrations
-# db_path = File.expand_path("../dummy/db/test.sqlite3/", __FILE__)
-# `rm #{db_path}` if File.exists?(db_path)
-# ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
+db_path = File.expand_path("../dummy/db/test.sqlite3/", __FILE__)
+`rm #{db_path}` if File.exists?(db_path)
+ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } | reenable auto migration for dummy test app | chrisconley_houdini-gem | train | rb |
66489262689b7a39c717f7279e1c8cff51546dbb | diff --git a/src/Admin/Dashboard/Widget/Users.php b/src/Admin/Dashboard/Widget/Users.php
index <HASH>..<HASH> 100644
--- a/src/Admin/Dashboard/Widget/Users.php
+++ b/src/Admin/Dashboard/Widget/Users.php
@@ -17,11 +17,6 @@ use Nails\Factory;
class Users extends Base
{
/**
- * Defines the default size for the widget when it's added to the UI
- */
- const DEFAULT_SIZE = Service\Dashboard\Widget::SIZE_MEDIUM;
-
- /**
* Whether to pad the body or not
*/
const PAD_BODY = false;
@@ -41,6 +36,26 @@ class Users extends Base
/**
* @inheritDoc
*/
+ public function getDescription(): string
+ {
+ return 'Renders a table of the site\'s user groups with top-line numbers about the users they contain.';
+ }
+
+ // --------------------------------------------------------------------------
+
+ /**
+ * @inheritDoc
+ */
+ public function getImage(): ?string
+ {
+ return null;
+ }
+
+ // --------------------------------------------------------------------------
+
+ /**
+ * @inheritDoc
+ */
public function getBody(): string
{
/** @var Group $oGroupModel */ | Update widget to be inline with updated interface | nails_module-auth | train | php |
9d165434dd87726a43217ce1d76e6b7b75289a8d | diff --git a/pkg/maps/proxymap/ipv4.go b/pkg/maps/proxymap/ipv4.go
index <HASH>..<HASH> 100644
--- a/pkg/maps/proxymap/ipv4.go
+++ b/pkg/maps/proxymap/ipv4.go
@@ -69,7 +69,7 @@ var (
bpf.MapTypeHash,
int(unsafe.Sizeof(Proxy4Key{})),
int(unsafe.Sizeof(Proxy4Value{})),
- 8192,
+ MaxEntries,
0,
func(key []byte, value []byte) (bpf.MapKey, bpf.MapValue, error) {
k, v := Proxy4Key{}, Proxy4Value{}
diff --git a/pkg/maps/proxymap/ipv6.go b/pkg/maps/proxymap/ipv6.go
index <HASH>..<HASH> 100644
--- a/pkg/maps/proxymap/ipv6.go
+++ b/pkg/maps/proxymap/ipv6.go
@@ -65,7 +65,7 @@ var (
bpf.MapTypeHash,
int(unsafe.Sizeof(Proxy6Key{})),
int(unsafe.Sizeof(Proxy6Value{})),
- 8192,
+ MaxEntries,
0,
func(key []byte, value []byte) (bpf.MapKey, bpf.MapValue, error) {
k, v := Proxy6Key{}, Proxy6Value{} | proxy: Use the same proxy map size as in BPF
Fixes: #<I> | cilium_cilium | train | go,go |
15a59d4797f54b857059e9523a63b345a8b7e930 | diff --git a/lib/listen/listener.rb b/lib/listen/listener.rb
index <HASH>..<HASH> 100644
--- a/lib/listen/listener.rb
+++ b/lib/listen/listener.rb
@@ -230,10 +230,6 @@ module Listen
# wait for changes to accumulate
sleep options[:wait_for_delay]
-
- # let changes accumulate
- next if @paused
-
_process_changes
end
rescue RuntimeError
@@ -359,7 +355,8 @@ module Listen
# for easier testing without sleep loop
def _process_changes
- return if @queue.empty?
+ return if @paused or @queue.empty?
+
changes = []
while [email protected]?
changes << @queue.pop | move pause check to _process_changes | guard_listen | train | rb |
262677050431693a8620de3a31d0e38a055ace2c | diff --git a/tests/PromiseTest/CancelTestTrait.php b/tests/PromiseTest/CancelTestTrait.php
index <HASH>..<HASH> 100644
--- a/tests/PromiseTest/CancelTestTrait.php
+++ b/tests/PromiseTest/CancelTestTrait.php
@@ -190,6 +190,31 @@ trait CancelTestTrait
}
/** @test */
+ public function cancelShouldNotTriggerCancellerWhenCancellingOneChildrenMultipleTimes()
+ {
+ $adapter = $this->getPromiseTestAdapter($this->expectCallableNever());
+
+ $child1 = $adapter->promise()
+ ->then()
+ ->then();
+
+ $child2 = $adapter->promise()
+ ->then();
+
+ $child1->cancel();
+ $child1->cancel();
+ }
+
+ /** @test */
+ public function cancelShouldTriggerCancellerOnlyOnceWhenCancellingMultipleTimes()
+ {
+ $adapter = $this->getPromiseTestAdapter($this->expectCallableOnce());
+
+ $adapter->promise()->cancel();
+ $adapter->promise()->cancel();
+ }
+
+ /** @test */
public function cancelShouldAlwaysTriggerCancellerWhenCalledOnRootPromise()
{
$adapter = $this->getPromiseTestAdapter($this->expectCallableOnce()); | Add (failing) tests for double cancellation | reactphp_promise | train | php |
0fb5b4a323ce178c026d7f9b0fed46d4582679ba | diff --git a/application/Espo/Core/Utils/Authentication/LDAP.php b/application/Espo/Core/Utils/Authentication/LDAP.php
index <HASH>..<HASH> 100644
--- a/application/Espo/Core/Utils/Authentication/LDAP.php
+++ b/application/Espo/Core/Utils/Authentication/LDAP.php
@@ -123,7 +123,7 @@ class LDAP extends Espo
if ($isPortal) {
$useLdapAuthForPortalUser = $this->getUtils()->getOption('portalUserLdapAuth');
if (!$useLdapAuthForPortalUser) {
- return parent::login($username, $password, $authToken, $isPortal);
+ return parent::login($username, $password, $authToken, $params, $request);
}
} | LDAP: Bug fixes for a portal user | espocrm_espocrm | train | php |
c86c604b4b57b861d27785df968aee671a1e9f25 | diff --git a/provision/docker/collector.go b/provision/docker/collector.go
index <HASH>..<HASH> 100644
--- a/provision/docker/collector.go
+++ b/provision/docker/collector.go
@@ -62,7 +62,7 @@ func collectUnit(container container, units chan<- provision.Unit, wg *sync.Wait
addr := strings.Replace(container.getAddress(), "http://", "", 1)
conn, err := net.Dial("tcp", addr)
if err != nil {
- unit.Status = provision.StatusBuilding
+ unit.Status = provision.StatusUnreachable
} else {
conn.Close()
unit.Status = provision.StatusStarted
diff --git a/provision/docker/collector_test.go b/provision/docker/collector_test.go
index <HASH>..<HASH> 100644
--- a/provision/docker/collector_test.go
+++ b/provision/docker/collector_test.go
@@ -39,7 +39,7 @@ func (s *S) TestCollectStatus(c *gocheck.C) {
Type: "python",
Machine: 0,
Ip: "127.0.0.1",
- Status: provision.StatusBuilding,
+ Status: provision.StatusUnreachable,
},
{
Name: "9930c24f1c6f", | docker: changed collector behaviour.
related to #<I>. | tsuru_tsuru | train | go,go |
3f59147f59e13dac661de24fd509c2c383b34a1c | diff --git a/java/server/src/org/openqa/selenium/grid/distributor/local/LocalDistributor.java b/java/server/src/org/openqa/selenium/grid/distributor/local/LocalDistributor.java
index <HASH>..<HASH> 100644
--- a/java/server/src/org/openqa/selenium/grid/distributor/local/LocalDistributor.java
+++ b/java/server/src/org/openqa/selenium/grid/distributor/local/LocalDistributor.java
@@ -97,6 +97,7 @@ public class LocalDistributor extends Distributor {
private static final Json JSON = new Json();
private static final Logger LOG = Logger.getLogger("Selenium Distributor (Local)");
private final ReadWriteLock lock = new ReentrantReadWriteLock(/* fair */ true);
+ private final HostSelector hostSelector = new DefaultHostSelector();
private final Set<Host> hosts = new HashSet<>();
private final Tracer tracer;
private final EventBus bus;
@@ -180,7 +181,6 @@ public class LocalDistributor extends Distributor {
Lock writeLock = this.lock.writeLock();
writeLock.lock();
try {
- HostSelector hostSelector = new DefaultHostSelector();
// Find a host that supports the capabilities present in the new session
Optional<Host> selectedHost = hostSelector.selectHost(firstRequest.getCapabilities(), this.hosts);
// Reserve some space for this session | [grid] Make the host selector a field | SeleniumHQ_selenium | train | java |
e4a0c158d23c5883dceb36facf9b007a0e6eb363 | diff --git a/lib/class-wp-json-server.php b/lib/class-wp-json-server.php
index <HASH>..<HASH> 100644
--- a/lib/class-wp-json-server.php
+++ b/lib/class-wp-json-server.php
@@ -356,6 +356,9 @@ class WP_JSON_Server {
$route = substr( $item['href'], strlen( $api_root ) );
$request->set_route( $route );
+ // Embedded resources get passed context=embed
+ $request->set_query_params( array( 'context' => 'embed' ) );
+
$response = $this->dispatch( $request );
if ( is_wp_error( $response ) ) {
$response = $this->error_to_response( $response ); | Always pass context=embed when embedding | WP-API_WP-API | train | php |
1eedff0dcc958221344b1a60cefdba195894a83c | diff --git a/lib/tri/table/__init__.py b/lib/tri/table/__init__.py
index <HASH>..<HASH> 100644
--- a/lib/tri/table/__init__.py
+++ b/lib/tri/table/__init__.py
@@ -1334,7 +1334,7 @@ class Table(RefinableObject):
.filter(**self.bulk_filter) \
.exclude(**self.bulk_exclude)
- if self._bulk_form.fields_by_name._all_pks_.value == '1':
+ if table.request.POST.get('_all_pks_') == '1':
return queryset
else:
pks = [key[len('pk_'):] for key in self.request.POST if key.startswith('pk_')] | bulk_queryset should be usable to create your own bulk actions without using Table.bulk_form | TriOptima_tri.table | train | py |
6ac4663692ab1f4906ca4006382fc504342dce56 | diff --git a/lib/phusion_passenger/platform_info/apache.rb b/lib/phusion_passenger/platform_info/apache.rb
index <HASH>..<HASH> 100644
--- a/lib/phusion_passenger/platform_info/apache.rb
+++ b/lib/phusion_passenger/platform_info/apache.rb
@@ -192,7 +192,7 @@ module PlatformInfo
end
# We don't want to match comments
contents.gsub!(/^[ \t]*#.*/, '')
- if contents =~ /^ErrorLog (.+)$/
+ if contents =~ /^[ \t]*ErrorLog (.+)$/
filename = $1.strip.sub(/^"/, '').sub(/"$/, '')
if filename.include?("${")
log "Error log seems to be located in \"#{filename}\", " + | Correctly detect the Apache error log location in case the ErrorLog directive is indented | phusion_passenger | train | rb |
67886045d45d4bcec767d4b3a22fbaa956dd32a1 | diff --git a/scripts/ci/index_ref_doc.py b/scripts/ci/index_ref_doc.py
index <HASH>..<HASH> 100644
--- a/scripts/ci/index_ref_doc.py
+++ b/scripts/ci/index_ref_doc.py
@@ -13,7 +13,7 @@ import tempfile
import unittest
import shutil
from subprocess import check_call
-from pkg_resources import parse_version
+from pkg_resources import parse_version, get_distribution
from six import with_metaclass
@@ -30,8 +30,18 @@ if not os.path.isdir(REF_DOC_OUT_DIR):
ALL_TESTS = []
+CLI_VERSION = get_distribution('azure-cli').version
+
for extension_name, exts in get_index_data()['extensions'].items():
- candidates_sorted = sorted(exts, key=lambda c: parse_version(c['metadata']['version']), reverse=True)
+ parsed_cli_version = parse_version(CLI_VERSION)
+ filtered_exts = []
+ for ext in exts:
+ if parsed_cli_version <= parse_version(ext['metadata'].get('azext.maxCliCoreVersion', CLI_VERSION)):
+ filtered_exts.append(ext)
+ if not filtered_exts:
+ continue
+
+ candidates_sorted = sorted(filtered_exts, key=lambda c: parse_version(c['metadata']['version']), reverse=True)
chosen = candidates_sorted[0]
ALL_TESTS.append((extension_name, chosen['downloadUrl'], chosen['filename'])) | add filtering for extensions with max version (#<I>) | Azure_azure-cli-extensions | train | py |
830c47399633e8ffbfc2f18912f9cca3e6e30fde | diff --git a/src/ServiceManager.php b/src/ServiceManager.php
index <HASH>..<HASH> 100644
--- a/src/ServiceManager.php
+++ b/src/ServiceManager.php
@@ -141,6 +141,16 @@ class ServiceManager implements ServiceLocatorInterface
protected $sharedByDefault = true;
/**
+ * ServiceManager was already configured?
+ * Maintened for bc also we don't rely on it
+ * any more
+ *
+ * @var bool
+ */
+ protected $configured = false;
+
+
+ /**
* Cached abstract factories from string.
*
* @var array
@@ -176,6 +186,7 @@ class ServiceManager implements ServiceLocatorInterface
}
$this->configure($config);
+ $this->configured = true;
}
/** | Reintroduced $configure for bc. | mxc-commons_mxc-servicemanager | train | php |
ae7c0b0a2a70678912a4d87511f5269db54cc76f | diff --git a/spec/fafx_spec.rb b/spec/fafx_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/fafx_spec.rb
+++ b/spec/fafx_spec.rb
@@ -10,13 +10,13 @@ RSpec.describe Fafx do
it 'Raise exception if date is out of range' do
expect do
- Fafx::ExchangeRate.at('2015-09-06', 'GBP', 'USD')
+ Fafx::ExchangeRate.at(Date.today - 100, 'GBP', 'USD')
end.to raise_exception(Fafx::DateError)
end
it 'Raise exception if currency does not exist' do
expect do
- Fafx::ExchangeRate.at('2018-09-06', 'ZZZ', 'USD')
+ Fafx::ExchangeRate.at(Date.today, 'ZZZ', 'USD')
end.to raise_exception(Fafx::CurrencyError)
end
end | Fixes tests with new exceptions | FrankKair_fafx | train | rb |
b407cb1ab555e4e774f197fee50fac99aa4ff670 | diff --git a/src/deep-log/lib/Driver/RumSqsDriver.js b/src/deep-log/lib/Driver/RumSqsDriver.js
index <HASH>..<HASH> 100644
--- a/src/deep-log/lib/Driver/RumSqsDriver.js
+++ b/src/deep-log/lib/Driver/RumSqsDriver.js
@@ -252,6 +252,23 @@ export class RumSqsDriver extends AbstractDriver {
}
/**
+ * @param {Function} callback
+ * @param {Object[]} additionalAttributes
+ */
+ getQueueAttributes(callback, additionalAttributes = []) {
+ let params = {
+ QueueUrl: this.queueUrl,
+ AttributeNames: [
+ 'ApproximateNumberOfMessages',
+ 'ApproximateNumberOfMessagesNotVisible',
+ 'ApproximateNumberOfMessagesDelayed'
+ ].concat(additionalAttributes)
+ };
+
+ this.sqs.getQueueAttributes(params, callback);
+ }
+
+ /**
* @param {String} queueUrl
* @returns {String}
*/ | Added getQueueAttributes method to RumSqsDriver | MitocGroup_deep-framework | train | js |
c08fbd4759706e273cab6d0cb01e79fa9d2255ca | diff --git a/app/react-native/src/bin/storybook-start.js b/app/react-native/src/bin/storybook-start.js
index <HASH>..<HASH> 100644
--- a/app/react-native/src/bin/storybook-start.js
+++ b/app/react-native/src/bin/storybook-start.js
@@ -1,9 +1,9 @@
#!/usr/bin/env node
/* eslint-disable no-console */
-
+/* eslint-disable-next-line no-camelcase */
+import child_process from 'child_process';
import path from 'path';
import program from 'commander';
-import shelljs from 'shelljs';
import Server from '../server';
program
@@ -95,7 +95,7 @@ if (!program.skipPackager) {
cliCommand = `haul start --config ${program.haul} --platform ${platform}`;
}
// RN packager
- shelljs.exec(
+ child_process.exec(
[
cliCommand,
`--projectRoots ${projectRoots.join(',')}`, | Updates storybook-start to use child_process instead of shelljs | storybooks_storybook | train | js |
a7af63037c1c8d0df63a6b9b9ea6a4955c31f03e | diff --git a/hugolib/page.go b/hugolib/page.go
index <HASH>..<HASH> 100644
--- a/hugolib/page.go
+++ b/hugolib/page.go
@@ -880,7 +880,7 @@ func (p *Page) getParam(key string, stringToLower bool) interface{} {
func (p *Page) HasMenuCurrent(menu string, me *MenuEntry) bool {
menus := p.Menus()
- sectionPagesMenu := viper.GetString("SectionPagesMenu")
+ sectionPagesMenu := helpers.Config().GetString("SectionPagesMenu")
// page is labeled as "shadow-member" of the menu with the same identifier as the section
if sectionPagesMenu != "" && p.Section() != "" && sectionPagesMenu == menu && p.Section() == me.Identifier { | Make suure SectionPagesMenu setting is always loaded per language | gohugoio_hugo | train | go |
6a1a0eaa74a402bac1e93adfffaa418cb528e0f0 | diff --git a/lib/contract_interact/helper.js b/lib/contract_interact/helper.js
index <HASH>..<HASH> 100644
--- a/lib/contract_interact/helper.js
+++ b/lib/contract_interact/helper.js
@@ -71,6 +71,7 @@ const helper = {
console.log("sendTxAsyncFromAddr :: Unlock Account", senderAddr);
return web3RpcProvider.eth.personal.unlockAccount( senderAddr, senderPassphrase)
.then( _ => {
+ var isPromiseSettled = false;
console.log("sendTxAsyncFromAddr :: Unlocked" ,senderAddr );
return new Promise(async function (onResolve, onReject) {
try {
@@ -81,11 +82,12 @@ const helper = {
console.log("sendTransaction :: callback :: result", result);
if ( error ) {
console.log("sendTxAsyncFromAddr :: sendTransaction :: error :: \n\t", error );
- onReject( error );
+ !isPromiseSettled && onReject( error );
}
})
.on('transactionHash', txHash => {
console.log("sendTxAsyncFromAddr :: sendTransaction :: transactionHash :: txHash ", txHash);
+ isPromiseSettled = true;
onResolve( txHash );
});
} catch( ex ) { | onReject should not be triggered if block is not mined for <I> blocks. | OpenSTFoundation_openst-platform | train | js |
4e0962f137999cc59e5999ab08420fea5f838e75 | diff --git a/src/bosh/agent/action/get_task.go b/src/bosh/agent/action/get_task.go
index <HASH>..<HASH> 100644
--- a/src/bosh/agent/action/get_task.go
+++ b/src/bosh/agent/action/get_task.go
@@ -3,8 +3,6 @@ package action
import (
boshtask "bosh/agent/task"
bosherr "bosh/errors"
- "encoding/json"
- "errors"
)
type getTaskAction struct {
@@ -39,22 +37,3 @@ func (a getTaskAction) Run(taskId string) (value interface{}, err error) {
err = task.Error
return
}
-
-func parseTaskId(payloadBytes []byte) (taskId string, err error) {
- var payload struct {
- Arguments []string
- }
- err = json.Unmarshal(payloadBytes, &payload)
- if err != nil {
- err = bosherr.WrapError(err, "Unmarshalling payload")
- return
- }
-
- if len(payload.Arguments) == 0 {
- err = errors.New("Not enough arguments")
- return
- }
-
- taskId = payload.Arguments[0]
- return
-} | remove unused method from get_task
This was a hold over from before the action runner refactor | cloudfoundry_bosh-agent | train | go |
5c05aca74c39c432aaa26c79a432719d666696ef | diff --git a/src/Exception/LowlevelException.php b/src/Exception/LowlevelException.php
index <HASH>..<HASH> 100644
--- a/src/Exception/LowlevelException.php
+++ b/src/Exception/LowlevelException.php
@@ -123,6 +123,12 @@ HTML;
*/
public static function catchFatalErrors(Application $app, $flush = true)
{
+ if (self::$screen !== null) {
+ echo self::$screen;
+
+ return;
+ }
+
// Get last error, if any
$error = error_get_last(); | If a LowlevelException has been thrown, just echo it in shutdown and exit | bolt_bolt | train | php |
7a713b15b719fc85ae93967521452bcb5ea27dd9 | diff --git a/core/server/src/main/java/alluxio/master/file/meta/InodeTree.java b/core/server/src/main/java/alluxio/master/file/meta/InodeTree.java
index <HASH>..<HASH> 100644
--- a/core/server/src/main/java/alluxio/master/file/meta/InodeTree.java
+++ b/core/server/src/main/java/alluxio/master/file/meta/InodeTree.java
@@ -309,8 +309,8 @@ public final class InodeTree implements JournalCheckpointStreamable {
// to the non-persisted Inodes of traversalResult.
traversalResult.getNonPersisted().add(lastInode);
toPersistDirectories.add(lastInode);
- } else if (!(options instanceof CreateDirectoryOptions && ((CreateDirectoryOptions) options)
- .isAllowExists())) {
+ } else if (!lastInode.isDirectory() || !(options instanceof CreateDirectoryOptions
+ && ((CreateDirectoryOptions) options).isAllowExists())) {
LOG.info(ExceptionMessage.FILE_ALREADY_EXISTS.getMessage(path));
throw new FileAlreadyExistsException(ExceptionMessage.FILE_ALREADY_EXISTS.getMessage(path));
} | Making sure file object creation fails when the object already exists. | Alluxio_alluxio | train | java |
2064b89470d6739349048b0d4459f180e068e7a0 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -69,7 +69,7 @@
yaml = [
'title: "' + post.title.replace(/"/g, '\\"') + '"'
, 'layout: "' + post.postType + '"'
- , 'permalink: "' + path.normalize(prefix + '/' + post.permalink) + '"'
+ , 'permalink: "' + path.normalize(prefix + '/' + post.permalink).replace(/\\+/g, '/') + '"'
, 'uuid: "' + post.uuid + '"'
, 'guid: "' + post.guid + '"'
, 'date: "' + post.published.toISOString().replace('T', ' ').replace(/\..+/g,'') + '"' | Fix paths on Windows
Convert backslashes from filenames to forward slahses for permalinks | solderjs_blogger2jekyll | train | js |
31b34964d3b4575f6f83d85a4d424f13591850e9 | diff --git a/queryset_sequence.py b/queryset_sequence.py
index <HASH>..<HASH> 100644
--- a/queryset_sequence.py
+++ b/queryset_sequence.py
@@ -178,8 +178,12 @@ class QuerySetSequence(IterableSequence):
fields_getter = lambda i: chain_singleton(attrgetter(*field_names)(i))
# comparator gets the first non-zero value of the field comparison
# results taking into account reverse order for fields prefixed with '-'
- comparator = lambda i1, i2: dropwhile(__not__,
- multiply_iterables(map(cmp, fields_getter(i1), fields_getter(i2)), reverses)).next()
+ def comparator(i1, i2):
+ try:
+ return dropwhile(__not__,
+ multiply_iterables(map(cmp, fields_getter(i1), fields_getter(i2)), reverses)).next()
+ except StopIteration:
+ return 0
# return new sorted list
return sorted(self.collapse(), cmp=comparator) | Fix when objects are found to be equal in ordering. | percipient_django-querysetsequence | train | py |
f5d2fa1e30fe2cb5440900d16b776f301a3fb370 | diff --git a/app/common/tracklist/controller.js b/app/common/tracklist/controller.js
index <HASH>..<HASH> 100755
--- a/app/common/tracklist/controller.js
+++ b/app/common/tracklist/controller.js
@@ -17,13 +17,15 @@ angular.module('spotmop.common.tracklist', [
**/
$element.mouseup( function( event ){
+ console.log( $scope );
+
// left click
if( event.which === 1 ){
$scope.$emit('spotmop:contextMenu:hide');
$scope.$emit('spotmop:track:clicked', $scope);
- // right click
- }else if( event.which === 3 ){
+ // right click (only when selected)
+ }else if( $scope.track.selected && event.which === 3 ){
$scope.$emit('spotmop:contextMenu:show', event, 'track');
}
});
@@ -85,8 +87,8 @@ angular.module('spotmop.common.tracklist', [
$scope.$emit('spotmop:contextMenu:hide');
$scope.$emit('spotmop:track:clicked', $scope);
- // right click
- }else if( event.which === 3 ){
+ // right click (only when selected)
+ }else if( $scope.track.selected && event.which === 3 ){
$scope.$emit('spotmop:contextMenu:show', event, 'tltrack');
}
}); | Only allow right-click track when selected | jaedb_spotmop | train | js |
0824197521fcd30e523cd46eff6cc27c22388ed0 | diff --git a/src/ufoLib2/pointPens/glyphPointPen.py b/src/ufoLib2/pointPens/glyphPointPen.py
index <HASH>..<HASH> 100644
--- a/src/ufoLib2/pointPens/glyphPointPen.py
+++ b/src/ufoLib2/pointPens/glyphPointPen.py
@@ -1,6 +1,5 @@
from ufoLib2.objects.component import Component
from ufoLib2.objects.contour import Contour
-from ufoLib2.objects.misc import Transformation
from ufoLib2.objects.point import Point
from ufoLib2.pointPens.basePen import AbstractPointPen
@@ -19,11 +18,18 @@ class GlyphPointPen(AbstractPointPen):
self._glyph.contours.append(self._contour)
self._contour = None
- def addPoint(self, pt, **kwargs):
- kwargs["x"], kwargs["y"] = pt
- self._contour.append(Point(**kwargs))
+ def addPoint(self, pt, segmentType=None, smooth=False, name=None,
+ identifier=None, **kwargs):
+ x, y = pt
+ self._contour.append(
+ Point(
+ x,
+ y,
+ type=segmentType,
+ smooth=smooth,
+ name=name,
+ identifier=identifier))
def addComponent(self, baseGlyph, transformation, **kwargs):
- transformation = Transformation(transformation)
component = Component(baseGlyph, transformation, **kwargs)
self._glyph.components.append(component) | glyphPointPen: allow positional arguments in addPoint
the formatting is due to yapf, don't blame me... | fonttools_ufoLib2 | train | py |
c2a6b4ae241cb9d7a84004a170284393cfb36b78 | diff --git a/lib/plugins/aws/metrics/awsMetrics.test.js b/lib/plugins/aws/metrics/awsMetrics.test.js
index <HASH>..<HASH> 100644
--- a/lib/plugins/aws/metrics/awsMetrics.test.js
+++ b/lib/plugins/aws/metrics/awsMetrics.test.js
@@ -175,8 +175,8 @@ describe('AwsMetrics', () => {
name: 'func2',
},
};
- awsMetrics.options.startTime = '1970-01-01';
- awsMetrics.options.endTime = '1970-01-02';
+ awsMetrics.options.startTime = new Date('1970-01-01');
+ awsMetrics.options.endTime = new Date('1970-01-02');
requestStub = sinon.stub(awsMetrics.provider, 'request');
}); | Fix getMetrics test by wrapping date, as we don't call validate | serverless_serverless | train | js |
7a2719fbf9421ee45b88bb65ef9e6718dae2ec4e | diff --git a/lib/fog/ecloud/compute.rb b/lib/fog/ecloud/compute.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/ecloud/compute.rb
+++ b/lib/fog/ecloud/compute.rb
@@ -2,7 +2,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'ecloud'))
require 'ipaddr'
class IPAddr
- def mask
+ def mask_string
_to_string(@mask_addr)
end
end
@@ -367,7 +367,7 @@ module Fog
end
def netmask
- self[:netmask] || subnet_ipaddr.mask
+ self[:netmask] || subnet_ipaddr.mask_string
end
def dns | add a method to IPAddr instead of breaking a useful one | fog_fog | train | rb |
a48d2a7a070540b60d50b14a201ffeba02e390f8 | diff --git a/activesupport/lib/active_support/core_ext/object/blank.rb b/activesupport/lib/active_support/core_ext/object/blank.rb
index <HASH>..<HASH> 100644
--- a/activesupport/lib/active_support/core_ext/object/blank.rb
+++ b/activesupport/lib/active_support/core_ext/object/blank.rb
@@ -47,7 +47,11 @@ class NilClass
end
end
-class FalseClass #:nodoc:
+class FalseClass
+ # Instances of FalseClass are always blank
+ # Example:
+ #
+ # false.blank? => true
def blank?
true
end | Documented FalseClass#blank? | rails_rails | train | rb |
e52a98e2f8876625baeece3477a138e0cd9e3a5b | diff --git a/client/src/main/java/io/atomix/copycat/client/session/ClientSessionSubmitter.java b/client/src/main/java/io/atomix/copycat/client/session/ClientSessionSubmitter.java
index <HASH>..<HASH> 100644
--- a/client/src/main/java/io/atomix/copycat/client/session/ClientSessionSubmitter.java
+++ b/client/src/main/java/io/atomix/copycat/client/session/ClientSessionSubmitter.java
@@ -191,7 +191,7 @@ final class ClientSessionSubmitter {
state.getLogger().debug("{} - Received {}", state.getSessionId(), response);
if (response.status() == Response.Status.OK) {
complete(response);
- } else if (response.error() == CopycatError.Type.COMMAND_ERROR || response.error() == CopycatError.Type.QUERY_ERROR || response.error() == CopycatError.Type.APPLICATION_ERROR) {
+ } else if (response.error() == CopycatError.Type.APPLICATION_ERROR) {
complete(response.error().createException());
} else if (response.error() != CopycatError.Type.UNKNOWN_SESSION_ERROR) {
strategy.attemptFailed(this, response.error().createException()); | Set command and query errors as retryable since these can potentially be recovered from | atomix_copycat | train | java |
18ad8613f5f001283a093e8368b264f672e0d904 | diff --git a/nion/instrumentation/camera_base.py b/nion/instrumentation/camera_base.py
index <HASH>..<HASH> 100644
--- a/nion/instrumentation/camera_base.py
+++ b/nion/instrumentation/camera_base.py
@@ -833,7 +833,13 @@ def update_spatial_calibrations(data_element, stem_controller, camera, camera_ca
if camera_category.lower() != "eels":
y_calibration_dict["offset"] = -y_calibration_dict["scale"] * data_shape[0] * 0.5
x_calibration_dict["offset"] = -x_calibration_dict["scale"] * data_shape[1] * 0.5
- data_element["spatial_calibrations"] = [y_calibration_dict, x_calibration_dict]
+ data_element["spatial_calibrations"] = [y_calibration_dict, x_calibration_dict]
+ else:
+ # cover the possibility that EELS data is returned as 1D
+ if len(data_shape) == 2:
+ data_element["spatial_calibrations"] = [y_calibration_dict, x_calibration_dict]
+ else:
+ data_element["spatial_calibrations"] = [x_calibration_dict]
def update_intensity_calibration(data_element, stem_controller, camera): | Handle calibration case where EELS data is returned as 1D. | nion-software_nionswift-instrumentation-kit | train | py |
a28fc17fb8d7a3149d8fcc2543aa97b620791226 | diff --git a/lib/puppet/pops/types/ruby_generator.rb b/lib/puppet/pops/types/ruby_generator.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/pops/types/ruby_generator.rb
+++ b/lib/puppet/pops/types/ruby_generator.rb
@@ -257,7 +257,7 @@ class RubyGenerator < TypeFormatter
opt.each do |ip|
bld << rname(ip.name) << ' = '
default_string(bld, ip)
- bld << ", "
+ bld << ', '
end
bld.chomp!(', ')
bld << ")\n"
@@ -273,10 +273,8 @@ class RubyGenerator < TypeFormatter
bld.chomp!(', ')
bld << ')'
end
- bld.chomp!(",\n")
bld << "\n end\n"
-
unless obj.parent.is_a?(PObjectType) && obj_attrs.empty?
# Output attr_readers
unless obj_attrs.empty? | (maint) Corrections after merge conflict | puppetlabs_puppet | train | rb |
f58a3a18977586d27fca0e44776ab5f975c91a0c | diff --git a/lib/Bacon/App.php b/lib/Bacon/App.php
index <HASH>..<HASH> 100644
--- a/lib/Bacon/App.php
+++ b/lib/Bacon/App.php
@@ -96,11 +96,15 @@ class App
return $this->use_root_controller();
} else {
$this->controller_name = 'Controllers\\' . $this->router->route->join('\\');
+
+ if (!class_exists($this->controller_name)) {
+ throw new Exceptions\RouterException;
+ }
}
} catch (Exceptions\RouterException $e) {
$this->log->debug($e->getMessage());
-
+
if (!empty($this->config->spa)) {
# Route all not found controllers to root, if single page application
return $this->use_root_controller(); | fix(router): throwing exception for route not found | Brainsware_bacon | train | php |
3eb75cbb05d9e14a9a4ca0701a16df68673e67ed | diff --git a/aikif/lib/cls_file.py b/aikif/lib/cls_file.py
index <HASH>..<HASH> 100644
--- a/aikif/lib/cls_file.py
+++ b/aikif/lib/cls_file.py
@@ -217,7 +217,7 @@ class AudioFile(File):
import aikif.toolbox.audio_tools as aud
super(AudioFile, self).__init__(fname)
self.meta = aud.get_audio_metadata(fname)
- print(self.meta)
+ #print(self.meta)
def __str__(self):
""" display the meta data from the audio file """ | fix for count lines with invalid filename | acutesoftware_AIKIF | train | py |
d4cdbe94d162db5d8dc91abfc48ca96a3ec41ffd | diff --git a/wpull/processor/web.py b/wpull/processor/web.py
index <HASH>..<HASH> 100644
--- a/wpull/processor/web.py
+++ b/wpull/processor/web.py
@@ -182,7 +182,8 @@ class WebProcessorSession(BaseProcessorSession):
self._new_initial_request()
)
- yield from self._process_loop()
+ with self._web_client_session:
+ yield from self._process_loop()
if not self._item_session.is_processed:
_logger.debug('Was not processed. Skipping.') | processor: Add context manager needed on web client session to fix conn pool | ArchiveTeam_wpull | train | py |
86cfaaeab9d02a2f2f7827123e88b41eb3be9643 | diff --git a/core/field_variable.js b/core/field_variable.js
index <HASH>..<HASH> 100644
--- a/core/field_variable.js
+++ b/core/field_variable.js
@@ -58,6 +58,7 @@ Blockly.FieldVariable = function(varname, opt_validator, opt_variableTypes) {
var hasSingleVarType = opt_variableTypes && (opt_variableTypes.length == 1);
this.defaultType_ = hasSingleVarType ? opt_variableTypes[0] : '';
this.variableTypes = opt_variableTypes;
+ this.addArgType('variable');
this.value_ = null;
}; | fixed missing argType declaration (#<I>)
ArgType was declared in field_dropdown, but not in field_varible. This prevented some css theming. | LLK_scratch-blocks | train | js |
7d828b8671fc9d33f9f00c38f9d6ac443b693f58 | diff --git a/PyFunceble.py b/PyFunceble.py
index <HASH>..<HASH> 100755
--- a/PyFunceble.py
+++ b/PyFunceble.py
@@ -1796,6 +1796,7 @@ class Referer(object):
self.ignored_extension = [
'al',
+ 'ao',
'gr',
'np',
'pa',
@@ -2570,7 +2571,7 @@ if __name__ == '__main__':
'-v',
'--version',
action='version',
- version='%(prog)s 0.20.9-beta'
+ version='%(prog)s 0.20.10-beta'
)
ARGS = PARSER.parse_args() | Introduction of `ao` into the list of ignored extensions
cf: No whois server. | funilrys_PyFunceble | train | py |
b7172d3db21b7cc9fe7ab549de2a0a079e61528d | diff --git a/willow-servers/src/main/java/com/nitorcreations/willow/metrics/SaveEventsSocket.java b/willow-servers/src/main/java/com/nitorcreations/willow/metrics/SaveEventsSocket.java
index <HASH>..<HASH> 100644
--- a/willow-servers/src/main/java/com/nitorcreations/willow/metrics/SaveEventsSocket.java
+++ b/willow-servers/src/main/java/com/nitorcreations/willow/metrics/SaveEventsSocket.java
@@ -88,7 +88,9 @@ public class SaveEventsSocket {
msgObject.addTags(tags);
}
String source = gson.toJson(stored);
- System.out.println(type.lcName() + ": " + source);
+ if (System.getProperty("debug") != null) {
+ System.out.println(type.lcName() + ": " + source);
+ }
IndexResponse resp = client.prepareIndex(getIndex(msgObject.timestamp), type.lcName()).setSource(source).execute().actionGet(1000);
if (!resp.isCreated()) {
System.out.println("Failed to create index for " + source); | Only print out messages if debug is defined in system props | NitorCreations_willow | train | java |
93a8a64383bb9e881fcdb82426212dd89d41fe87 | diff --git a/python/src/nnabla/utils/data_iterator.py b/python/src/nnabla/utils/data_iterator.py
index <HASH>..<HASH> 100644
--- a/python/src/nnabla/utils/data_iterator.py
+++ b/python/src/nnabla/utils/data_iterator.py
@@ -38,9 +38,9 @@ from nnabla.logger import logger
class DataIterator(object):
'''DataIterator
- Collect data from :ref:`data_source_design` and yields bunch of data.
+ Collect data from :ref:`data_source` and yields bunch of data.
- Detailed documentation is available in :ref:`data_iterator_design`.
+ Detailed documentation is available in :ref:`data_iterator`.
Args:
data_source (:py:class:`DataSource <nnabla.utils.data_source.DataSource>`): | fix reference to data_iterator and data_source | sony_nnabla | train | py |
08d2f6bb9e5766e228071bdc6277186c0edc8701 | diff --git a/src/Watson/Active/ActiveServiceProvider.php b/src/Watson/Active/ActiveServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Watson/Active/ActiveServiceProvider.php
+++ b/src/Watson/Active/ActiveServiceProvider.php
@@ -18,8 +18,6 @@ class ActiveServiceProvider extends ServiceProvider {
*/
public function register()
{
- $this->package('watson/active');
-
$this->app->bind('active', function()
{
return new \Watson\Active\Active($app['request'], $app['router']);
@@ -27,6 +25,16 @@ class ActiveServiceProvider extends ServiceProvider {
}
/**
+ * Boot the service provider.
+ *
+ * @return void
+ */
+ public function boot()
+ {
+ $this->package('watson/active');
+ }
+
+ /**
* Get the services provided by the provider.
*
* @return array | Move the package registration to the service provider boot() method | dwightwatson_active | train | php |
49f97de34c318f122c81d9530a408939de828903 | diff --git a/detox/src/devices/IosDriver.js b/detox/src/devices/IosDriver.js
index <HASH>..<HASH> 100644
--- a/detox/src/devices/IosDriver.js
+++ b/detox/src/devices/IosDriver.js
@@ -31,7 +31,7 @@ class IosDriver extends DeviceDriverBase {
}
async openURL(deviceId, params) {
- this.client.openURL(params);
+ await this.client.openURL(params);
}
async setURLBlacklist(urlList) { | Fix await in openURL
Closes #<I> | wix_Detox | train | js |
f614da48c38dbfed29705a01fc7e953b5bee9a3f | diff --git a/src/Illuminate/Filesystem/FilesystemAdapter.php b/src/Illuminate/Filesystem/FilesystemAdapter.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Filesystem/FilesystemAdapter.php
+++ b/src/Illuminate/Filesystem/FilesystemAdapter.php
@@ -370,6 +370,8 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
*
* @param string $path
* @return string
+ *
+ * @throws \RuntimeException
*/
public function url($path)
{
@@ -489,6 +491,8 @@ class FilesystemAdapter implements FilesystemContract, CloudFilesystemContract
* @param \DateTimeInterface $expiration
* @param array $options
* @return string
+ *
+ * @throws \RuntimeException
*/
public function temporaryUrl($path, $expiration, array $options = [])
{ | Add missed throws dockblock of FilesystemAdapter (#<I>) | laravel_framework | train | php |
9ac5d204e359950c40bd655baeb18dfd97417c6f | diff --git a/keymap/sublime.js b/keymap/sublime.js
index <HASH>..<HASH> 100644
--- a/keymap/sublime.js
+++ b/keymap/sublime.js
@@ -124,6 +124,7 @@
}
cm.setSelections(newSelection);
});
+ cm.execCommand("indentAuto");
}
cmds[map[ctrl + "Enter"] = "insertLineAfter"] = function(cm) { return insertLine(cm, false); }; | [sublime keymap] Auto-indent after insertLine | codemirror_CodeMirror | train | js |
b74d55a9355cd5010f5ab4962d3e4c1306774709 | diff --git a/goagen/gen_swagger/swagger.go b/goagen/gen_swagger/swagger.go
index <HASH>..<HASH> 100644
--- a/goagen/gen_swagger/swagger.go
+++ b/goagen/gen_swagger/swagger.go
@@ -432,7 +432,7 @@ func itemsFromDefinition(at *design.AttributeDefinition) *Items {
func responseFromDefinition(api *design.APIDefinition, r *design.ResponseDefinition) (*Response, error) {
var schema *genschema.JSONSchema
if r.MediaType != "" {
- if mt, ok := api.MediaTypes[r.MediaType]; ok {
+ if mt, ok := api.MediaTypes[design.CanonicalIdentifier(r.MediaType)]; ok {
schema = genschema.TypeSchema(api, mt)
}
} | Properly lookup Media Type when generating response swagger spec. | goadesign_goa | train | go |
b017ab67c42bf0794d9aa4ff8d1c4026c16befec | diff --git a/rpcserver.go b/rpcserver.go
index <HASH>..<HASH> 100644
--- a/rpcserver.go
+++ b/rpcserver.go
@@ -1194,7 +1194,7 @@ func (r *rpcServer) SendCoins(ctx context.Context,
}
rpcsLog.Infof("[sendcoins] addr=%v, amt=%v, sat/kw=%v, min_confs=%v, "+
- "sweep_all=%v",
+ "send_all=%v",
in.Addr, btcutil.Amount(in.Amount), int64(feePerKw), minConfs,
in.SendAll) | rpcserver: replace sweep_all in log with send_all to match rpc arg | lightningnetwork_lnd | train | go |
7a70c61dbdb1a2062d07ff6804fa67aea06fc030 | diff --git a/app/controllers/generic_files_controller.rb b/app/controllers/generic_files_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/generic_files_controller.rb
+++ b/app/controllers/generic_files_controller.rb
@@ -9,7 +9,18 @@ class GenericFilesController < ApplicationController
def new
@generic_file = GenericFile.new
- @dc_metadata = [['Title', 'title'], ['Creator', 'creator'], ['Publisher', 'publisher'], ['Description', 'description']]
+ @dc_metadata = [
+ ['Contributor', 'contributor'],
+ ['Creator', 'creator'],
+ ['Title', 'title'],
+ ['Description', 'description'],
+ ['Publisher', 'publisher'],
+ ['Date Created', 'date_created'],
+ ['Subject', 'subject'],
+ ['Language', 'language'],
+ ['Rights', 'rights'],
+ ['Rights', 'rights'],
+ ]
end
def edit | added more metadata items based on the rdf datastreams. We may need more after further discussion with stakeholders. For now, this is enough. fixes #<I> | samvera_hyrax | train | rb |
a8e1512f3afe3ad88a6f8d708aa4fd1f569ead21 | diff --git a/pkg/maps/lxcmap/lxcmap.go b/pkg/maps/lxcmap/lxcmap.go
index <HASH>..<HASH> 100644
--- a/pkg/maps/lxcmap/lxcmap.go
+++ b/pkg/maps/lxcmap/lxcmap.go
@@ -199,7 +199,7 @@ func DeleteElement(f EndpointFrontend) []error {
errors := []error{}
for _, k := range f.GetBPFKeys() {
if err := LXCMap.Delete(k); err != nil {
- errors = append(errors, fmt.Errorf("Unable to delete key %v in endpoint BPF map: %s", k, err))
+ errors = append(errors, fmt.Errorf("Unable to delete key %v from %s: %s", k, bpf.MapPath(MapName), err))
}
} | lxcmap: Improve error messages in DeleteElement()
Include the map name here, so that the caller doesn't need to.
Related: #<I> | cilium_cilium | train | go |
3534f66a4fe9cbd3b4dbfb21819223ad8a7a51a1 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ from setuptools import find_packages
setup(
name='quizler',
packages=find_packages(exclude=['tests', '*.test', '*.test.*']),
- version='0.0.2',
+ version='0.0.3',
description='Set of utils for Quizlet API',
author='Pavel Karateev',
author_email='[email protected]', | Release <I> with CLI entry_point fixes | quizl_quizler | train | py |
7e2d5c43cb8714e3f0493e9d50256d0e1f343be7 | diff --git a/isoparser/src/main/java/com/googlecode/mp4parser/authoring/builder/TwoSecondIntersectionFinder.java b/isoparser/src/main/java/com/googlecode/mp4parser/authoring/builder/TwoSecondIntersectionFinder.java
index <HASH>..<HASH> 100644
--- a/isoparser/src/main/java/com/googlecode/mp4parser/authoring/builder/TwoSecondIntersectionFinder.java
+++ b/isoparser/src/main/java/com/googlecode/mp4parser/authoring/builder/TwoSecondIntersectionFinder.java
@@ -48,6 +48,7 @@ public class TwoSecondIntersectionFinder implements FragmentIntersectionFinder {
}
int fragmentCount = (int) Math.ceil(trackLength / fragmentLength) - 1;
+ fragmentCount = Math.min(fragmentCount, track.getSamples().size());
if (fragmentCount < 1) {
fragmentCount = 1;
} | Made TwoSecondsIntersectionFinder work with samples much longer than two seconds (e.g. subtitles) | sannies_mp4parser | train | java |
ebd9dc56a5ed40cb2ca6c2432cec2f7b759d2a36 | diff --git a/tests/backend/ini.py b/tests/backend/ini.py
index <HASH>..<HASH> 100644
--- a/tests/backend/ini.py
+++ b/tests/backend/ini.py
@@ -98,6 +98,11 @@ class Test11(Test10):
self._assert_dicts_equal(cnf, instance_check=True, ccls=MyDict,
ref=CNF_0)
+ def test_15_loads__w_dict_factory(self):
+ cnf = self.psr.loads(self.cnf_s, ac_dict=MyDict)
+ self._assert_dicts_equal(cnf, instance_check=True, ccls=MyDict,
+ ref=CNF_0)
+
def test_16_loads__w_dict_factory(self):
return # FIXME.
cnf = self.psr.loads(self.cnf_s, dict_type=MyDict, ac_parse_value=True) | enhancement: add a test case if ac_dict is given to loads method of ini's parser class | ssato_python-anyconfig | train | py |
84db807e7689644664310ea90fa797ef49822817 | diff --git a/libre/apps/data_drivers/models.py b/libre/apps/data_drivers/models.py
index <HASH>..<HASH> 100644
--- a/libre/apps/data_drivers/models.py
+++ b/libre/apps/data_drivers/models.py
@@ -340,6 +340,16 @@ class SourceFileBased(models.Model):
try:
real_value = item.row
for part in post_filter['key'].split('.'):
+ if part == '_length':
+ real_value = geometry.shape(real_value).length
+ break
+ elif part == '_area':
+ real_value = geometry.shape(real_value).area
+ break
+ elif part == '_type':
+ real_value = geometry.shape(real_value).geom_type
+ break
+
try:
real_value = real_value[part]
except KeyError: | Add support for filter by the geometries properties: _length, _area, _type | commonwealth-of-puerto-rico_libre | train | py |
52b05394f7c54e9f311f23b6f39f0888742b951b | diff --git a/code/libraries/koowa/controller/service.php b/code/libraries/koowa/controller/service.php
index <HASH>..<HASH> 100644
--- a/code/libraries/koowa/controller/service.php
+++ b/code/libraries/koowa/controller/service.php
@@ -28,7 +28,6 @@ abstract class KControllerService extends KControllerResource
protected function _initialize(KConfig $config)
{
$config->append(array(
- 'persistable' => false,
'behaviors' => array('discoverable', 'editable'),
'readonly' => false,
)); | Cleanup. Removed persistable configuration option. Unused. | joomlatools_joomlatools-framework | train | php |
08ba3ed9f4989effa1b1fa18fcbe3f0b7fdd41cb | diff --git a/src/TestSuite/Fixture/SchemaCleaner.php b/src/TestSuite/Fixture/SchemaCleaner.php
index <HASH>..<HASH> 100644
--- a/src/TestSuite/Fixture/SchemaCleaner.php
+++ b/src/TestSuite/Fixture/SchemaCleaner.php
@@ -24,6 +24,8 @@ use Cake\Datasource\ConnectionManager;
/**
* This class will help dropping and truncating all tables of a given connection
+ *
+ * @internal
*/
class SchemaCleaner
{ | Mark SchemaCleaner internal | cakephp_cakephp | train | php |
22f773640ce79c91f328d14ef20de8361b2fb7f0 | diff --git a/src/history.js b/src/history.js
index <HASH>..<HASH> 100644
--- a/src/history.js
+++ b/src/history.js
@@ -113,15 +113,13 @@ class Branch {
}
remapping(from, to) {
- let maps = [], mirrors = []
+ let maps = new Mapping
this.items.forEach((item, i) => {
- if (item.mirrorOffset != null) {
- let mirrorPos = i - item.mirrorOffset
- if (mirrorPos >= from) mirrors.push(maps.length - item.mirrorOffset, maps.length)
- }
- maps.push(item.map)
+ let mirrorPos = item.mirrorOffset != null && i - item.mirrorOffset >= from
+ ? mirrorPos = maps.maps.length - item.mirrorOffset : null
+ maps.appendMap(item.map, mirrorPos)
}, from, to)
- return new Mapping(maps, mirrors)
+ return maps
}
addMaps(array) { | Don't use undocument Mapping constructor arg in Branch.remapping
Issue prosemirror/prosemirror#<I> | ProseMirror_prosemirror-history | train | js |
ce0d5ca19297984f1d995777603c802078f67ce8 | diff --git a/framework/i18n/CDateFormatter.php b/framework/i18n/CDateFormatter.php
index <HASH>..<HASH> 100644
--- a/framework/i18n/CDateFormatter.php
+++ b/framework/i18n/CDateFormatter.php
@@ -486,7 +486,7 @@ class CDateFormatter extends CComponent
*/
protected function formatTimeZone($pattern,$date)
{
- if($pattern[0]==='z' | $pattern[0]==='v')
+ if($pattern[0]==='z' || $pattern[0]==='v')
return @date('T', @mktime($date['hours'], $date['minutes'], $date['seconds'], $date['mon'], $date['mday'], $date['year']));
elseif($pattern[0]==='Z')
return @date('O', @mktime($date['hours'], $date['minutes'], $date['seconds'], $date['mon'], $date['mday'], $date['year'])); | (Fixes issue <I>) | yiisoft_yii | train | php |
db3ab32cdb72a5ba39035230828e461c4ccb75e8 | diff --git a/src/base/RestActiveController.php b/src/base/RestActiveController.php
index <HASH>..<HASH> 100644
--- a/src/base/RestActiveController.php
+++ b/src/base/RestActiveController.php
@@ -21,8 +21,6 @@ use luya\rest\ActiveController;
*/
class RestActiveController extends ActiveController implements UserBehaviorInterface
{
- use RestBehaviorsTrait;
-
/**
* @inheritdoc
*/ | fixed php <I> compatibility issue | luyadev_luya-module-admin | train | php |
4683b6084b6672f42e9fbfc9df728517d6af8335 | diff --git a/spec/unit/view_extensions/breadcrumbs_spec.rb b/spec/unit/view_extensions/breadcrumbs_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/view_extensions/breadcrumbs_spec.rb
+++ b/spec/unit/view_extensions/breadcrumbs_spec.rb
@@ -77,6 +77,22 @@ RSpec.describe Loaf::ViewExtensions, '#breadcrumbs' do
expect(view.breadcrumbs.to_a).to eq([['posts', 'http://www.example.com/posts/', 'selected']])
end
+ it "matches current path with :exact when trailing slash" do
+ view = DummyView.new
+ view.breadcrumb('posts', '/posts/', match: :exact)
+ view.set_path('/posts')
+
+ expect(view.breadcrumbs.to_a).to eq([['posts', '/posts/', 'selected']])
+ end
+
+ it "fails to match current path with :exact when nested" do
+ view = DummyView.new
+ view.breadcrumb('posts', '/posts', match: :exact)
+ view.set_path('/posts/1/comment')
+
+ expect(view.breadcrumbs.to_a).to eq([['posts', '/posts', '']])
+ end
+
it "failse to recognize the match option" do
view = DummyView.new
view.breadcrumb('posts', 'http://www.example.com/posts/', match: :boom) | Add tests for :exact match | piotrmurach_loaf | train | rb |
0cbbec594c563c313c5932b93017ea6e2d4b8e7b | diff --git a/model/ddl.go b/model/ddl.go
index <HASH>..<HASH> 100644
--- a/model/ddl.go
+++ b/model/ddl.go
@@ -137,8 +137,9 @@ func (job *Job) DecodeArgs(args ...interface{}) error {
// String implements fmt.Stringer interface.
func (job *Job) String() string {
- return fmt.Sprintf("ID:%d, Type:%s, State:%s, SchemaState:%s, SchemaID:%d, TableID:%d, Args:%s",
- job.ID, job.Type, job.State, job.SchemaState, job.SchemaID, job.TableID, job.RawArgs)
+ rowCount := job.GetRowCount()
+ return fmt.Sprintf("ID:%d, Type:%s, State:%s, SchemaState:%s, SchemaID:%d, TableID:%d, RowCount:%d, Args:%s",
+ job.ID, job.Type, job.State, job.SchemaState, job.SchemaID, job.TableID, rowCount, job.RawArgs)
}
// IsFinished returns whether job is finished or not. | model: show RowCount value after the operation of `admin show ddl` (#<I>) | pingcap_tidb | train | go |
bc9537550356dacb8485e601c40b111afee2c1b0 | diff --git a/odl/test/operator/oputils_test.py b/odl/test/operator/oputils_test.py
index <HASH>..<HASH> 100644
--- a/odl/test/operator/oputils_test.py
+++ b/odl/test/operator/oputils_test.py
@@ -171,12 +171,13 @@ def test_power_method_opnorm_nonsymm():
true_opnorm = 6
# Start vector (1, 1) is close to the wrong eigenvector
- opnorm_est = power_method_opnorm(op, maxiter=50)
+ xstart = odl.rn(2).element([1, 1])
+ opnorm_est = power_method_opnorm(op, xstart=xstart, maxiter=50)
assert almost_equal(opnorm_est, true_opnorm, places=2)
# Start close to the correct eigenvector, converges very fast
xstart = odl.rn(2).element([-0.8, 0.5])
- opnorm_est = power_method_opnorm(op, maxiter=6, xstart=xstart)
+ opnorm_est = power_method_opnorm(op, xstart=xstart, maxiter=6)
assert almost_equal(opnorm_est, true_opnorm, places=2) | TST: update power method test.
Give start guess to remove random fails. | odlgroup_odl | train | py |
3c5c6b1ec5b12242c330ba90da7f541af27c2a31 | diff --git a/src/DbProfilerServiceProvider.php b/src/DbProfilerServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/DbProfilerServiceProvider.php
+++ b/src/DbProfilerServiceProvider.php
@@ -26,7 +26,7 @@ class DbProfilerServiceProvider extends ServiceProvider
private function isEnabled()
{
- if (!$this->app->isLocal()) {
+ if ($this->app->environment('production')) {
return false;
} | DBP: Disabled only for production. | dmitry-ivanov_laravel-db-profiler | train | php |
2a2f02f3fb8a377d1a642d79964aff8c3270ea96 | diff --git a/aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModuleAgent.java b/aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModuleAgent.java
index <HASH>..<HASH> 100644
--- a/aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModuleAgent.java
+++ b/aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModuleAgent.java
@@ -245,12 +245,13 @@ class ConsensusModuleAgent implements Agent
if (null == (dynamicJoin = requiresDynamicJoin()))
{
- recoveryPlan = recordingLog.createRecoveryPlan(archive, ctx.serviceCount());
- if (null != recoveryPlan.log)
+ final long lastTermRecordingId = recordingLog.findLastTermRecordingId();
+ if (NULL_VALUE != lastTermRecordingId)
{
- archive.tryStopRecordingByIdentity(recoveryPlan.log.recordingId);
+ archive.tryStopRecordingByIdentity(lastTermRecordingId);
}
+ recoveryPlan = recordingLog.createRecoveryPlan(archive, ctx.serviceCount());
try (Counter ignore = addRecoveryStateCounter(recoveryPlan))
{
if (!recoveryPlan.snapshots.isEmpty()) | [Java] Stop recording existing log on crash recovery before creating a recovery plan. | real-logic_aeron | train | java |
f6104248cf137f7ba261908044a7999752cf1aa5 | diff --git a/osuapi/connectors.py b/osuapi/connectors.py
index <HASH>..<HASH> 100644
--- a/osuapi/connectors.py
+++ b/osuapi/connectors.py
@@ -74,9 +74,6 @@ try:
def __init__(self, sess=None):
self.sess = sess or requests.Session()
- def __del__(self):
- self.close()
-
def close(self):
self.sess.close() | Don't run requests session close in __del__
Requests does it's own clean up, and running session.close()
in __del__ is dangerous | khazhyk_osuapi | train | py |
11c04d4727c0e81267fd83ee5b14806ec5d02d8c | diff --git a/common/config/test.php b/common/config/test.php
index <HASH>..<HASH> 100644
--- a/common/config/test.php
+++ b/common/config/test.php
@@ -7,5 +7,8 @@ return [
'class' => 'yii\web\User',
'identityClass' => 'common\models\User',
],
+ 'request' => [
+ 'cookieValidationKey' => 'test',
+ ],
],
]; | Added cookie validation key to tests config | yiisoft_yii2-app-advanced | train | php |
3d51a65353dadc61abfd8ff7d821984cde81ec08 | diff --git a/tweepy/streaming.py b/tweepy/streaming.py
index <HASH>..<HASH> 100644
--- a/tweepy/streaming.py
+++ b/tweepy/streaming.py
@@ -180,7 +180,7 @@ class Stream(object):
self.url += '&count=%s' % count
self._start(async)
- def filter(self, follow=None, track=None, async=False):
+ def filter(self, follow=None, track=None, async=False, locations=None):
params = {}
self.headers['Content-type'] = "application/x-www-form-urlencoded"
if self.running:
@@ -190,6 +190,9 @@ class Stream(object):
params['follow'] = ','.join(map(str, follow))
if track:
params['track'] = ','.join(map(str, track))
+ if locations and len(locations) > 0:
+ assert len(locations) % 4 == 0
+ params['locations'] = ','.join(map(str, locations))
self.body = urllib.urlencode(params)
self._start(async) | Added filtering by locations to the streaming API. | tweepy_tweepy | train | py |
e8e108ecae1dc5a0e2aed8d8abf0e64c51a1fdee | diff --git a/aiogram/__init__.py b/aiogram/__init__.py
index <HASH>..<HASH> 100644
--- a/aiogram/__init__.py
+++ b/aiogram/__init__.py
@@ -10,5 +10,5 @@ except ImportError:
else:
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
-__version__ = '1.3.1'
+__version__ = '1.3.2'
__api_version__ = '3.6' | Oops. Bump [2] | aiogram_aiogram | train | py |
28551cb73845ba9c05accc0da874bac428e71d6f | diff --git a/src/LaravelCommentServiceProvider.php b/src/LaravelCommentServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/LaravelCommentServiceProvider.php
+++ b/src/LaravelCommentServiceProvider.php
@@ -15,8 +15,11 @@ class LaravelCommentServiceProvider extends ServiceProvider
*/
public function boot()
{
+ $timestamp = date('Y_m_d_His', time());
+
$this->publishes([
- __DIR__.'/../database/migrations/' => database_path('migrations')
+ __DIR__ . '/../database/migrations/create_comments_table.php.stub' => $this->app->databasePath()
+ . "/migrations/{$timestamp}_create_comments_table.php",
], 'migrations');
} | Add date generation while publishing migrations
Uses the migration stub and prefixes it with the current timestamp. | actuallymab_laravel-comment | train | php |
5ea8ff095133eb8a9d8fe90f26f3d14b76b3ecdf | diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -204,6 +204,8 @@ module ActiveRecord
# * updated_at/updated_on column is updated if that column is available.
# * Updates all the attributes that are dirty in this object.
#
+ # This method raises an +ActiveRecord::ActiveRecordError+ if the
+ # attribute is marked as readonly.
def update_attribute(name, value)
name = name.to_s
verify_readonly_attribute(name) | updated rdoc to reflect info about readonly attribute | rails_rails | train | rb |
927d378552a6089d9f7496fcb73703dafd5950db | diff --git a/lib/addons/memcached/index.js b/lib/addons/memcached/index.js
index <HASH>..<HASH> 100644
--- a/lib/addons/memcached/index.js
+++ b/lib/addons/memcached/index.js
@@ -16,8 +16,8 @@ module.exports = function(app, connection) {
obj._userJSONCopy = JSON.stringify(val);
}
- function populateMemcached(user) {
- return memcached.set(user.name, user);
+ function populateMemcached(key, user) {
+ return memcached.set(key, user);
}
function getMetadata(username, req, memcachedError) { | populateMemcached takes a key and value | jsbin_jsbin | train | js |
c29fda9a7850f8d0c7ffd70e6633d7cbce5a5f80 | diff --git a/jpa/core/src/main/java/org/jboss/as/jpa/config/PersistenceUnitMetadataImpl.java b/jpa/core/src/main/java/org/jboss/as/jpa/config/PersistenceUnitMetadataImpl.java
index <HASH>..<HASH> 100644
--- a/jpa/core/src/main/java/org/jboss/as/jpa/config/PersistenceUnitMetadataImpl.java
+++ b/jpa/core/src/main/java/org/jboss/as/jpa/config/PersistenceUnitMetadataImpl.java
@@ -101,7 +101,7 @@ public class PersistenceUnitMetadataImpl implements PersistenceUnitMetadata {
// transformers will be written to when the JPA persistence provider adds their transformer.
// there should be very few calls to add transformers but potentially many calls to get the
// transformer list (once per application class loaded).
- private volatile List<ClassTransformer> transformers = new CopyOnWriteArrayList<ClassTransformer>();
+ private final List<ClassTransformer> transformers = new CopyOnWriteArrayList<ClassTransformer>();
private volatile SharedCacheMode sharedCacheMode; | AS7-<I> transformers should be final | wildfly_wildfly | train | java |
e0524d2e1e0f8812780ea14fee1a1965b79e136e | diff --git a/Core/ModuleExtensionCleanerDebug.php b/Core/ModuleExtensionCleanerDebug.php
index <HASH>..<HASH> 100644
--- a/Core/ModuleExtensionCleanerDebug.php
+++ b/Core/ModuleExtensionCleanerDebug.php
@@ -118,7 +118,7 @@ class ModuleExtensionCleanerDebug extends ModuleExtensionsCleaner
*/
protected function filterExtensionsByModule($modules, $module)
{
- if ($module->isMetadataVersionGreaterEqual('2.0')) {
+ if ($this->isMetadataVersionGreaterEqual($module, '2.0')) {
$path = $module->getModuleNameSpace();
} else {
@@ -150,4 +150,9 @@ class ModuleExtensionCleanerDebug extends ModuleExtensionsCleaner
return $filteredModules;
}
-}
\ No newline at end of file
+
+ public function isMetadataVersionGreaterEqual($module, $sVersion)
+ {
+ return version_compare($module->getMetaDataVersion(), $sVersion) >= 0;
+ }
+} | fix method not found during upgrade
as the method isMetadataVersionGreaterEqual is only availible on "module" class when module internals is upgrade during the upgrade it fails to access that method | OXIDprojects_oxid-module-internals | train | php |
744c343a950cb130e70bc5dba9ef57cde8a5f0a8 | diff --git a/node/dlpa/src/dlpa.js b/node/dlpa/src/dlpa.js
index <HASH>..<HASH> 100644
--- a/node/dlpa/src/dlpa.js
+++ b/node/dlpa/src/dlpa.js
@@ -28,7 +28,20 @@ const MAG = 10 ** 5;
// flatten returns a list which flatten the given matrix.
function flatten(matrix) {
const res = [];
+
+ // If the given matrix is not a matrix but a scalar.
+ if (!Array.isArray(matrix)) {
+ matrix = [
+ [matrix]
+ ];
+ }
+
matrix.forEach((row) => {
+ // If the given matrix is a vector.
+ if (!Array.isArray(row)) {
+ row = [row];
+ }
+
row.forEach((elem) => {
res.push(elem.real);
res.push(elem.imag);
@@ -103,7 +116,7 @@ module.exports = (RED) => {
this.log(line)
})
- const client = new dlpanode.PasteClient(
+ const client = new dlpanode.DLPAClient(
`localhost:${port}`, grpc.credentials.createInsecure());
this.on("input", (msg) => { | Fixed creating wrong client classes and mishandling scalars and vectors in flatten. | jkawamoto_psi | train | js |
d1e264307182f63e3df532eab1451749b861338e | diff --git a/packages/website/next.config.js b/packages/website/next.config.js
index <HASH>..<HASH> 100644
--- a/packages/website/next.config.js
+++ b/packages/website/next.config.js
@@ -1,6 +1,5 @@
// @ts-check
const transpileModules = require("next-transpile-modules");
-const React = require("react");
const PagesWebpackPlugin = require("../../scripts/pages/pages-webpack-plugin");
const pages = require("./pages.config");
@@ -9,9 +8,6 @@ const withTranspileModules = transpileModules(["ariakit"]);
/** @type {import("next").NextConfig} */
const nextConfig = {
reactStrictMode: true,
- experimental: {
- reactRoot: /^(16|17)/.test(React.version) ? false : true,
- },
typescript: {
ignoreBuildErrors: true,
}, | Remove unnecessary reactRoot option from next config | reakit_reakit | train | js |
ccad4554421cb7447e49c103637aa58a67a6a937 | diff --git a/src/Dependency.php b/src/Dependency.php
index <HASH>..<HASH> 100644
--- a/src/Dependency.php
+++ b/src/Dependency.php
@@ -145,7 +145,7 @@ final class Dependency implements DependencyInterface
return;
}
$class = $compiler->compile($className, $bind);
- /** @var class-string $class */
+ /** @psalm-suppress ArgumentTypeCoercion */
$this->newInstance->weaveAspects($class, $bind);
}
} | suppress ArgumentTypeCoercion
* class-string doesn't work
* do not assert(class_exists) | ray-di_Ray.Di | train | php |
7f2be5788f4a3bd626df9dc2c40ba60e8ba83534 | diff --git a/src/main/java/com/bladecoder/ink/runtime/Json.java b/src/main/java/com/bladecoder/ink/runtime/Json.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/bladecoder/ink/runtime/Json.java
+++ b/src/main/java/com/bladecoder/ink/runtime/Json.java
@@ -592,6 +592,8 @@ public class Json {
controlCommandNames[CommandType.NoOp.ordinal() - 1] = "nop";
controlCommandNames[CommandType.ChoiceCount.ordinal() - 1] = "choiceCnt";
controlCommandNames[CommandType.TurnsSince.ordinal() - 1] = "turns";
+ controlCommandNames[CommandType.Random.ordinal() - 1] = "rnd";
+ controlCommandNames[CommandType.SeedRandom.ordinal() - 1] = "srnd";
controlCommandNames[CommandType.VisitIndex.ordinal() - 1] = "visit";
controlCommandNames[CommandType.SequenceShuffleIndex.ordinal() - 1] = "seq";
controlCommandNames[CommandType.StartThread.ordinal() - 1] = "thread"; | Ref. C# commit: Bah stupid me for pushing before running unit tests.
Fixed! | bladecoder_blade-ink | train | java |
ce5a460d8bd76134b10ae198f6ee3c8968e68289 | diff --git a/commands/delete.go b/commands/delete.go
index <HASH>..<HASH> 100644
--- a/commands/delete.go
+++ b/commands/delete.go
@@ -86,7 +86,7 @@ func (c *DeleteCommand) deleteByPath(path string, quiet bool) ([]DeleteFailedCre
if !quiet {
succeeded := index + 1 - len(failedCredentials)
- fmt.Printf("\033[2K\r%v out of %v credentials under the provided path are successfully deleted.", succeeded, totalCount)
+ fmt.Printf("\033[2K\r%v out of %v credentials under the provided path are successfully deleted.\n", succeeded, totalCount)
}
}
return failedCredentials, totalCount, nil | feat: command finishes with newline
* otherwise the prompt comes back at the end of the message. | cloudfoundry-incubator_credhub-cli | train | go |
20f74b7196f260c363785e1316b57db3435a5860 | diff --git a/app/Blueprint/Webserver/WebserverBlueprint.php b/app/Blueprint/Webserver/WebserverBlueprint.php
index <HASH>..<HASH> 100644
--- a/app/Blueprint/Webserver/WebserverBlueprint.php
+++ b/app/Blueprint/Webserver/WebserverBlueprint.php
@@ -380,7 +380,7 @@ class WebserverBlueprint implements Blueprint, TakesDockerAccount
}
}
- $dockerfile->run('rm -Rf /var/www/app/.rancherize');
+ $dockerfile->run('rm -Rf /var/www/app/.rancherize && rm -Rf /var/www/app/rancherize.json');
$dockerfile->setCommand('/bin/true');
return $dockerfile;
} | Webserver blueprint: delete rancherize.json in Dockerfile | ipunkt_rancherize | train | php |
e93b51a5ca7b451e55d56632b2a1b314cf83f491 | diff --git a/sonar-server/src/main/java/org/sonar/server/startup/RegisterNewProfiles.java b/sonar-server/src/main/java/org/sonar/server/startup/RegisterNewProfiles.java
index <HASH>..<HASH> 100644
--- a/sonar-server/src/main/java/org/sonar/server/startup/RegisterNewProfiles.java
+++ b/sonar-server/src/main/java/org/sonar/server/startup/RegisterNewProfiles.java
@@ -85,7 +85,7 @@ public class RegisterNewProfiles {
session = sessionFactory.getSession();
// hibernate session can contain an invalid cache of rules
- session.getEntityManager().clear();
+ session.commit();
ListMultimap<String, RulesProfile> profilesByLanguage = loadDefinitions();
for (String language : profilesByLanguage.keySet()) { | Fix loading of Hibernate rules on MyBatis | SonarSource_sonarqube | train | java |
55106e989c307decca9e45b4479db30a0f284268 | diff --git a/src/Proj.php b/src/Proj.php
index <HASH>..<HASH> 100644
--- a/src/Proj.php
+++ b/src/Proj.php
@@ -90,6 +90,8 @@ class Proj
public $to_meter = 1.0;
+
+ public $sphere = false;
/**
* Constructor: initialize | projections rely on $sphere being defined | proj4php_proj4php | train | php |
d5025f2515537cd6978ea984b31ac01b22e7bddf | diff --git a/google-cloud-bigtable/lib/google/cloud/bigtable/chunk_reader.rb b/google-cloud-bigtable/lib/google/cloud/bigtable/chunk_reader.rb
index <HASH>..<HASH> 100644
--- a/google-cloud-bigtable/lib/google/cloud/bigtable/chunk_reader.rb
+++ b/google-cloud-bigtable/lib/google/cloud/bigtable/chunk_reader.rb
@@ -39,7 +39,7 @@ module Google
if chunk.commit_row
raise_if(
- chunk.value_size.positive?,
+ chunk.value_size > 0,
"A row cant not have value_size and commit_row"
)
end | Bigtable: Fixed .positive? not present in ruby: <I> | googleapis_google-cloud-ruby | train | rb |
91d0016ae6545c8ffc4c4c071b0ece512ab4cdaf | diff --git a/src/migrations/20140826104125_instagram_profile.php b/src/migrations/20140826104125_instagram_profile.php
index <HASH>..<HASH> 100644
--- a/src/migrations/20140826104125_instagram_profile.php
+++ b/src/migrations/20140826104125_instagram_profile.php
@@ -22,8 +22,8 @@ class InstagramProfile extends AbstractMigration
->addColumn('follows_count', 'integer', [ 'null' => true, 'default' => null ])
->addColumn('media_count', 'integer', [ 'null' => true, 'default' => null ])
->addColumn('last_refreshed', 'integer')
- ->addColumn('created_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP'])
- ->addColumn('updated_at', 'timestamp', ['null' => true, 'default' => null, 'update' => 'CURRENT_TIMESTAMP'])
+ ->addColumn('created_at', 'timestamp', ['default' => 0])
+ ->addColumn('updated_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'update' => 'CURRENT_TIMESTAMP'])
->create();
}
} | use latest version of bootstrap for testing | infusephp_instagram | train | php |
15ccae91db70ab5591de66001ee2f46d540e4e19 | diff --git a/src/attributes.js b/src/attributes.js
index <HASH>..<HASH> 100644
--- a/src/attributes.js
+++ b/src/attributes.js
@@ -307,7 +307,7 @@ jQuery.extend({
// Get the appropriate hook, or the formHook
// if getSetAttribute is not supported and we have form objects in IE6/7
- hooks = jQuery.attrHooks[ name ] || ( elem.nodeName === "FORM" && formHook );
+ hooks = jQuery.attrHooks[ name ] || ( jQuery.nodeName( elem, "form" ) && formHook );
if ( value !== undefined ) { | Switch the form nodeName check in attr to use jQuery.nodeName for consistency | jquery_jquery | train | js |
4ab8de993a14c8378b9b1ac1d47af748bdf35d56 | diff --git a/tests/integration/components/star-rating-test.js b/tests/integration/components/star-rating-test.js
index <HASH>..<HASH> 100644
--- a/tests/integration/components/star-rating-test.js
+++ b/tests/integration/components/star-rating-test.js
@@ -28,3 +28,20 @@ test('Renders the full and empty stars correctly', function(assert) {
assert.equal(this.$('.glyphicon-star-empty').length, 8, "The right amount of empty stars is rendered after changing rating");
});
+test('Triggers the passed-in action handler', function(assert) {
+ assert.expect(1);
+
+ var song = Ember.Object.create({ rating: 4 }),
+ clickedRating;
+
+ this.set('song', song);
+ this.set('maxRating', 5);
+ this.on("updateRating", function(rating) {
+ clickedRating = rating;
+ });
+
+ this.render(hbs`{{star-rating item=song rating=song.rating setAction="updateRating"}}`);
+ this.$('.star-rating').click();
+
+ assert.ok(clickedRating, "The `updateRating` action was called");
+}); | Add test to see if setAction is called on click | balinterdi_ember-cli-star-rating | train | js |
0658fa64bdb656d1ff3484b8c3840508013abab0 | diff --git a/pysc2/lib/renderer_human.py b/pysc2/lib/renderer_human.py
index <HASH>..<HASH> 100644
--- a/pysc2/lib/renderer_human.py
+++ b/pysc2/lib/renderer_human.py
@@ -1033,10 +1033,15 @@ class RendererHuman(object):
creep_mask = creep > 0
creep_color = creep_feature.color(creep)
- player_feature = features.MINIMAP_FEATURES.player_relative
- player_relative = player_feature.unpack(self._obs.observation)
- player_mask = player_relative > 0
- player_color = player_feature.color(player_relative)
+ if self._obs.observation.player_common.player_id in (0, 16): # observer
+ # If we're the observer, show the absolute since otherwise all player
+ # units are friendly, making it pretty boring.
+ player_feature = features.MINIMAP_FEATURES.player_id
+ else:
+ player_feature = features.MINIMAP_FEATURES.player_relative
+ player_data = player_feature.unpack(self._obs.observation)
+ player_mask = player_data > 0
+ player_color = player_feature.color(player_data)
visibility = features.MINIMAP_FEATURES.visibility_map.unpack(
self._obs.observation) | Render the players with colors when viewing in observer mode.
PiperOrigin-RevId: <I> | deepmind_pysc2 | train | py |
99aa2cf1046db98ef8bf5b7ffbba20b874be6740 | diff --git a/app_init/tests/conftest.py b/app_init/tests/conftest.py
index <HASH>..<HASH> 100644
--- a/app_init/tests/conftest.py
+++ b/app_init/tests/conftest.py
@@ -16,8 +16,8 @@ def clear_log_directory():
if os.path.isdir(file_path):
shutil.rmtree(file_path)
if os.path.isfile(file_path):
- os.remove(file_path
-
+ os.remove(file_path)
+
def update_system_path():
"""Update the system path to ensure project modules and dependencies can be found.""" | Update conftest.py
fixed copy and paste | ThreatConnect-Inc_tcex | train | py |
a25d58b7b855a698f935f963f2af52dcc25d31e3 | diff --git a/lib/plugins/browsertime/index.js b/lib/plugins/browsertime/index.js
index <HASH>..<HASH> 100644
--- a/lib/plugins/browsertime/index.js
+++ b/lib/plugins/browsertime/index.js
@@ -253,6 +253,10 @@ module.exports = {
iteration: runIndex + 1
})
);
+ // Another hack: Browsertime automatically creates statistics for alla data in extras
+ // but we don't really need that for AXE.
+ delete result[resultIndex].extras[runIndex].axe;
+ delete result[resultIndex].statistics.extras.axe;
}
}
if (result[resultIndex].cpu) { | Remove axe artifacts that we sneak into extras | sitespeedio_sitespeed.io | train | js |
0b0fb0c09748e8669f63025fed13f1be1de62e2d | diff --git a/telemetry/telemetry/page/actions/gesture_action.py b/telemetry/telemetry/page/actions/gesture_action.py
index <HASH>..<HASH> 100644
--- a/telemetry/telemetry/page/actions/gesture_action.py
+++ b/telemetry/telemetry/page/actions/gesture_action.py
@@ -21,7 +21,10 @@ class GestureAction(page_action.PageAction):
def RunAction(self, page, tab):
runner = action_runner.ActionRunner(None, tab)
- interaction_name = 'Gesture_%s' % self.__class__.__name__
+ if self.wait_action:
+ interaction_name = 'Action_%s' % self.__class__.__name__
+ else:
+ interaction_name = 'Gesture_%s' % self.__class__.__name__
runner.BeginInteraction(interaction_name, [tir_module.IS_SMOOTH])
self.RunGesture(page, tab)
if self.wait_action: | Disable auto narrowing for gesture that contains the wait_after
BUG=<I>
Review URL: <URL> | catapult-project_catapult | train | py |
e46e6b18bc6da7fe14f2f936b68bcbd0318e6abb | diff --git a/org/postgresql/jdbc2/DatabaseMetaData.java b/org/postgresql/jdbc2/DatabaseMetaData.java
index <HASH>..<HASH> 100644
--- a/org/postgresql/jdbc2/DatabaseMetaData.java
+++ b/org/postgresql/jdbc2/DatabaseMetaData.java
@@ -2014,12 +2014,12 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
// Decimal digits = scale
// From the source (see e.g. backend/utils/adt/numeric.c,
// function numeric()) the scale and precision can be calculated
- // from the typmod value. [email protected]
+ // from the typmod value.
if (typname.equals("numeric") || typname.equals("decimal"))
{
int attypmod = r.getInt(8);
tuple[8] =
- Integer.toString((attypmod & 0xffff) - VARHDRSZ).getBytes();
+ Integer.toString((attypmod - VARHDRSZ) & 0xffff).getBytes();
}
else
tuple[8] = "0".getBytes(); | updated patch from Mark Lillywhite per Tom Lane's comments: subtract VARHDRSZ first then and with 0xffff | pgjdbc_pgjdbc | train | java |
0591161e4696e91d1d5c1da4faa422a8a85e7359 | diff --git a/tasks/locale.js b/tasks/locale.js
index <HASH>..<HASH> 100644
--- a/tasks/locale.js
+++ b/tasks/locale.js
@@ -17,7 +17,7 @@ exports.default = gulpConfig => {
.pipe(
rename(path => {
path.basename = path.basename.replace(
- new RegExp(language, 'gi'),
+ new RegExp(language.toUpperCase(), 'g'),
''
);
}) | Fix for locale´s scopes. The language code is replaced in the basename of the file with translations globally. | seznam_IMA.js-gulp-tasks | train | js |
5d703139a9812cad991708c589b0680bd88a0a6a | diff --git a/robolectric/src/main/java/org/robolectric/RobolectricTestRunner.java b/robolectric/src/main/java/org/robolectric/RobolectricTestRunner.java
index <HASH>..<HASH> 100644
--- a/robolectric/src/main/java/org/robolectric/RobolectricTestRunner.java
+++ b/robolectric/src/main/java/org/robolectric/RobolectricTestRunner.java
@@ -2,6 +2,7 @@ package org.robolectric;
import android.app.Application;
import android.os.Build;
+import java.io.InputStream;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.TestOnly;
import org.junit.Ignore;
@@ -355,7 +356,16 @@ public class RobolectricTestRunner extends SandboxTestRunner {
}
protected Properties getBuildSystemApiProperties() {
- return null;
+ InputStream resourceAsStream = getClass()
+ .getResourceAsStream("/com/android/tools/test_config.properties");
+ Properties properties = new Properties();
+ try {
+ properties.load(resourceAsStream);
+ } catch (IOException e) {
+ return null;
+ }
+
+ return properties;
}
protected AndroidManifest getAppManifest(Config config) { | Read test_config.properties as classpath resource. | robolectric_robolectric | train | java |
Subsets and Splits