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
aaa9a5512e8600b3a3bca5c9fdffaf615e3ba64d
diff --git a/lib/minitest/rake_ci.rb b/lib/minitest/rake_ci.rb index <HASH>..<HASH> 100644 --- a/lib/minitest/rake_ci.rb +++ b/lib/minitest/rake_ci.rb @@ -1,6 +1,9 @@ require 'minitest' -# Autodiscover the _plugin.rb file: -Minitest.load_plugins -Minitest::RakeCIReporter.enable! +# Don't trigger full plugin autodiscovery, as we load this +# file through RUBYOPT extension (and full autodiscovery can +# lead to e.g. incomplete definitions of Rails existing). +require_relative 'rake_ci_plugin' +Minitest.extensions << 'rake_ci' +Minitest::RakeCIReporter.enable!
# avoid triggering a minitest autodiscover in all spawned shells Would lead to Rails being partially loaded in spawned Ruby process, breaking e.g. webpacker asset compilation
PublicHealthEngland_ndr_dev_support
train
rb
b3c8036a02ccc3ddbd8d2041d07860eb1c191303
diff --git a/angr/analyses/cfg/indirect_jump_resolvers/jumptable.py b/angr/analyses/cfg/indirect_jump_resolvers/jumptable.py index <HASH>..<HASH> 100644 --- a/angr/analyses/cfg/indirect_jump_resolvers/jumptable.py +++ b/angr/analyses/cfg/indirect_jump_resolvers/jumptable.py @@ -4,6 +4,7 @@ from collections import defaultdict import pyvex +from ....errors import AngrError, SimError from ....blade import Blade from ....annocfg import AnnotatedCFG from .... import sim_options as o @@ -151,7 +152,12 @@ class JumpTableResolver(IndirectJumpResolver): # Get the jumping targets for r in slicecutor.reached_targets: - succ = project.factory.successors(r) + try: + succ = project.factory.successors(r) + except (AngrError, SimError): + # oops there are errors + l.warning('Cannot get jump successor states from a path that has reached the target. Skip it.') + continue all_states = succ.flat_successors + succ.unconstrained_successors if not all_states: l.warning("Slicecutor failed to execute the program slice. No output state is available.")
JumpTableResolver: Catch AngrError and SimError after stepping a path.
angr_angr
train
py
92ce12e19dbde99c77b7a4a305d1a46a1fbfd62b
diff --git a/bin/screenstory.js b/bin/screenstory.js index <HASH>..<HASH> 100755 --- a/bin/screenstory.js +++ b/bin/screenstory.js @@ -30,7 +30,7 @@ function collect(val, memo) { } program - .version('0.0.1') + .version(require('package.json').version) .usage('[options] <files ...>') .option('-p, --project-name <No Project>', 'Add a project name to story Ids', 'No Project')
Use package.json version in bin script
themouette_screenstory
train
js
69199754744589feac1709e45bd84d9485739e5e
diff --git a/examples/src/main/java/alluxio/examples/keyvalue/KeyValueStoreOperations.java b/examples/src/main/java/alluxio/examples/keyvalue/KeyValueStoreOperations.java index <HASH>..<HASH> 100644 --- a/examples/src/main/java/alluxio/examples/keyvalue/KeyValueStoreOperations.java +++ b/examples/src/main/java/alluxio/examples/keyvalue/KeyValueStoreOperations.java @@ -133,7 +133,7 @@ public final class KeyValueStoreOperations implements Callable<Boolean> { if (!Configuration.getBoolean(Constants.KEY_VALUE_ENABLED)) { System.out.println("Alluxio key value service is disabled. To run this test, please set " - + Constants.KEY_VALUE_ENABLED + " to be true, restart the cluster"); + + Constants.KEY_VALUE_ENABLED + " to be true and restart the cluster."); System.exit(-1); }
[SMALLFIX] Address comments
Alluxio_alluxio
train
java
f0248be012b094185958b5af549bb6ac111de385
diff --git a/extraslibs/src/com/atlantbh/jmeter/plugins/jsonutils/jsonpathassertion/JSONPathAssertion.java b/extraslibs/src/com/atlantbh/jmeter/plugins/jsonutils/jsonpathassertion/JSONPathAssertion.java index <HASH>..<HASH> 100644 --- a/extraslibs/src/com/atlantbh/jmeter/plugins/jsonutils/jsonpathassertion/JSONPathAssertion.java +++ b/extraslibs/src/com/atlantbh/jmeter/plugins/jsonutils/jsonpathassertion/JSONPathAssertion.java @@ -72,8 +72,8 @@ public class JSONPathAssertion extends AbstractTestElement implements Serializab if (expectedValue.equalsIgnoreCase(JsonPath.read(jsonString, jsonPath).toString())) { return true; } else { - throw new Exception(String.format("Response doesn't contain expected value. Expected \"%s\" but was \"%s\"!", - expectedValue, actualValue)); + throw new Exception(String.format("Path \"%s\" doesn't contain expected value. Expected \"%s\" but was \"%s\"!", + jsonPath, expectedValue, actualValue)); } }
Improved JsonAssertion Tell the user which path was being evaluated
undera_jmeter-plugins
train
java
fb078ce8e48c7564de84a3dc1bcf5651b1c6b44e
diff --git a/xml/node.go b/xml/node.go index <HASH>..<HASH> 100644 --- a/xml/node.go +++ b/xml/node.go @@ -245,8 +245,3 @@ quit: func Parse(r io.Reader) (*Node, error) { return parse(r) } - -// ParseXML returns the parse tree for the XML from the given Reader.Deprecated. -func ParseXML(r io.Reader) (*Node, error) { - return parse(r) -}
refactor: remove ParseXML() method
antchfx_xmlquery
train
go
c3857568173b91b1ade616547556f73a133d929f
diff --git a/python/ray/data/impl/progress_bar.py b/python/ray/data/impl/progress_bar.py index <HASH>..<HASH> 100644 --- a/python/ray/data/impl/progress_bar.py +++ b/python/ray/data/impl/progress_bar.py @@ -1,6 +1,7 @@ from typing import List, Any import ray +from ray.ray_constants import env_integer from ray.types import ObjectRef from ray.util.annotations import PublicAPI @@ -12,13 +13,18 @@ except ImportError: needs_warning = True # Whether progress bars are enabled in this process. -_enabled: bool = True +_enabled: bool = not bool(env_integer("RAY_DATA_DISABLE_PROGRESS_BARS", 0)) @PublicAPI def set_progress_bars(enabled: bool) -> bool: """Set whether progress bars are enabled. + The default behavior is controlled by the + ``RAY_DATA_DISABLE_PROGRESS_BARS`` environment variable. By default, + it is set to "0". Setting it to "1" will disable progress bars, unless + they are reenabled by this method. + Returns: Whether progress bars were previously enabled. """
[datasets] Add an env var for progress bar behavior (#<I>) Adds a RAY_DATA_DISABLE_PROGRESS_BARS env var to control the default progress bar behavior. The default value is "0". Setting it to "1" disables progress bars, unless they are reenabled again by the set_progress_bars method.
ray-project_ray
train
py
fa23a730bd26333184aac4984dcea2ee5eff5040
diff --git a/upload/admin/controller/user/user.php b/upload/admin/controller/user/user.php index <HASH>..<HASH> 100644 --- a/upload/admin/controller/user/user.php +++ b/upload/admin/controller/user/user.php @@ -125,7 +125,7 @@ class User extends \Opencart\System\Engine\Controller { } if (isset($this->request->get['page'])) { - $page = $this->request->get['page']; + $page = (int)$this->request->get['page']; } else { $page = 1; } @@ -490,4 +490,4 @@ class User extends \Opencart\System\Engine\Controller { return !$this->error; } -} \ No newline at end of file +}
Added integer on $page get request.
opencart_opencart
train
php
a5e634be62d1a0de5ecc36af8bb20bfe01f84e34
diff --git a/intranet/apps/bus/serializers.py b/intranet/apps/bus/serializers.py index <HASH>..<HASH> 100644 --- a/intranet/apps/bus/serializers.py +++ b/intranet/apps/bus/serializers.py @@ -1,3 +1,4 @@ +# pylint: disable=abstract-method from rest_framework import serializers from .models import Route diff --git a/intranet/apps/eighth/serializers.py b/intranet/apps/eighth/serializers.py index <HASH>..<HASH> 100644 --- a/intranet/apps/eighth/serializers.py +++ b/intranet/apps/eighth/serializers.py @@ -1,3 +1,4 @@ +# pylint: disable=abstract-method import collections import functools import logging diff --git a/intranet/apps/users/serializers.py b/intranet/apps/users/serializers.py index <HASH>..<HASH> 100644 --- a/intranet/apps/users/serializers.py +++ b/intranet/apps/users/serializers.py @@ -1,3 +1,4 @@ +# pylint: disable=abstract-method from django.contrib.auth import get_user_model from rest_framework import serializers
chore(pylint): disable abstract method checks for serializers
tjcsl_ion
train
py,py,py
067ec0bc5b5faa0aef570e655898c59138199568
diff --git a/src/App.php b/src/App.php index <HASH>..<HASH> 100644 --- a/src/App.php +++ b/src/App.php @@ -205,19 +205,19 @@ class App } /** - * @param bool $from_shutdown + * @param bool $for_shutdown if true will not pass in caughtException method. * * @throws ExitApplicationException * @throws \atk4\core\Exception */ - public function callExit($from_shutdown = false) + public function callExit($for_shutdown = false) { if (!$this->exit_called) { $this->exit_called = true; $this->hook('beforeExit'); } - if ($from_shutdown) { + if ($for_shutdown) { return; } @@ -232,6 +232,7 @@ class App * @param Throwable $exception * * @throws \atk4\core\Exception + * @throws ExitApplicationException * * @return bool */ @@ -253,7 +254,6 @@ class App $l->initLayout('Centered'); // -- CHECK ERROR BY TYPE - switch (true) { case $exception instanceof \atk4\core\Exception: @@ -284,7 +284,7 @@ class App $this->run_called = true; } - $this->callExit(); + $this->callExit(true); return true; }
Add some comment to callExit method
atk4_ui
train
php
fafa51c58c584862a0286855ca90223fc7607622
diff --git a/Tests/Twig/Extension/CSS/TypographyTwigExtensionTest.php b/Tests/Twig/Extension/CSS/TypographyTwigExtensionTest.php index <HASH>..<HASH> 100644 --- a/Tests/Twig/Extension/CSS/TypographyTwigExtensionTest.php +++ b/Tests/Twig/Extension/CSS/TypographyTwigExtensionTest.php @@ -25,6 +25,18 @@ use WBW\Bundle\BootstrapBundle\Twig\Extension\CSS\TypographyTwigExtension; class TypographyTwigExtensionTest extends AbstractTestCase { /** + * Tests the __construct() method. + * + * @return void + */ + public function testConstruct() { + + $obj = new TypographyTwigExtension($this->twigEnvironment); + + $this->assertEquals("webeweb.bootstrap.twig.extension.css.typography", TypographyTwigExtension::SERVICE_NAME); + $this->assertSame($this->twigEnvironment, $obj->getTwigEnvironment()); + } + /** * Tests the getFunctions() method. * * @return void
Complete Typography Twig extension unit tests
webeweb_bootstrap-bundle
train
php
3af82cff34450bf0da8b7f797c4880aa252c69e6
diff --git a/syntax/lexer.go b/syntax/lexer.go index <HASH>..<HASH> 100644 --- a/syntax/lexer.go +++ b/syntax/lexer.go @@ -676,7 +676,7 @@ func (p *parser) newLit(r rune) { if r <= utf8.RuneSelf { p.litBs = p.litBuf[:1] p.litBs[0] = byte(r) - } else { + } else if p.npos < len(p.bs) { w := utf8.RuneLen(r) p.litBs = append(p.litBuf[:0], p.bs[p.npos-w:p.npos]...) } diff --git a/syntax/parser_test.go b/syntax/parser_test.go index <HASH>..<HASH> 100644 --- a/syntax/parser_test.go +++ b/syntax/parser_test.go @@ -785,6 +785,10 @@ var shellTests = []errorCase{ `if; then bar; fi; ;`, `1:19: ; can only immediately follow a statement`, }, + { + "<<$\xc8", + `1:3: expansions not allowed in heredoc words`, + }, } func checkError(in, want string, mode ParseMode) func(*testing.T) {
syntax: don't slice past p.bs in p.newLit If we see encounter an error right before its call, p.npos might be set to len(p.bs)<I>.
mvdan_sh
train
go,go
35472db4dbab4609836c4cf356917cf64fd4d3f3
diff --git a/client/state/jetpack-connect/reducer/schema.js b/client/state/jetpack-connect/reducer/schema.js index <HASH>..<HASH> 100644 --- a/client/state/jetpack-connect/reducer/schema.js +++ b/client/state/jetpack-connect/reducer/schema.js @@ -34,9 +34,15 @@ export const jetpackAuthAttemptsSchema = { patternProperties: { '^.+$': { type: 'object', + additionalProperties: false, required: [ 'attempt', 'timestamp' ], - attempt: { type: 'integer' }, - timestamp: { type: 'integer' }, + properties: { + attempt: { + type: 'integer', + minimum: 0, + }, + timestamp: { type: 'integer' }, + }, }, }, };
Fix schema properties and improve precision (#<I>) Properties were not being validated, they must be in a properties object. Add `additionalProperties: false`. Add `minimum: 0` to attempts.
Automattic_wp-calypso
train
js
2a367a5066e4178f260633f5930190f18cf4eddc
diff --git a/lib/bmc-daemon-lib/mq_consumer.rb b/lib/bmc-daemon-lib/mq_consumer.rb index <HASH>..<HASH> 100644 --- a/lib/bmc-daemon-lib/mq_consumer.rb +++ b/lib/bmc-daemon-lib/mq_consumer.rb @@ -37,18 +37,17 @@ module BmcDaemonLib raise MqConsumerException, error end - # Link or create exchange + # Bind on topic exchange, if exists exchange = @channel.topic(topic, durable: true) # puts "listen_to(#{topic},#{rkey})" - @queue.bind exchange, routing_key: rkey + @queue.bind topic, routing_key: rkey # Handle errors - # rescue Bunny::NotFound => e - # log_debug "creating missing exchange [#{topic}]" - # @channel.topic topic, durable: false, auto_delete: true - # retry - # # raise MqConsumerTopicNotFound, e.message + rescue Bunny::NotFound => e + log_debug "missing exchange [#{topic}]" + #@channel.topic topic, durable: false, auto_delete: true + raise MqConsumerTopicNotFound, e.message rescue StandardError => e log_error "UNEXPECTED: #{e.inspect}"
consumer: don't try to create exchange if missing (revert behaviour change)
bmedici_bmc-daemon-lib
train
rb
e7eb8b51d09199366abae5834e7a18e46a16c2e0
diff --git a/lib/better_errors/repl/pry.rb b/lib/better_errors/repl/pry.rb index <HASH>..<HASH> 100644 --- a/lib/better_errors/repl/pry.rb +++ b/lib/better_errors/repl/pry.rb @@ -5,11 +5,7 @@ module BetterErrors module REPL class Pry class Input - def initialize(fiber) - @fiber = fiber - end - - def readline(*args) + def readline Fiber.yield end end @@ -41,7 +37,7 @@ module BetterErrors @fiber = Fiber.new do @pry.repl @binding end - @input = Input.new @fiber + @input = Input.new @output = Output.new @pry = ::Pry.new input: @input, output: @output @pry.hooks.clear_all
clean up unused code in Input class
BetterErrors_better_errors
train
rb
8029d2da9be5d4d512064f24d01b7c39998cb7ec
diff --git a/leancloud/file_.py b/leancloud/file_.py index <HASH>..<HASH> 100644 --- a/leancloud/file_.py +++ b/leancloud/file_.py @@ -56,6 +56,7 @@ class File(object): try: data.read data.tell + data.seek(0, os.SEEK_END) data.seek(0, os.SEEK_SET) except Exception: if (six.PY3 and isinstance(data, (memoryview, bytes))) or \ @@ -64,10 +65,7 @@ class File(object): elif data.read: data = io.BytesIO(data.read()) else: - raise Exception('Do not know how to handle data, accepts file like object or bytes') - - data.seek(0, os.SEEK_END) - self._metadata['size'] = data.tell() + raise TypeError('Do not know how to handle data, accepts file like object or bytes') data.seek(0, os.SEEK_SET) checksum = hashlib.md5() @@ -78,6 +76,8 @@ class File(object): checksum.update(chunk) self._metadata['_checksum'] = checksum.hexdigest() + self._metadata['size'] = data.tell() + data.seek(0, os.SEEK_SET) self._source = data
:ok_hand: Comply review suggestions
leancloud_python-sdk
train
py
50e1d6526e8ca0da580bb56fe130d526ec4e648b
diff --git a/sqlite3.go b/sqlite3.go index <HASH>..<HASH> 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -51,7 +51,7 @@ func (s sqlite3) HasTable(scope *Scope, tableName string) bool { func (s sqlite3) HasColumn(scope *Scope, tableName string, columnName string) bool { var count int - s.RawScanInt(scope, &count, fmt.Sprintf("SELECT count(*) FROM sqlite_master WHERE tbl_name = ? AND (sql LIKE '%%(\"%v\" %%' OR sql LIKE '%%,\"%v\" %%' OR sql LIKE '%%( %v %%' OR sql LIKE '%%, %v %%');\n", columnName, columnName, columnName, columnName), tableName) + s.RawScanInt(scope, &count, fmt.Sprintf("SELECT count(*) FROM sqlite_master WHERE tbl_name = ? AND (sql LIKE '%%(\"%v\" %%' OR sql LIKE '%%,\"%v\" %%' OR sql LIKE '%%, \"%v\" %%' OR sql LIKE '%%( %v %%' OR sql LIKE '%%, %v %%' OR sql LIKE '%%,%v %%');\n", columnName, columnName, columnName, columnName, columnName, columnName), tableName) return count > 0 }
sqlite3: fix HasColumn - problem with detecting columns Handle table definitions like ", \"col"" and ",col".
jinzhu_gorm
train
go
4c36c28e1ac74f81c4767ce1e9c4188884d83deb
diff --git a/tasks/faker.js b/tasks/faker.js index <HASH>..<HASH> 100644 --- a/tasks/faker.js +++ b/tasks/faker.js @@ -11,9 +11,9 @@ module.exports = function(grunt) { var path = require('path'); - var faker = require('faker'); + var Faker = require('Faker'); - // Loop through entire json object + //FLoop through entire json object function processJson(obj) { for (var i in obj) { if (typeof(obj[i]) === "object") { @@ -56,11 +56,11 @@ module.exports = function(grunt) { function executeFunctionByName(functionName, args) { var namespaces = functionName.split("."); var nsLength = namespaces.length; - var context = faker; - var parentContext = faker; + var context = Faker; + var parentContext = Faker; if (namespaces[0].toLowerCase() === 'definitions'){ - grunt.log.warn('The definitions module from faker.js is not avail in this task.'); + grunt.log.warn('The definitions module from Faker.js is not avail in this task.'); return; }
Mke sure FakerJs is referred to with cap
chrisocast_grunt-faker
train
js
58fc315fb0b05212dc6c4bd65bd50551f2f0c7b7
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ setup(name='fontaine', author_email='dave@lab6.com', url='https://github.com/davelab6/pyfontaine', # more examples here http://docs.python.org/distutils/examples.html#pure-python-distribution-by-package - packages=['fontaine', 'fontaine.charmaps', 'fontaine.structures'], + packages=['fontaine', 'fontaine.charmaps', 'fontaine.structures', 'fontaine.ext'], install_requires=[ 'freetype-py', 'lxml',
append ext to setup.py packages
davelab6_pyfontaine
train
py
519d778a9fc6721a6902a6d5a3d97f4621e6ae92
diff --git a/go/libkb/secret_store_windows.go b/go/libkb/secret_store_windows.go index <HASH>..<HASH> 100644 --- a/go/libkb/secret_store_windows.go +++ b/go/libkb/secret_store_windows.go @@ -100,7 +100,7 @@ func (k WinCredentialStore) migrateSecretStoreFile(g *GlobalContext) error { } func NewSecretStoreAll(g *GlobalContext) SecretStoreAll { - if g.Env.ForceSecretStoreFile() || !g.Env.GetFeatureFlags().Admin() { + if g.Env.ForceSecretStoreFile() { // Allow use of file secret store for development/testing return NewSecretStoreFile(g.Env.GetDataDir()) }
don't gate wincred use on admin flag (#<I>)
keybase_client
train
go
e3f397ec24b31dd3c4930095eed5034db1bcd565
diff --git a/dallinger/experiment_server/experiment_server.py b/dallinger/experiment_server/experiment_server.py index <HASH>..<HASH> 100644 --- a/dallinger/experiment_server/experiment_server.py +++ b/dallinger/experiment_server/experiment_server.py @@ -66,7 +66,7 @@ else: @app.route('/') def index(): """Index route""" - return render_template('default.html') + abort(404) @app.route('/robots.txt') diff --git a/tests/test_experiment_server.py b/tests/test_experiment_server.py index <HASH>..<HASH> 100644 --- a/tests/test_experiment_server.py +++ b/tests/test_experiment_server.py @@ -54,9 +54,9 @@ class TestExperimentServer(FlaskAppTest): participant = Participant.query.get(participant_id) participant.status = status - def test_default(self): + def test_root(self): resp = self.app.get('/') - assert 'Welcome to Dallinger!' in resp.data + assert resp.status_code == 404 def test_favicon(self): resp = self.app.get('/favicon.ico')
Return <I> instead of non-existent template Closes #<I>. (Eventually, this should return the ad page with random credentials.)
Dallinger_Dallinger
train
py,py
394990452a51190ced887450c059e78c46bb9efd
diff --git a/treeherder/config/settings.py b/treeherder/config/settings.py index <HASH>..<HASH> 100644 --- a/treeherder/config/settings.py +++ b/treeherder/config/settings.py @@ -246,13 +246,15 @@ SILENCED_SYSTEM_CHECKS = [ # User Agents # User agents which will be blocked from making requests to the site. DISALLOWED_USER_AGENTS = ( + re.compile(r'^Go-http-client/'), + # This was the old Go http package user agent prior to Go-http-client/* + # https://github.com/golang/go/commit/0d1ceef9452c495b6f6d60e578886689184e5e4b + re.compile(r'^Go 1.1 package http'), # Note: This intentionally does not match the command line curl # tool's default User Agent, only the library used by eg PHP. re.compile(r'^libcurl/'), re.compile(r'^Python-urllib/'), re.compile(r'^python-requests/'), - # ActiveData blocked for excessive API requests (bug 1289830) - re.compile(r'^ActiveData-ETL'), )
Bug <I> - Update list of blocked User Agents (#<I>) These Golang related User Agents are accessing only the site root and robots.txt, so safe to block. The ActiveData UA block can be removed, since ActiveData no longer makes requests to our API.
mozilla_treeherder
train
py
aa6e3bdae680811daaa0c3e01833b584a880b7f2
diff --git a/txtorcon/torcontrolprotocol.py b/txtorcon/torcontrolprotocol.py index <HASH>..<HASH> 100644 --- a/txtorcon/torcontrolprotocol.py +++ b/txtorcon/torcontrolprotocol.py @@ -713,7 +713,7 @@ class TorControlProtocol(LineOnlyReceiver): d.addErrback(self._auth_failed) return - if self.password_function and 'HASHEDPASSWORD' in methods: + if self.password_function and 'HASHEDPASSWORD' in methods or 'PASSWORD' in methods: d = defer.maybeDeferred(self.password_function) d.addCallback(self._do_password_authentication) d.addErrback(self._auth_failed)
Allow method 'PASSWORD' in addition to 'HASHEDPASSWORD' for password authentication
meejah_txtorcon
train
py
7bd08d986d2201d66cb2637a31cd56864460fc3c
diff --git a/src/Phlexible/Bundle/FrontendMediaBundle/Controller/MediaController.php b/src/Phlexible/Bundle/FrontendMediaBundle/Controller/MediaController.php index <HASH>..<HASH> 100644 --- a/src/Phlexible/Bundle/FrontendMediaBundle/Controller/MediaController.php +++ b/src/Phlexible/Bundle/FrontendMediaBundle/Controller/MediaController.php @@ -111,6 +111,7 @@ class MediaController extends Controller throw $this->createNotFoundException($e->getMessage(), $e); } + // TODO get lates file version $file = $volume->findFile($fileId); $filePath = $file->getPhysicalPath(); @@ -145,6 +146,7 @@ class MediaController extends Controller throw $this->createNotFoundException($e->getMessage(), $e); } + // TODO get lates file version $file = $volume->findFile($fileId); $filePath = $file->getPhysicalPath(); @@ -180,6 +182,7 @@ class MediaController extends Controller throw $this->createNotFoundException($e->getMessage(), $e); } + // TODO get lates file version $file = $volume->findFile($fileId); $mimeType = $file->getMimeType(); $mediaType = $mediaTypeManager->findByMimetype($mimeType);
Add todos to get latest file version
phlexible_phlexible
train
php
5ca0684968b84e72e95f560795cf0a1a089f3488
diff --git a/angr/analyses/veritesting.py b/angr/analyses/veritesting.py index <HASH>..<HASH> 100644 --- a/angr/analyses/veritesting.py +++ b/angr/analyses/veritesting.py @@ -269,7 +269,11 @@ class Veritesting(Analysis): else: l.debug("Function inlining is disabled.") + self._input_path.state.options.add(o.TRACK_ACTION_HISTORY) result, final_path_group = self._veritesting() + self._input_path.state.options.discard(o.TRACK_ACTION_HISTORY) + for a in final_path_group.stashes: + final_path_group.apply(stash=a, path_func=lambda p: p.state.options.discard(o.TRACK_ACTION_HISTORY)) self.result = { 'result': result,
veritesting needs to enable history tracking
angr_angr
train
py
59ada3b63d6ab798ae236674576b9c2296c510ad
diff --git a/glim/__init__.py b/glim/__init__.py index <HASH>..<HASH> 100644 --- a/glim/__init__.py +++ b/glim/__init__.py @@ -2,7 +2,6 @@ version = "0.9.4" from glim import config from glim import core -from glim import view from glim import log from glim import controller from glim import ext @@ -13,8 +12,6 @@ from glim import command # package shortcuts for easy import Config = config.ConfigFacade -View = view.ViewFacade - Log = log.LogFacade GlimLog = log.GlimLogFacade
fix glim package not resolving view module
aacanakin_glim
train
py
99ffa9c03352f27bd00ae61cebbe4a11c2436f98
diff --git a/run_tests.py b/run_tests.py index <HASH>..<HASH> 100755 --- a/run_tests.py +++ b/run_tests.py @@ -58,7 +58,7 @@ def wait_until_stop(): def start_server(): - sys.stderr = open("/dev/null", "w") + sys.stderr = open(os.devnull, "w") env.process = Process(target=start_flask_app, args=(env.host, env.port)) env.process.daemon = True env.process.start()
Replace "/dev/null" with os.devnull (#<I>)
cobrateam_splinter
train
py
e3145b956b8e77bc214c699749460bba2d394fef
diff --git a/tests/viewport-widget.py b/tests/viewport-widget.py index <HASH>..<HASH> 100755 --- a/tests/viewport-widget.py +++ b/tests/viewport-widget.py @@ -23,7 +23,7 @@ for row, col in content.yield_cells(): style = dict(color=glooey.drawing.green) WidgetClass = glooey.PlaceHolder - content[row, col] = WidgetClass(width=300, height=300, **style) + content[row, col] = WidgetClass(width=300, height=200, **style) viewport.add(content) vbox.add(viewport, expand=True)
Test a non-square Viewport child.
kxgames_glooey
train
py
5a470777197ceeb3703a1c605bb2e3bad77647cc
diff --git a/sphinxcontrib/dotnetdomain.py b/sphinxcontrib/dotnetdomain.py index <HASH>..<HASH> 100644 --- a/sphinxcontrib/dotnetdomain.py +++ b/sphinxcontrib/dotnetdomain.py @@ -8,7 +8,7 @@ from itertools import chain from six import iteritems -from sphinx import addnodes +from sphinx import addnodes, version_info as sphinx_version_info from sphinx.domains import Domain, ObjType, Index from sphinx.locale import l_ from sphinx.directives import ObjectDescription @@ -21,6 +21,8 @@ from docutils.parsers.rst import directives from docutils import nodes +SPHINX_VERSION_14 = (sphinx_version_info >= (1, 4)) + # Global regex parsing _re_parts = {} _re_parts['type_dimension'] = r'(?:\`\d+)?(?:\`\`\d+)?' @@ -228,8 +230,10 @@ class DotNetObject(ObjectDescription): index_text = self.get_index_text(None, name_obj) if index_text: - self.indexnode['entries'].append(('single', index_text, full_name, - '')) + entry = ('single', index_text, full_name, '') + if SPHINX_VERSION_14: + entry = ('single', index_text, full_name, '', None) + self.indexnode['entries'].append(entry) def get_index_text(self, prefix, name_obj): """Produce index text by directive attributes"""
Add support for sphinx <I> latex writer Adds support for multiple formats of entry listing for the latex writer. I'm not sure if there is an easy way to mock out the latex builder, it seems to be more complicated than the others. Fixes #<I>
rtfd_sphinxcontrib-dotnetdomain
train
py
e8d45e2203f6e2abeb7270941cca51568b3631a1
diff --git a/repository.go b/repository.go index <HASH>..<HASH> 100644 --- a/repository.go +++ b/repository.go @@ -107,7 +107,6 @@ func (r *Repository) Get(ro *RepositoryOptions) (*Repository, error) { func (r *Repository) ListFiles(ro *RepositoryFilesOptions) ([]RepositoryFile, error) { filePath := path.Join("/repositories", ro.Owner, ro.RepoSlug, "src", ro.Ref, ro.Path) + "/" urlStr := r.c.requestUrl(filePath) - print(urlStr) response, err := r.c.execute("GET", urlStr, "") if err != nil { return nil, err
Removed accidental print (#<I>)
ktrysmt_go-bitbucket
train
go
a9a30bf2c776ac1a9b815cafe25386fd6e0e646b
diff --git a/Controller/SecurityFOSUser1Controller.php b/Controller/SecurityFOSUser1Controller.php index <HASH>..<HASH> 100644 --- a/Controller/SecurityFOSUser1Controller.php +++ b/Controller/SecurityFOSUser1Controller.php @@ -80,11 +80,11 @@ class SecurityFOSUser1Controller extends SecurityController ? Security::LAST_USERNAME : SecurityContextInterface::LAST_USERNAME; // NEXT_MAJOR: Symfony <2.4 BC. To be removed. - if ($this->has('security.csrf.token_manager')) { - $csrfToken = $this->get('security.csrf.token_manager')->getToken('authenticate')->getValue(); + if ($this->container->has('security.csrf.token_manager')) { + $csrfToken = $this->container->get('security.csrf.token_manager')->getToken('authenticate')->getValue(); } else { - $csrfToken = $this->has('form.csrf_provider') - ? $this->get('form.csrf_provider')->generateCsrfToken('authenticate') + $csrfToken = $this->container->has('form.csrf_provider') + ? $this->container->get('form.csrf_provider')->generateCsrfToken('authenticate') : null; }
Fix non-use of container for has/get services. (#<I>)
sonata-project_SonataUserBundle
train
php
d3ff831939aa35e487a24fea13e7278a146e763c
diff --git a/three/three.py b/three/three.py index <HASH>..<HASH> 100644 --- a/three/three.py +++ b/three/three.py @@ -165,7 +165,11 @@ class Three(object): url = self._create_path('requests') self.request = requests.post(url, data=kwargs) content = self.request.content - return self.convert(content, True) + if self.request.status_code == 200: + conversion = True + else: + conversion = False + return self.convert(content, conversion) def token(self, id, **kwargs): """
Only try to convert successful POST requests
codeforamerica_three
train
py
d125df519a7a40aa0d2e7c4f975f3be52e6fa9c3
diff --git a/lib/toc.js b/lib/toc.js index <HASH>..<HASH> 100644 --- a/lib/toc.js +++ b/lib/toc.js @@ -43,7 +43,7 @@ module.exports = function (source, options) { cache[href] = 1; } - var tocElem = '* [' + header.text.replace(/\\/g, '\\\\') + '](#' + href + ')' + EOL, + var tocElem = '- [' + header.text.replace(/\\/g, '\\\\') + '](#' + href + ')' + EOL, indent = utils.getIndent(usedHeaders, header.depth); usedHeaders.unshift({
Use 'hyphen' instead of 'asterisk' in the generated TOC
eGavr_toc-md
train
js
90268822ca5b9034fab7c638f8cbd0320edc6709
diff --git a/src/main/java/co/aurasphere/botmill/fb/model/incoming/callback/Referral.java b/src/main/java/co/aurasphere/botmill/fb/model/incoming/callback/Referral.java index <HASH>..<HASH> 100644 --- a/src/main/java/co/aurasphere/botmill/fb/model/incoming/callback/Referral.java +++ b/src/main/java/co/aurasphere/botmill/fb/model/incoming/callback/Referral.java @@ -65,7 +65,7 @@ public class Referral implements Serializable { // TODO: https://github.com/BotMill/fb-botmill/issues/19 /** * The source of this referral. Currently, the only possible value is - * �SHORTLINK�. + * "SHORTLINK". */ private String source;
Fixed the unicode character that's preventing the CI build
BotMill_fb-botmill
train
java
e72a48eb20804998050dc42dc07c3fcb427ca838
diff --git a/js/base/Exchange.js b/js/base/Exchange.js index <HASH>..<HASH> 100644 --- a/js/base/Exchange.js +++ b/js/base/Exchange.js @@ -2244,11 +2244,12 @@ module.exports = class Exchange { const timeInForceUpper = timeInForce.toUpperCase (); const typeLower = type.toLowerCase (); const ioc = timeInForceUpper === 'IOC'; + const fok = timeInForceUpper === 'FOK'; const timeInForcePostOnly = timeInForceUpper === 'PO'; const isMarket = typeLower === 'market'; postOnly = postOnly || typeLower === 'postonly' || timeInForcePostOnly || exchangeSpecificOption; if (postOnly) { - if (ioc) { + if (ioc || fok) { throw new InvalidOrder (this.id + ' postOnly orders cannot have timeInForce equal to ' + timeInForce); } else if (isMarket) { throw new InvalidOrder (this.id + ' postOnly orders cannot have type ' + type);
fok added to disallowed timeInForce with postOnly
ccxt_ccxt
train
js
66551c77ffac1da3295a5b7560be9c22e033b80d
diff --git a/app/helpers/xml_helper.rb b/app/helpers/xml_helper.rb index <HASH>..<HASH> 100644 --- a/app/helpers/xml_helper.rb +++ b/app/helpers/xml_helper.rb @@ -1,2 +1,16 @@ module XmlHelper + def collection_lastmod(collection) + article_updated = collection.articles.find(:first, :order => 'updated_at DESC') + article_published = collection.articles.find(:first, :order => 'published_at DESC') + + times = [] + times.push article_updated.updated_at if article_updated + times.push article_published.updated_at if article_published + + if times.empty? + Time.at(0).xmlschema + else + times.max.xmlschema + end + end end diff --git a/spec/controllers/xml_controller_spec.rb b/spec/controllers/xml_controller_spec.rb index <HASH>..<HASH> 100644 --- a/spec/controllers/xml_controller_spec.rb +++ b/spec/controllers/xml_controller_spec.rb @@ -178,6 +178,7 @@ describe XmlController do # TODO(laird): make this more robust it "test_sitemap" do + Factory(:category) get :feed, :format => 'googlesitemap', :type => 'sitemap' assert_response :success
Fix google sitemap. Restores XmlHelper#collection_lastmod, which had been removed in commit f4eeaaa<I>b4c<I>cfe<I>bea<I>f<I>.
publify_publify
train
rb,rb
2cb05b1db1af0b4afdc5d4ac019c94e74bffa466
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,8 @@ from distutils.core import setup setup( name = 'redash_client', - packages = ['redash_client'], - version = '0.1.4', + packages = ['redash_client', 'redash_client.dashboards'], + version = '0.1.5', description = 'A client for the re:dash API for stmo (https://sql.telemetry.mozilla.org)', author = 'Marina Samuel', author_email = 'msamuel@mozilla.com',
Pip packaging should include dashboards subdirectory.
mozilla_redash_client
train
py
1aaf6837fc18fc89cef41ef7cb39c6d825366ab2
diff --git a/test/unit/search_query_test.rb b/test/unit/search_query_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/search_query_test.rb +++ b/test/unit/search_query_test.rb @@ -10,6 +10,12 @@ module Slingshot::Search assert_respond_to Query.new, :to_json end + should "allow a block to be given" do + assert_equal( { :term => { :foo => 'bar' } }.to_json, Query.new do + term(:foo, 'bar') + end.to_json) + end + should "allow search for single term" do assert_equal( { :term => { :foo => 'bar' } }, Query.new.term(:foo, 'bar') ) end
[REFACTORING] Added test for instance_eval in Search::Query#initialize
karmi_retire
train
rb
92107b4284ce8fe82ab8996e59f34ec54f7eefa2
diff --git a/internetarchive/internetarchive.py b/internetarchive/internetarchive.py index <HASH>..<HASH> 100755 --- a/internetarchive/internetarchive.py +++ b/internetarchive/internetarchive.py @@ -60,7 +60,7 @@ class Item(object): #_____________________________________________________________________________________ def files(self): """Generator for iterating over files in an item""" - for file_dict in self.metadata['files']: + for file_dict in self.metadata.get('files', []): file = File(self, file_dict) yield file @@ -277,6 +277,7 @@ class File(object): #_____________________________________________________________________________________ def __init__(self, item, file_dict): self.item = item + self.external_identifier = file_dict.get('external-identifier') self.name = file_dict.get('name') self.source = file_dict.get('source') self.size = file_dict.get('size')
If file-level metadata is not available for an item, return an empty iterator rather than KeyError in item.files(). Added external_identifier attribute to the File class.
jjjake_internetarchive
train
py
626224a70ca97d5eeffe549ea80bb4ea90c8bdd8
diff --git a/Lib/fontParts/objects/nonelab/__init__.py b/Lib/fontParts/objects/nonelab/__init__.py index <HASH>..<HASH> 100644 --- a/Lib/fontParts/objects/nonelab/__init__.py +++ b/Lib/fontParts/objects/nonelab/__init__.py @@ -1 +1,17 @@ -from font import RFont \ No newline at end of file +from fontParts.objects.base.errors import FontPartsError +from font import RFont +from info import RInfo +from groups import RGroups +from kerning import RKerning +from features import RFeatures +from lib import RLib +from layer import RLayer +from glyph import RGlyph +from contour import RContour +from point import RPoint +from segment import RSegment +from bPoint import RBPoint +from component import RComponent +from anchor import RAnchor +from guideline import RGuideline +from image import RImage
adding imports to top level nonelab
robotools_fontParts
train
py
f5ff61bc1f73829ff4edb34887df76cb466b46eb
diff --git a/src/MetaModels/MetaModel.php b/src/MetaModels/MetaModel.php index <HASH>..<HASH> 100644 --- a/src/MetaModels/MetaModel.php +++ b/src/MetaModels/MetaModel.php @@ -729,10 +729,16 @@ class MetaModel implements IMetaModel // Build the right key for the cache. $sortKey = \sprintf('%s-%s', $strSortBy, \strtolower($strSortOrder)); // Used the cached ID list, and make a list of wanted ID's with the sorting of the cache. - $cacheResult = array_intersect((array) $this->existingIds[$sortKey], $arrFilteredIds); + if (!isset($this->existingIds[$sortKey])) { + $this->existingIds[$sortKey] = []; + } + $cacheResult = array_intersect($this->existingIds[$sortKey], $arrFilteredIds); // Check if we have all ID's or if we have one missing, now we are using the order of the MM Filter. if (array_intersect($arrFilteredIds, $cacheResult) === $arrFilteredIds) { - return $cacheResult; + if ($intOffset > 0 || $intLimit > 0) { + return array_values(array_slice($cacheResult, $intOffset, $intLimit ?: null)); + } + return array_values($cacheResult); } // Merge the already known and the new one.
Fix slicing bug in MetaModel::getIdsFromFilter The method `MetaModel::getIdsFromFilter` lost support for offset and limit when we introduced the id cache. The functionality has been restored.
MetaModels_core
train
php
72744750c6046f0b45c4510d7a56562e5df01c04
diff --git a/graylog2-server/src/main/java/org/graylog2/CommandLineArguments.java b/graylog2-server/src/main/java/org/graylog2/CommandLineArguments.java index <HASH>..<HASH> 100644 --- a/graylog2-server/src/main/java/org/graylog2/CommandLineArguments.java +++ b/graylog2-server/src/main/java/org/graylog2/CommandLineArguments.java @@ -42,7 +42,7 @@ public class CommandLineArguments { private String pluginShortname; @Parameter(names = {"-v", "--plugin-version"}, description = "Install plugin with this version") - private String pluginVersion = Core.GRAYLOG2_VERSION; + private String pluginVersion = Core.GRAYLOG2_VERSION.toString(); @Parameter(names = {"-m", "--force-plugin"}, description = "Force plugin installation even if this version of graylog2-server is not officially supported.") private boolean forcePlugin = false;
Fixing compilation error related to new Version class
Graylog2_graylog2-server
train
java
f501d3dcf35bacd3cfa6f6ef52c96d86377dd583
diff --git a/spec/aggregator_cfgs_and_properties_spec.rb b/spec/aggregator_cfgs_and_properties_spec.rb index <HASH>..<HASH> 100644 --- a/spec/aggregator_cfgs_and_properties_spec.rb +++ b/spec/aggregator_cfgs_and_properties_spec.rb @@ -333,7 +333,7 @@ describe JsDuck::Aggregator do /** * Some documentation. */ - Ext.createAlias(class, "foo", "bar"); + Ext.createAlias(MyClass, "foo", "bar"); EOS end it "should fail detecting name of the property" do
Remove use of reserved word from cfgs/props spec.
senchalabs_jsduck
train
rb
8db200e56d524865263a3a42bfffd4af9ec285e1
diff --git a/src/API.js b/src/API.js index <HASH>..<HASH> 100644 --- a/src/API.js +++ b/src/API.js @@ -149,6 +149,12 @@ export class API extends ol.Object { ) } + setVisibleBaseLayer (id) { + this.map_.get('baseLayers').recursiveForEach((layer) => { + layer.setVisible(layer.get('id') === id) + }) + } + onKeyDown_ (e) { if (this.featureManipulationActive_ && e.which === keyCodes.ESCAPE) { this.endFeatureManipulationInternal_()
added setVisibleBaseLayer to API (selected by id)
KlausBenndorf_guide4you
train
js
6fe02f9a2c6637ba6113d6130dbdf37aff2727d3
diff --git a/activerecord/lib/active_record/test_case.rb b/activerecord/lib/active_record/test_case.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/test_case.rb +++ b/activerecord/lib/active_record/test_case.rb @@ -1,3 +1,7 @@ +require 'active_support/deprecation' +require 'active_support/test_case' + +ActiveSupport::Deprecation.warn('ActiveRecord::TestCase is deprecated, please use ActiveSupport::TestCase') module ActiveRecord # = Active Record Test Case #
deprecated AR::TestCase in favor of AS::TestCase
rails_rails
train
rb
7ddbb2535d4f21a968dacb869860bffd50822c7f
diff --git a/core/src/main/java/tachyon/client/TachyonFS.java b/core/src/main/java/tachyon/client/TachyonFS.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/tachyon/client/TachyonFS.java +++ b/core/src/main/java/tachyon/client/TachyonFS.java @@ -11,6 +11,7 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; +import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -200,13 +201,14 @@ public class TachyonFS extends AbstractTachyonFS { /** * Create a user local temporary folder and return it * - * @return the local temporary folder for the user + * @return the local temporary folder for the user or null if unable to allocate one. * @throws IOException */ synchronized File createAndGetUserLocalTempFolder() throws IOException { String userTempFolder = mWorkerClient.getUserTempFolder(); - if (userTempFolder == null) { + if (StringUtils.isBlank(userTempFolder)) { + LOG.error("Unable to get local temporary folder location for user."); return null; }
Add check for empty String for the local directory in addition to null. Add logging to detect why return null.
Alluxio_alluxio
train
java
35cc2854a5ea921ec9b8c69b3edd5db1bbbd5687
diff --git a/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/ContaoBackendViewTemplate.php b/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/ContaoBackendViewTemplate.php index <HASH>..<HASH> 100644 --- a/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/ContaoBackendViewTemplate.php +++ b/src/ContaoCommunityAlliance/DcGeneral/Contao/View/Contao2BackendView/ContaoBackendViewTemplate.php @@ -141,4 +141,30 @@ class ContaoBackendViewTemplate extends BackendTemplate implements ViewTemplateI $renderer = new GlobalButtonRenderer($environment); return $renderer->render(); } + + // @codingStandardsIgnoreStart + /** + * {@inheritDoc} + */ + public function getData() + { + return parent::getData(); + } + + /** + * {@inheritDoc} + */ + public function parse() + { + return parent::parse(); + } + + /** + * {@inheritDoc} + */ + public function output() + { + parent::output(); + } + // @codingStandardsIgnoreEnd }
Revert some methods in the ContaoBackendViewTemplate and ignore from coding standard. It was broken by phpunit tests
contao-community-alliance_dc-general
train
php
9f945c2216cd9d8a89f4f20794d63dbd11a6dcd4
diff --git a/processing/src/main/java/io/druid/segment/data/CompressedObjectStrategy.java b/processing/src/main/java/io/druid/segment/data/CompressedObjectStrategy.java index <HASH>..<HASH> 100644 --- a/processing/src/main/java/io/druid/segment/data/CompressedObjectStrategy.java +++ b/processing/src/main/java/io/druid/segment/data/CompressedObjectStrategy.java @@ -270,7 +270,6 @@ public class CompressedObjectStrategy<T extends Buffer> implements ObjectStrateg public static class LZ4Compressor implements Compressor { private static final LZ4Compressor defaultCompressor = new LZ4Compressor(); - private static final net.jpountz.lz4.LZ4Compressor lz4Fast = LZ4Factory.fastestInstance().fastCompressor(); private static final net.jpountz.lz4.LZ4Compressor lz4High = LZ4Factory.fastestInstance().highCompressor(); @Override
Removed lz4Fast from CompressedObjectStrategy for compression since it is not currently used
apache_incubator-druid
train
java
59e842925170200d9308e2130028714e10dfbfc0
diff --git a/src/apb/engine.py b/src/apb/engine.py index <HASH>..<HASH> 100644 --- a/src/apb/engine.py +++ b/src/apb/engine.py @@ -382,6 +382,7 @@ def get_registry_service_ip(namespace, svc_name): def get_asb_route(): asb_route = None route_list = None + suffix = None possible_namespaces = ["ansible-service-broker", "openshift-ansible-service-broker", "openshift-automation-service-broker"] for namespace in possible_namespaces: @@ -390,6 +391,7 @@ def get_asb_route(): oapi = openshift_client.OapiApi() route_list = oapi.list_namespaced_route(namespace) if route_list.items != []: + suffix = namespace break except ApiException as e: print("Didn't find OpenShift Automation Broker route in namespace: %s.\ @@ -406,8 +408,10 @@ def get_asb_route(): if asb_route is None: print("Error finding a route to the OpenShift Automation Broker.") return None + if suffix is None: + suffix = "openshift-automation-service-broker" - url = asb_route + "/openshift-automation-service-broker" + url = asb_route + "/" + suffix if url.find("http") < 0: url = "https://" + url
Fix suffix so that its not hardcoded (#<I>) * Fix suffix so that its not hardoded * Fix typo
ansibleplaybookbundle_ansible-playbook-bundle
train
py
3433001e4b312172ebf1ff8623922f7f4b2662ba
diff --git a/gruntfile.js b/gruntfile.js index <HASH>..<HASH> 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -329,7 +329,7 @@ module.exports = function(grunt) { buildOLDebug: '(node <%= olDir %>/tasks/build.js <%= olDir %>/config/ol-debug.json app/assets/libs/ol-debug.js)', buildOL: '(node <%= olDir %>/tasks/build.js <%= olDir %>/config/ol.json app/assets/libs/ol.js)', initOL: '(cd <%= olDir %> && make install)', - buildTypeScript: 'tsc' + buildTypeScript: '/node_modules/typescript/bin/tsc' }, /* @@ -524,7 +524,7 @@ module.exports = function(grunt) { 'clean:build', 'clean:tmp', 'less', - // 'typescript', + 'exec:buildTypeScript', 'includeSource', 'configureProxies:server', 'connect',
Build typescript on grunt execution
TissueMAPS_TmClient
train
js
5b33df05f163f7f117312f3aad46411bdb0b4e76
diff --git a/bundles/org.eclipse.orion.client.ui/web/plugins/languages/json/parser.js b/bundles/org.eclipse.orion.client.ui/web/plugins/languages/json/parser.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.ui/web/plugins/languages/json/parser.js +++ b/bundles/org.eclipse.orion.client.ui/web/plugins/languages/json/parser.js @@ -665,8 +665,8 @@ } } }, - onError: function (error) { - errors.push({ error: error }); + onError: function (error, offset, lngth) { + errors.push({ error: error, offset: offset, length: lngth }); } }; visit(text, visitor, options);
Bug <I> - [json] The JSON parser should return location information when an error is encountered
eclipse_orion.client
train
js
d638fe963a2372cfc4b9abcf2b72619a91079248
diff --git a/netsnmptestenv.py b/netsnmptestenv.py index <HASH>..<HASH> 100644 --- a/netsnmptestenv.py +++ b/netsnmptestenv.py @@ -59,19 +59,23 @@ class netsnmpTestEnv(object): def shutdown(self): def kill_process(pid): - # First we ask it nicely to quit. If after a second it hasn't, we - # will kill it the hard way. - try: - starttime = time.clock() - os.kill(pid, signal.SIGTERM) - while time.clock() == starttime: - os.kill(pid, 0) - os.kill(pid, signal.SIGKILL) - starttime = time.clock() - while True: - os.kill(pid, 0) - except OSError as e: - pass + def is_running(pid): + return os.path.exists("/proc/{0}".format(pid)) + + if not is_running(pid): + return + + starttime = time.clock() + os.kill(pid, signal.SIGTERM) + while time.clock() == starttime: + time.sleep(0.25) + + if not is_running(pid): + return + + os.kill(pid, signal.SIGTERM) + while is_running(pid): + time.sleep(0.25) # Check for existance of snmpd's PID file if os.access(self.pidfile, os.R_OK):
Use slightly more intelligent process killing in netsnmptestenv module Instead of hammering the process to be killed with signals continously, sleep small amounts of time and check procfs. This is obviously Linux-specific, but so far I have not heard of anyone trying to use python-netsnmpagent with net-snmp on different platforms.
pief_python-netsnmpagent
train
py
8e38b254ed785edc030fc1b1d2c523cd4a84968a
diff --git a/km3pipe/db.py b/km3pipe/db.py index <HASH>..<HASH> 100644 --- a/km3pipe/db.py +++ b/km3pipe/db.py @@ -145,6 +145,17 @@ class DBManager(object): else: return dataframe + def t0sets(self, det_id): + content = self._get_content('streamds/t0sets.txt?detid={0}' + .format(det_id)) + try: + dataframe = pd.read_csv(StringIO(content), sep="\t") + except ValueError: + log.warning("Empty dataset") + return pd.DataFrame() + else: + return dataframe + @property def parameters(self): "Return the parameters container for quick access to their details"
Implements t0sets retrieval
tamasgal_km3pipe
train
py
2ef63fc715446e2d16b681f37b106ff2891b8038
diff --git a/vel/rl/env/wrappers/clip_episode_length.py b/vel/rl/env/wrappers/clip_episode_length.py index <HASH>..<HASH> 100644 --- a/vel/rl/env/wrappers/clip_episode_length.py +++ b/vel/rl/env/wrappers/clip_episode_length.py @@ -19,6 +19,7 @@ class ClipEpisodeEnv(gym.Wrapper): if self.current_episode_length > self.max_episode_length: done = True + info['clipped_length'] = True return ob, reward, done, info
Additional information from the clipped env length wrapper.
MillionIntegrals_vel
train
py
c15a1e2f1037f9ec4202d0dc0eba0bc60654c10e
diff --git a/src/frontend/org/voltdb/iv2/DuplicateCounter.java b/src/frontend/org/voltdb/iv2/DuplicateCounter.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/iv2/DuplicateCounter.java +++ b/src/frontend/org/voltdb/iv2/DuplicateCounter.java @@ -116,12 +116,9 @@ public class DuplicateCounter ClientResponseImpl r = message.getClientResponseData(); // get the hash of sql run long hash = 0; - // A mispartitioned transaction has no response in the message - if (r != null) { - Integer sqlHash = r.getHash(); - if (sqlHash != null) { - hash = sqlHash.intValue(); - } + Integer sqlHash = r.getHash(); + if (sqlHash != null) { + hash = sqlHash.intValue(); } return checkCommon(hash, message.isRecovering(), message); }
Remove redundant DuplicateCounter code that expects some old behavior.
VoltDB_voltdb
train
java
a6024ed4780a913df8fc3f8af555c27b7abcc748
diff --git a/nodeshot/scripts/snmp.py b/nodeshot/scripts/snmp.py index <HASH>..<HASH> 100755 --- a/nodeshot/scripts/snmp.py +++ b/nodeshot/scripts/snmp.py @@ -75,7 +75,6 @@ def get_signal(ip): oid_dbm = 1,3,6,1,4,1,14988,1,1,1,2,1,3 #get connected mac and their dbm res = cmdgen.CommandGenerator().nextCmd(community, transport, oid_dbm) - print res ret = [] try: for i in res[3]:
minimal cleanup in snmp.py
ninuxorg_nodeshot
train
py
0a8fe2c9acf2047be4ee2870d9a66b6e8e1a41e1
diff --git a/global-fs/src/main/java/io/global/fs/http/GlobalFsDriverServlet.java b/global-fs/src/main/java/io/global/fs/http/GlobalFsDriverServlet.java index <HASH>..<HASH> 100644 --- a/global-fs/src/main/java/io/global/fs/http/GlobalFsDriverServlet.java +++ b/global-fs/src/main/java/io/global/fs/http/GlobalFsDriverServlet.java @@ -58,7 +58,7 @@ public final class GlobalFsDriverServlet { try { PubKey space = PubKey.fromString(request.getPathParameter("space")); SimKey simKey = getSimKey(request); - String name = request.getRelativePath(); + String name = UrlParser.urlDecode(request.getRelativePath()); return driver.getMetadata(space, name) .then(meta -> { if (meta != null) {
Fix global-fs not urldecoding download file names
softindex_datakernel
train
java
00ba520179e7efd0158229e9b678eb8a1e67c796
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/search/InlineSearchPane.js b/bundles/org.eclipse.orion.client.ui/web/orion/search/InlineSearchPane.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/search/InlineSearchPane.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/search/InlineSearchPane.js @@ -743,6 +743,12 @@ define([ scopeString = this._fileClient.fileServiceName(scopeString); } else { scopeString = scopeString.replace(rootName, ""); + if(scopeString === "/workspace/orionode"){ + scopeString = messages["Scope All"]; + }else{ + // Remove the workspace name portion from the scopeString, which will remove 'orionode' from '/orionode/Foldername' + scopeString = "/" + scopeString.split("/").slice(2).join("/"); + } } var locationElementWrapper = document.createElement("div"); locationElementWrapper.classList.add("locationElementWrapper");
Bug <I> - Search's "Find in" field should not show the workspace name
eclipse_orion.client
train
js
5a39def902ddd24db19a9bc0bc8d468af6211e2d
diff --git a/mod/forum/discuss.php b/mod/forum/discuss.php index <HASH>..<HASH> 100644 --- a/mod/forum/discuss.php +++ b/mod/forum/discuss.php @@ -64,6 +64,16 @@ add_to_log($course->id, "forum", "move discussion", "discuss.php?d=$discussion->id", "$discussion->id"); } $discussionmoved = true; + require_once('rsslib.php'); + require_once($CFG->libdir.'/rsslib.php'); + + // Delete the RSS files for the 2 forums because we want to force + // the regeneration of the feeds since the discussions have been + // moved. + if (!forum_rss_delete_file($forum) || !forum_rss_delete_file($fromforum)) { + notify('Could not purge the cached RSS feeds for the source and/or'. + 'destination forum(s) - check your file permissionsforums'); + } } else { error("You can't move to that forum - it doesn't exist!"); }
re-merge of "Merged fix from <I> for Bug #<I> - RSS Feeds and Moving Discussions." Originally by vyshane - got dropped accidentally in one of the biiiiig roles commits.
moodle_moodle
train
php
cac5e713e899cd16e5e775787acb34289ccf5057
diff --git a/hvac/adapters.py b/hvac/adapters.py index <HASH>..<HASH> 100644 --- a/hvac/adapters.py +++ b/hvac/adapters.py @@ -288,7 +288,7 @@ class RawAdapter(Adapter): _kwargs.update(kwargs) if self.strict_http and method.lower() in ('list',): - # Encty point for standard HTTP substitution + # Entry point for standard HTTP substitution params = _kwargs.get('params', {}) if method.lower() == 'list': method = 'get'
Encty -> Entry typo fix
hvac_hvac
train
py
ad63a2841961ff45a23aa4602a2c74a0912332b8
diff --git a/lib/objectcache.rb b/lib/objectcache.rb index <HASH>..<HASH> 100644 --- a/lib/objectcache.rb +++ b/lib/objectcache.rb @@ -39,6 +39,10 @@ module Ronin @store = Og.setup(:destroy => false, :evolve_schema => :full, :store => :sqlite, :name => @path) end + def sql(*sql) + @store.get_store.exec_statement(sql.join('; ')) + end + protected def method_missing(sym,*args)
* Just in case anyone ever needs to, they can execute pure SQL.
ronin-ruby_ronin
train
rb
3d598143f5314efd40142393b600023248c677d7
diff --git a/src/main/java/org/fest/assertions/api/AbstractAssert.java b/src/main/java/org/fest/assertions/api/AbstractAssert.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/fest/assertions/api/AbstractAssert.java +++ b/src/main/java/org/fest/assertions/api/AbstractAssert.java @@ -36,6 +36,7 @@ public abstract class AbstractAssert<S, A> implements Assert<S, A> { @VisibleForTesting Conditions conditions = Conditions.instance(); @VisibleForTesting final WritableAssertionInfo info; + // visibility is protected to allow use write custom assertions that need to access actual @VisibleForTesting protected final A actual; protected final S myself;
Add comment to explain wht actual visbility has been set to protected (to allow custom assertion to access actual)
alexruiz_fest-assert-2.x
train
java
ed08330d97fbecf45265b7d9292217274d92fee4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ setup( author='Nicholas H.Tollervey', author_email='ntoll@ntoll.org', url='https://github.com/ntoll/uflash', - py_modules=['uflash', 'hexify'], + py_modules=['uflash', 'py2hex'], license='MIT', classifiers=[ 'Development Status :: 4 - Beta', @@ -36,6 +36,6 @@ setup( 'Topic :: Software Development :: Embedded Systems', ], entry_points={ - 'console_scripts': ['uflash=uflash:main', 'hexify=hexify:main'], + 'console_scripts': ['uflash=uflash:main', 'py2hex=uflash:py2hex'], } )
Updates to reflect hexify -> py2hex changes Changed command name from hexify to py2hex Changed entry point for py2hex
ntoll_uflash
train
py
78f85c6a72eef58dfd3bc8c980829749c46c8312
diff --git a/Str.php b/Str.php index <HASH>..<HASH> 100644 --- a/Str.php +++ b/Str.php @@ -185,14 +185,21 @@ class Str } /** - * Trims the given string and replaces multiple consecutive whitespaces with a single space. + * Trims the given string and replaces multiple consecutive whitespaces with a single whitespace. * - * @param string $str The string to clean. - * @return string The resulting string. + * Note: This includes multi-byte whitespace characters, tabs and newlines, which effectively means + * that the string may also be collapsed down. This is mostly a utility for processing natural language + * user input for displaying. + * + * @param string $str The string to collapse. + * @param string|null $encoding The encoding to use. + * @return string The resulting string. */ - public static function clean(string $str) : string + public static function collapse(string $str, string $encoding = null) : string { - return preg_replace('/\s+/u', ' ', trim($str)); + $encoding = $encoding ?: static::encoding($str); + + return static::trim(static::replace($str, '[[:space:]]+', ' ', 'msr', $encoding), null, $encoding); } /**
[Utils/Str] Renamed Str::clean() -> Str::collapse() to narrow down its intent. Redirects to Str::trim() and Str::replace(), ie. uses mb_ereg_replace() now internally and properly handles encoding the way the rest of the Str utility does.
unyx_utils
train
php
7fb1628c10f5349d0d57bdefe2210186a5a28280
diff --git a/testsrc/org/mozilla/javascript/tests/Test262SuiteTest.java b/testsrc/org/mozilla/javascript/tests/Test262SuiteTest.java index <HASH>..<HASH> 100644 --- a/testsrc/org/mozilla/javascript/tests/Test262SuiteTest.java +++ b/testsrc/org/mozilla/javascript/tests/Test262SuiteTest.java @@ -195,13 +195,15 @@ public class Test262SuiteTest { } String str = testCase.source; + int line = 1; if (useStrict) { str = "\"use strict\";\n" + str; + line--; } boolean failedEarly = true; try { - Script caseScript = cx.compileString(str, testFilePath, 0, null); + Script caseScript = cx.compileString(str, testFilePath, line, null); failedEarly = false; // not after this line caseScript.exec(cx, scope);
Print original line number of file in test<I>.
mozilla_rhino
train
java
6a31f51ae9d9d09349b680065442619c74ac5024
diff --git a/lib/generators/wanko/templates/lib/%name%/engine.rb b/lib/generators/wanko/templates/lib/%name%/engine.rb index <HASH>..<HASH> 100644 --- a/lib/generators/wanko/templates/lib/%name%/engine.rb +++ b/lib/generators/wanko/templates/lib/%name%/engine.rb @@ -4,6 +4,6 @@ module <%= camelized %> class Engine < ::Rails::Engine include Wanko::Engine - active_if { false } + active_if { true } end end
Let newly created extensions be enabled by default
amatsuda_motorhead
train
rb
113277ede126e52717c1ee54014ed8f91fce5d02
diff --git a/src/pandas_profiling/utils/progress_bar.py b/src/pandas_profiling/utils/progress_bar.py index <HASH>..<HASH> 100644 --- a/src/pandas_profiling/utils/progress_bar.py +++ b/src/pandas_profiling/utils/progress_bar.py @@ -1,6 +1,5 @@ -from collections import Callable from functools import wraps -from typing import Any +from typing import Any, Callable from tqdm import tqdm
refactor: typing progress_bar.py
pandas-profiling_pandas-profiling
train
py
87e2bb881387ff3ac245ab9923347a5a616e197b
diff --git a/semantic_release/cli.py b/semantic_release/cli.py index <HASH>..<HASH> 100644 --- a/semantic_release/cli.py +++ b/semantic_release/cli.py @@ -161,7 +161,8 @@ def changelog(*, unreleased=False, noop=False, post=False, **kwargs): log = generate_changelog(current_version, None) else: log = generate_changelog(previous_version, current_version) - logger.info(markdown_changelog(current_version, log, header=False)) + # print is used to keep the changelog on stdout, separate from log messages + print(markdown_changelog(current_version, log, header=False)) # Post changelog to HVCS if enabled if not noop and post:
fix(changelog): send changelog to stdout Fixes #<I>
relekang_python-semantic-release
train
py
1ed88eed1d179e5a27171324e57692366449eca0
diff --git a/Facades/Notification.php b/Facades/Notification.php index <HASH>..<HASH> 100644 --- a/Facades/Notification.php +++ b/Facades/Notification.php @@ -13,7 +13,9 @@ use Illuminate\Support\Testing\Fakes\NotificationFake; * @method static mixed channel(string|null $name = null) * @method static void assertNotSentTo(mixed $notifiable, string|\Closure $notification, callable $callback = null) * @method static void assertNothingSent() + * @method static void assertSentOnDemand(string|\Closure $notification, callable $callback = null) * @method static void assertSentTo(mixed $notifiable, string|\Closure $notification, callable $callback = null) + * @method static void assertSentOnDemandTimes(string $notification, int $times = 1) * @method static void assertSentToTimes(mixed $notifiable, string $notification, int $times = 1) * @method static void assertTimesSent(int $expectedCount, string $notification) * @method static void send(\Illuminate\Support\Collection|array|mixed $notifiables, $notification)
Add missing methods to Notification facade (#<I>)
illuminate_support
train
php
e35226a7538f12c613abecb5533a480a53bc28f1
diff --git a/lib/Models/registerCatalogMembers.js b/lib/Models/registerCatalogMembers.js index <HASH>..<HASH> 100644 --- a/lib/Models/registerCatalogMembers.js +++ b/lib/Models/registerCatalogMembers.js @@ -21,7 +21,6 @@ var createCatalogMemberFromType = require('./createCatalogMemberFromType'); var CsvCatalogItem = require('./CsvCatalogItem'); var CswCatalogGroup = require('./CswCatalogGroup'); var CzmlCatalogItem = require('./CzmlCatalogItem'); -var deprecationWarning = require('terriajs-cesium/Source/Core/deprecationWarning'); var GeoJsonCatalogItem = require('./GeoJsonCatalogItem'); var GpxCatalogItem = require('./GpxCatalogItem'); var KmlCatalogItem = require('./KmlCatalogItem');
Fix eslint warning.
TerriaJS_terriajs
train
js
305276c0d3de7e0ad1e3f27caf3538e8b9242db1
diff --git a/src/Escaper.php b/src/Escaper.php index <HASH>..<HASH> 100644 --- a/src/Escaper.php +++ b/src/Escaper.php @@ -43,7 +43,7 @@ class Escaper */ public function escapeCharacterClass(string $char): string { - return (isset($this->inCharacterClass[$char])) ? $this->inCharacterClass[$char] : $char; + return $this->inCharacterClass[$char] ?? $char; } /** @@ -54,6 +54,6 @@ class Escaper */ public function escapeLiteral(string $char): string { - return (isset($this->inLiteral[$char])) ? $this->inLiteral[$char] : $char; + return $this->inLiteral[$char] ?? $char; } } \ No newline at end of file diff --git a/src/Output/PrintableAscii.php b/src/Output/PrintableAscii.php index <HASH>..<HASH> 100644 --- a/src/Output/PrintableAscii.php +++ b/src/Output/PrintableAscii.php @@ -43,7 +43,7 @@ abstract class PrintableAscii extends BaseImplementation { $table = [9 => '\\t', 10 => '\\n', 13 => '\\r']; - return (isset($table[$cp])) ? $table[$cp] : $this->escapeAscii($cp); + return $table[$cp] ?? $this->escapeAscii($cp); } /**
Replaced ternaries with null coalescing operator
s9e_RegexpBuilder
train
php,php
fb8bfed69e776d050ef2f6029d376b1196add4e9
diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index <HASH>..<HASH> 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -172,9 +172,8 @@ OpenLayers.Map.prototype = { // Workaround for the fact that hidden elements return 0 for size. if (size.w == 0 && size.h == 0) { - var elementSize = Element.getDimensions(this.div); - size.w = elementSize.width; - size.h = elementSize.height; + size.w = parseInt(this.div.style.width); + size.h = parseInt(this.div.style.height); } return size; },
element.getDimensions doesn't check styles of parent elements, so when an element is hideen because of a parent, this breaks. fall back to style.width/height in cases where we have a 0,0 size. git-svn-id: <URL>
openlayers_openlayers
train
js
6062fb5dc49d12e1e89873290b4a8d7f3411b4ab
diff --git a/lib/copy-file.js b/lib/copy-file.js index <HASH>..<HASH> 100644 --- a/lib/copy-file.js +++ b/lib/copy-file.js @@ -1,7 +1,7 @@ 'use strict'; const fs = require('fs'); -const {lstat, unlink} = fs.promises; +const {lstat, unlink} = require('fs/promises'); const pipe = require('pipe-io'); const tryToCatch = require('try-to-catch'); const copySymlink = require('copy-symlink');
chore(copy-file) fs.promises -> fs/promises
cloudcmd_copy-file
train
js
836bbcab7357b9753871e477282fde34ba0ffd5f
diff --git a/lib/fog/atmos/storage.rb b/lib/fog/atmos/storage.rb index <HASH>..<HASH> 100644 --- a/lib/fog/atmos/storage.rb +++ b/lib/fog/atmos/storage.rb @@ -155,8 +155,10 @@ module Fog signature = Base64.encode64( digest ).chomp() params[:headers]["x-emc-signature"] = signature - parse = params[:parse] - + params.delete(:host) #invalid excon request parameter + + parse = params.delete(:parse) + begin response = @connection.request(params, &block) rescue Excon::Errors::HTTPStatusError => error
Delete invalid connection keys before request is made
fog_fog
train
rb
74f2828105fc1711cb28b7b718e53c06a303a328
diff --git a/OpenPNM/Algorithms/__LinearSolver__.py b/OpenPNM/Algorithms/__LinearSolver__.py index <HASH>..<HASH> 100644 --- a/OpenPNM/Algorithms/__LinearSolver__.py +++ b/OpenPNM/Algorithms/__LinearSolver__.py @@ -324,7 +324,8 @@ class LinearSolver(GenericAlgorithm): self._logger.warning('The outlet pores have too many neighbors. Internal pores appear to be selected.') #Fetch area and length of domain - A = self._net.domain_area(face=inlets) + #A = self._net.domain_area(face=inlets) + A = (40.5e-6*10)**2 L = self._net.domain_length(face_1=inlets,face_2=outlets) x = self._result #Find flow through inlet face
temporary patch job (domain_size doesn't work) Former-commit-id: <I>bf<I>a<I>a<I>f<I>b<I>d<I>d<I>baf3 Former-commit-id: <I>c8e<I>f<I>e<I>c<I>c2ea7dc<I>c3bba<I>bc8
PMEAL_OpenPNM
train
py
d3d9e0f5c0da8408bcdb241509cb7dd1f41fd4bd
diff --git a/src/you_get/extractors/imgur.py b/src/you_get/extractors/imgur.py index <HASH>..<HASH> 100644 --- a/src/you_get/extractors/imgur.py +++ b/src/you_get/extractors/imgur.py @@ -65,7 +65,7 @@ class Imgur(VideoExtractor): 'container': 'jpg' } } - self.title = image['title'] + self.title = image['title'] or image['hash'] def extract(self, **kwargs): if 'stream_id' in kwargs and kwargs['stream_id']:
[imgur] use hash when title not present
soimort_you-get
train
py
6d3ae3b83cc0ad7f2551ad4d35819cb56129cb30
diff --git a/lib/Cake/Test/Case/Event/CakeEventManagerTest.php b/lib/Cake/Test/Case/Event/CakeEventManagerTest.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Test/Case/Event/CakeEventManagerTest.php +++ b/lib/Cake/Test/Case/Event/CakeEventManagerTest.php @@ -235,7 +235,7 @@ class CakeEventManagerTest extends CakeTestCase { */ public function testDispatchReturnValue() { $this->skipIf( - version_compare(PHPUnit_Runner_Version::VERSION, '3.7', '<'), + version_compare(PHPUnit_Runner_Version::id(), '3.7', '<'), 'These tests fail in PHPUnit 3.6' ); $manager = new CakeEventManager;
Fix missed use of VERSION.
cakephp_cakephp
train
php
ae5f5e7882db1f7696f6ef2442b1c2f375fd9e72
diff --git a/openquake/calculators/base.py b/openquake/calculators/base.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/base.py +++ b/openquake/calculators/base.py @@ -194,7 +194,7 @@ class BaseCalculator(with_metaclass(abc.ABCMeta)): elif exports: # is a string fmts = exports.split(',') else: # use passed values - fmts = self.oqparam.exports + fmts = self.oqparam.exports.split(',') for fmt in fmts: if not fmt: continue
Fixed a small bug with exports Former-commit-id: <I>adeff7e<I>f3c<I>f1a<I>f4fe3a<I>d4edd<I>
gem_oq-engine
train
py
8f284278b5661230822ad5e7ff4829b18e4960f1
diff --git a/loader.js b/loader.js index <HASH>..<HASH> 100644 --- a/loader.js +++ b/loader.js @@ -17,7 +17,12 @@ module.exports.pitch = function(request, preReq, data) { var query = loaderUtils.parseQuery(this.query); this.addDependency(this.resourcePath); // We already in child compiler, return empty bundle - if(this[__dirname] === false) { + if(this[__dirname] === undefined) { + throw new Error( + '"extract-text-webpack-plugin" loader is used without the corresponding plugin, ' + + 'refer to https://github.com/webpack/extract-text-webpack-plugin for the usage example' + ); + } else if(this[__dirname] === false) { return ""; } else if(this[__dirname](null, query)) { if(query.omit) {
Check if loader is used without plugin
webpack-contrib_extract-text-webpack-plugin
train
js
06f1aa9181b453ec7a6d49cb89177763c21ced2b
diff --git a/lib/userlist/push/strategies.rb b/lib/userlist/push/strategies.rb index <HASH>..<HASH> 100644 --- a/lib/userlist/push/strategies.rb +++ b/lib/userlist/push/strategies.rb @@ -11,9 +11,20 @@ module Userlist def self.lookup_strategy(strategy) return strategy unless strategy.is_a?(Symbol) || strategy.is_a?(String) - name = strategy.to_s.capitalize - require("userlist/push/strategies/#{strategy}") unless const_defined?(name, false) - const_get(name, false) + require_strategy(strategy) + const_get(strategy.to_s.capitalize, false) + end + + def self.strategy_defined?(strategy) + return true unless strategy.is_a?(Symbol) || strategy.is_a?(String) + + const_defined?(strategy.to_s.capitalize, false) + end + + def self.require_strategy(strategy) + return unless strategy.is_a?(Symbol) || strategy.is_a?(String) + + require("userlist/push/strategies/#{strategy}") unless strategy_defined?(strategy) end end end
Extracts methods to check and require strategies
userlistio_userlist-ruby
train
rb
40e362ba0bd2fab404ee2f79efd968c8a76626cf
diff --git a/spyder/plugins/profiler/plugin.py b/spyder/plugins/profiler/plugin.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/profiler/plugin.py +++ b/spyder/plugins/profiler/plugin.py @@ -42,7 +42,7 @@ class Profiler(SpyderDockablePlugin): NAME = 'profiler' REQUIRES = [Plugins.Preferences, Plugins.Editor] OPTIONAL = [Plugins.MainMenu] - TABIFY = Plugins.Help + TABIFY = [Plugins.Help] WIDGET_CLASS = ProfilerWidget CONF_SECTION = NAME CONF_WIDGET_CLASS = ProfilerConfigPage diff --git a/spyder/plugins/pylint/plugin.py b/spyder/plugins/pylint/plugin.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/pylint/plugin.py +++ b/spyder/plugins/pylint/plugin.py @@ -39,6 +39,7 @@ class Pylint(SpyderDockablePlugin): CONF_WIDGET_CLASS = PylintConfigPage REQUIRES = [Plugins.Preferences, Plugins.Editor] OPTIONAL = [Plugins.MainMenu, Plugins.Projects] + TABIFY = [Plugins.Help] CONF_FILE = False DISABLE_ACTIONS_WHEN_HIDDEN = False
Pylint/Profiler: Add/fix their TABIFY class attribute respectively
spyder-ide_spyder
train
py,py
dff50131a78f0ab363d098b28aff1ce4d9867794
diff --git a/test/integration/tst_regression.py b/test/integration/tst_regression.py index <HASH>..<HASH> 100644 --- a/test/integration/tst_regression.py +++ b/test/integration/tst_regression.py @@ -2,8 +2,7 @@ import shutil import os import autofit as af -from autolens.data.instrument import ccd -from autolens.data import ccd as ccd +from autolens.data.instrument import ccd as ccd from autolens.data.array import grids from autolens.data.array.util import array_util from autolens.lens import ray_tracing diff --git a/test/simulation/makers.py b/test/simulation/makers.py index <HASH>..<HASH> 100644 --- a/test/simulation/makers.py +++ b/test/simulation/makers.py @@ -1,6 +1,5 @@ import autofit as af from autolens.data.instrument import ccd -from autolens.data import ccd from autolens.data.array import grids from autolens.lens import ray_tracing from autolens.model.galaxy import galaxy as g
Refactored data to use instrument module with abstract_data, ready to add interferometry data class.
Jammy2211_PyAutoLens
train
py,py
2effe1cb45311d12d42bb422eea7aca60e41d97e
diff --git a/routes/web.php b/routes/web.php index <HASH>..<HASH> 100644 --- a/routes/web.php +++ b/routes/web.php @@ -62,7 +62,7 @@ Route::middleware(['web', 'admin.auth:admin', 'permission']) Route::post('attribute/upload', [\AvoRed\Framework\Catalog\Controllers\AttributeController::class, 'upload']) ->name('attribute.upload'); - Route::post('admin-user-image', [\AvoRed\Framework\System\Controllers\AdminUserController::class, 'upload']) + Route::post('admin-user-image', [\AvoRed\Framework\User\Controllers\AdminUserController::class, 'upload']) ->name('admin-user-image-upload'); Route::post(
fixed Issue #<I> AdminUserController doesn't exist
avored_framework
train
php
a7a3438b41e1c8637bf89d7e916dfda02daf27e8
diff --git a/java-wrapper/src/test/java/com/codedisaster/steamworks/test/SteamTestApp.java b/java-wrapper/src/test/java/com/codedisaster/steamworks/test/SteamTestApp.java index <HASH>..<HASH> 100644 --- a/java-wrapper/src/test/java/com/codedisaster/steamworks/test/SteamTestApp.java +++ b/java-wrapper/src/test/java/com/codedisaster/steamworks/test/SteamTestApp.java @@ -55,7 +55,7 @@ public abstract class SteamTestApp { System.out.println("Initialise Steam client API ..."); - if (!SteamAPI.init()) { + if (!SteamAPI.init("../natives/libs")) { return false; }
Test applications load libraries from ./natives/libs instead of Maven package.
code-disaster_steamworks4j
train
java
012daf558194a8287be1b567d30549c0596fb555
diff --git a/lib/escobar/heroku/pipeline.rb b/lib/escobar/heroku/pipeline.rb index <HASH>..<HASH> 100644 --- a/lib/escobar/heroku/pipeline.rb +++ b/lib/escobar/heroku/pipeline.rb @@ -65,10 +65,14 @@ module Escobar end def default_branch - github_client.default_branch + @default_branch ||= github_client.default_branch end def required_commit_contexts(forced = false) + @required_commit_contexts ||= fetch_required_commit_contexts(forced) + end + + def fetch_required_commit_contexts(forced = false) return [] if forced github_client.required_contexts.map do |context| if context == "continuous-integration/travis-ci"
Cache calls to GitHub in Pipeline
atmos_escobar
train
rb
38650495afd4001eb4ac5cf1b84acfec9db06fed
diff --git a/spec/controllers/spree/adyen_redirect_controller_spec.rb b/spec/controllers/spree/adyen_redirect_controller_spec.rb index <HASH>..<HASH> 100644 --- a/spec/controllers/spree/adyen_redirect_controller_spec.rb +++ b/spec/controllers/spree/adyen_redirect_controller_spec.rb @@ -32,16 +32,18 @@ module Spree and_return payment_method end - it "creates a payment for the order" do + it "creates a payment for the current order" do expect{ subject }.to change { order.payments.count }.from(0).to(1) end - it "sets the payment attributes with the response" do - subject - expect(order.payments.last).to have_attributes( - amount: order.total, - payment_method: payment_method, - response_code: psp_reference) + describe "created payment" do + it "has attributes from the request" do + subject + expect(order.payments.last).to have_attributes( + amount: order.total, + payment_method: payment_method, + response_code: psp_reference) + end end it "redirects to order complete page" do
Restruct portion of test Just put extra describe blocks to specify what the test is talking about i.e. the created payment.
StemboltHQ_solidus-adyen
train
rb
a8569ac2da57d75d613b6e020e5c9b37ac130249
diff --git a/demo/start.rb b/demo/start.rb index <HASH>..<HASH> 100644 --- a/demo/start.rb +++ b/demo/start.rb @@ -46,18 +46,15 @@ class App dt = Rufus::Decision::Table.new(json.last) - #out = dt.transform!(in_to_h(json.first)) - keys = json.first.first - rows = json.first[1..-1] - results = rows.collect do |row| - h = keys.inject({}) { |h, k| h[k] = row.shift; h } - h = dt.transform(h) - keys = (keys + h.keys).sort.uniq - keys.inject([]) { |a, k| a << h[k] } - end - results.unshift(keys) - - [ 200, {}, results.to_json ] + input = Rufus::Decision.transpose(json.first) + # from array of arrays to array of hashes + + output = input.inject([]) { |a, hash| a << dt.transform(hash); a } + + output = Rufus::Decision.transpose(output) + # from array of hashes to array of arrays + + [ 200, {}, output.to_json ] end end
leveraging Rufus::Decision.transpose()
jmettraux_rufus-decision
train
rb
b52c6f673e1fa0a14ebc758f53d26ec1e4dda72d
diff --git a/pkg/cloudprovider/gce/token_source.go b/pkg/cloudprovider/gce/token_source.go index <HASH>..<HASH> 100644 --- a/pkg/cloudprovider/gce/token_source.go +++ b/pkg/cloudprovider/gce/token_source.go @@ -31,7 +31,7 @@ import ( const ( // Max QPS to allow through to the token URL. - tokenURLQPS = 1 + tokenURLQPS = .05 // back off to once every 20 seconds when failing // Maximum burst of requests to token URL before limiting. tokenURLBurst = 3 )
Increase the rate limiting of GCE's token source. The burst being at 3 means transient errors won't incur such long waits, but repeating failures shouldn't be retrying every second.
kubernetes_kubernetes
train
go
97a7dbd34b0edcf751a94d3fd4f0dde11d829654
diff --git a/spec/models/profile.rb b/spec/models/profile.rb index <HASH>..<HASH> 100644 --- a/spec/models/profile.rb +++ b/spec/models/profile.rb @@ -1,5 +1,5 @@ class Profile include Mongoid::Document - field :name, type: String + field :name, :type => String shard_key :name end
Let tests pass for <I> and others.
mongodb_mongoid
train
rb
f0cff41b76d4bc4321824bb401d05956f7f2a413
diff --git a/lib/Condorcet/Condorcet.php b/lib/Condorcet/Condorcet.php index <HASH>..<HASH> 100644 --- a/lib/Condorcet/Condorcet.php +++ b/lib/Condorcet/Condorcet.php @@ -1650,9 +1650,12 @@ class Vote use CandidateVote_CondorcetLink ; private $_ranking = array(); + private $_rankingHistory = array(); + private $_tags = array(); private $_id; private $_createdAt; + private $updatedAt; /// @@ -1682,8 +1685,16 @@ class Vote // SETTERS - public function setRanking ($ranking) + public function setRanking ($rankingCandidate) { + if (empty($this->_link)) + { + $this->archiveRanking(); + } + else + { + + } } @@ -1696,6 +1707,14 @@ class Vote /// // INTERNAL + + private function archiveRanking () + { + if (!empty($this->_ranking)) + { + $this->_rankingHistory[] = array('ranking' => $this->_ranking, 'timestamp' => microtime(true)); + } + } } @@ -1737,5 +1756,4 @@ trait CandidateVote_CondorcetLink else { return false ; } } - } \ No newline at end of file
Class Vote => setRanking() && archiveRanking()
julien-boudry_Condorcet
train
php
fe3a1b19d9700183a684ff078dcd4d9f3459f553
diff --git a/src/js/components/Clock/Clock.js b/src/js/components/Clock/Clock.js index <HASH>..<HASH> 100644 --- a/src/js/components/Clock/Clock.js +++ b/src/js/components/Clock/Clock.js @@ -157,14 +157,11 @@ class Clock extends Component { this.setState({ elements: nextElements }, () => { if (onChange) { + const { elements: e2 } = this.state; if (elements.duration) { - onChange( - `P${elements.hours}H${elements.minutes}M${elements.seconds}S`, - ); + onChange(`P${e2.hours}H${e2.minutes}M${e2.seconds}S`); } else { - onChange( - `T${elements.hours}:${elements.minutes}:${elements.seconds}`, - ); + onChange(`T${e2.hours}:${e2.minutes}:${e2.seconds}`); } } });
Fix Clock.onChange bug (#<I>)
grommet_grommet
train
js
2169b3aafa34e5507e138bda63f58dbbdc3b9760
diff --git a/concrete/src/Entity/File/Version.php b/concrete/src/Entity/File/Version.php index <HASH>..<HASH> 100644 --- a/concrete/src/Entity/File/Version.php +++ b/concrete/src/Entity/File/Version.php @@ -1649,6 +1649,12 @@ class Version implements ObjectInterface if ($type->shouldExistFor($imageWidth, $imageHeight, $file)) { $path_resolver = $app->make(Resolver::class); $path = $path_resolver->getPath($this, $type); + if ($path) { + $url = $app->make('site')->getSite()->getSiteCanonicalURL(); + if ($url) { + $path = $url . $path; + } + } } } } else {
adding canonical url to thumbnail paths since the method implies we're getting a url back
concrete5_concrete5
train
php
867ce551e97a34c09aafe339e12eb87577b50af3
diff --git a/generators/docker-base.js b/generators/docker-base.js index <HASH>..<HASH> 100644 --- a/generators/docker-base.js +++ b/generators/docker-base.js @@ -68,10 +68,10 @@ function checkImages() { this.appsFolders.forEach((appsFolder, index) => { const appConfig = this.appConfigs[index]; if (appConfig.buildTool === 'maven') { - imagePath = this.destinationPath(`${this.directoryPath + appsFolder}/target/docker/${_.kebabCase(appConfig.baseName)}-*.war`); + imagePath = this.destinationPath(`${this.directoryPath + appsFolder}/target/docker`); runCommand = './mvnw package -Pprod dockerfile:build'; } else { - imagePath = this.destinationPath(`${this.directoryPath + appsFolder}/build/docker/${_.kebabCase(appConfig.baseName)}-*.war`); + imagePath = this.destinationPath(`${this.directoryPath + appsFolder}/build/docker`); runCommand = './gradlew -Pprod bootRepackage buildDocker'; } if (shelljs.ls(imagePath).length === 0) {
Modify the check to use the new Docker plugin Not a perfect check, but similar to the previous one - this is just to help people when we can
jhipster_generator-jhipster
train
js
f8775064d4ce9f1e642cfba487953a8b23d078fe
diff --git a/hazelcast/src/main/java/com/hazelcast/util/executor/DelegatingFuture.java b/hazelcast/src/main/java/com/hazelcast/util/executor/DelegatingFuture.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/util/executor/DelegatingFuture.java +++ b/hazelcast/src/main/java/com/hazelcast/util/executor/DelegatingFuture.java @@ -109,7 +109,7 @@ public class DelegatingFuture<V> implements Future<V> { } public final boolean isDone() { - return done; + return done ? done : future.isDone(); } protected void setError(Throwable error) {
DelegatingFuture isDone
hazelcast_hazelcast
train
java
c32a321224afdfb8059a9625d33ae98b421d0de3
diff --git a/lib/GetStream/Stream/Client.php b/lib/GetStream/Stream/Client.php index <HASH>..<HASH> 100644 --- a/lib/GetStream/Stream/Client.php +++ b/lib/GetStream/Stream/Client.php @@ -141,17 +141,20 @@ class Client */ public function getBaseUrl() { - $api_endpoint = static::API_ENDPOINT; - $localPort = getenv('STREAM_LOCAL_API_PORT'); - if ($localPort) { - $baseUrl = "http://localhost:$localPort/api"; - } else { - if ($this->location) { - $subdomain = "{$this->location}-api"; + $baseUrl = getenv('STREAM_BASE_URL'); + if (!$baseUrl) { + $api_endpoint = static::API_ENDPOINT; + $localPort = getenv('STREAM_LOCAL_API_PORT'); + if ($localPort) { + $baseUrl = "http://localhost:$localPort/api"; } else { - $subdomain = 'api'; + if ($this->location) { + $subdomain = "{$this->location}-api"; + } else { + $subdomain = 'api'; + } + $baseUrl = "{$this->protocol}://{$subdomain}." . $api_endpoint; } - $baseUrl = "{$this->protocol}://{$subdomain}." . $api_endpoint; } return $baseUrl; }
Added support for STREAM_BASE_URL environment variable
GetStream_stream-php
train
php
5e8f319fa7e4530ab27d3e63e076b2fc51fd345a
diff --git a/app/controllers/storytime/subscriptions_controller.rb b/app/controllers/storytime/subscriptions_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/storytime/subscriptions_controller.rb +++ b/app/controllers/storytime/subscriptions_controller.rb @@ -6,6 +6,7 @@ module Storytime def create @subscription = Storytime::Subscription.find_by(permitted_attributes) || Storytime::Subscription.new(permitted_attributes) + @subscription.site = Storytime::Site.first if @subscription.site.nil? # if we ever go multi-site, this would likely become current_site @subscription.subscribed = true if @subscription.subscribed == false if @subscription.save @@ -30,7 +31,7 @@ module Storytime private def permitted_attributes - params.require(:subscription).permit(:email, :t, :site_id) + params.require(:subscription).permit(:email, :t) end def set_subscription
Remove site_id from permitted_attributes
CultivateLabs_storytime
train
rb
d8f7f1a5f5d2c2aefdcc618f66f8ae0f214c65b7
diff --git a/elasticstack/utils.py b/elasticstack/utils.py index <HASH>..<HASH> 100644 --- a/elasticstack/utils.py +++ b/elasticstack/utils.py @@ -23,7 +23,6 @@ from haystack import connections from importlib import import_module -from django.apps import apps def prepare_object(obj, using='default'): @@ -45,13 +44,23 @@ def prepare_object(obj, using='default'): def get_model(app_label, model_name): """ Fetches a Django model using the app registry. - This doesn't require that an app with the given app label exists, - which makes it safe to call when the registry is being populated. - All other methods to access models might raise an exception about the - registry not being ready yet. + + This doesn't require that an app with the given app label exists, which + makes it safe to call when the registry is being populated. All other + methods to access models might raise an exception about the registry not + being ready yet. + Raises LookupError if model isn't found. """ try: + from django.apps import apps + from django.core.exceptions import AppRegistryNotReady + except ImportError: + # Older Django version! + from django.db import models + return models.get_model(app_label, model_name) + + try: return apps.get_model(app_label, model_name) except AppRegistryNotReady: if apps.apps_ready and not apps.models_ready:
Import old get_model for older Django Includes compulsive docstring formatting
bennylope_elasticstack
train
py
66a579a1cce28222dd0fa2e44edf3913af54bdff
diff --git a/model/QueueDispatcher.php b/model/QueueDispatcher.php index <HASH>..<HASH> 100644 --- a/model/QueueDispatcher.php +++ b/model/QueueDispatcher.php @@ -450,6 +450,8 @@ class QueueDispatcher extends ConfigurableService implements QueueDispatcherInte * * It will be deprecated once we have the general GUI for displaying different info of a task for the user. * + * @deprecated + * * @param \core_kernel_classes_Resource $resource * @return null|\core_kernel_classes_Resource */ @@ -464,6 +466,8 @@ class QueueDispatcher extends ConfigurableService implements QueueDispatcherInte /** * It will be deprecated once we have the general GUI for displaying different info of a task for the user. * + * @deprecated + * * @param \core_kernel_classes_Resource $resource * @return Report */ @@ -496,6 +500,8 @@ class QueueDispatcher extends ConfigurableService implements QueueDispatcherInte * * It will be deprecated once we have the general GUI for displaying different info of a task for the user. * + * @deprecated + * * @param TaskInterface $task * @param \core_kernel_classes_Resource|null $resource - placeholder resource to be linked with task. * @return \core_kernel_classes_Resource
TAO-<I> Put some dispatcher methods to deprecated
oat-sa_extension-tao-task-queue
train
php
9cc06fda0c641fefc4e7beabadcad76aec18c707
diff --git a/packages/vuetify/src/components/VSelect/VSelect.js b/packages/vuetify/src/components/VSelect/VSelect.js index <HASH>..<HASH> 100644 --- a/packages/vuetify/src/components/VSelect/VSelect.js +++ b/packages/vuetify/src/components/VSelect/VSelect.js @@ -448,10 +448,16 @@ export default { if (onlyBools) { replacement = Object.keys(replacement).join(', ') } else { - replacement = JSON.stringify(replacement, null, multiple ? 2 : 0).replace(/"([^(")"]+)":/g, '$1:').replace(/"/g, '\'') + replacement = JSON.stringify(replacement, null, multiple ? 2 : 0) + .replace(/"([^(")"]+)":/g, '$1:') + .replace(/"/g, '\'') } - consoleWarn(`${props} ${multiple ? 'are' : 'is'} deprecated, use ${separator}:menu-props="${replacement}"${separator} instead`, this) + consoleWarn( + `${props} ${multiple ? 'are' : 'is'} deprecated, use ` + + `${separator}${onlyBools ? '' : ':'}menu-props="${replacement}"${separator} instead`, + this + ) } }
fix(Select): remove colon from menu-props suggestion with booleans only
vuetifyjs_vuetify
train
js
8907f20c63b9f9af09697e49d4487f1910061ff1
diff --git a/lib/zmachine/connection.rb b/lib/zmachine/connection.rb index <HASH>..<HASH> 100644 --- a/lib/zmachine/connection.rb +++ b/lib/zmachine/connection.rb @@ -173,8 +173,14 @@ module ZMachine def readable! ZMachine.logger.debug("zmachine:connection:#{__method__}", connection: self) if ZMachine.debug mark_active! - data = @channel.read_inbound_data - receive_data(data) if data + loop do + data = @channel.read_inbound_data + if data + receive_data(data) + else + break + end + end nil end diff --git a/lib/zmachine/tcp_msg_channel.rb b/lib/zmachine/tcp_msg_channel.rb index <HASH>..<HASH> 100644 --- a/lib/zmachine/tcp_msg_channel.rb +++ b/lib/zmachine/tcp_msg_channel.rb @@ -80,14 +80,7 @@ module ZMachine end end - # clear buffer - if @buffer.remaining - bytes = java.util.Arrays.copyOfRange(@buffer.array, @buffer.position, @buffer.position+@buffer.remaining) - @buffer.clear - @buffer.put(bytes) - else - @buffer.clear - end + @buffer.compact data end
allow for more than one receive_data per read_inbound_data
liquidm_zmachine
train
rb,rb