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
|
---|---|---|---|---|---|
840ed33ee33914bbf739b0f2159ce7f5c5d9633a | diff --git a/manifest.php b/manifest.php
index <HASH>..<HASH> 100755
--- a/manifest.php
+++ b/manifest.php
@@ -32,7 +32,7 @@ return array(
'version' => '8.6.0',
'author' => 'Open Assessment Technologies SA',
'requires' => array(
- 'generis' => '>=6.14.0',
+ 'generis' => '>=12.5.0',
'tao' => '>=36.1.0',
'taoGroups' => '>=4.0.0',
'taoTests' => '>=12.1.0', | TTD-<I> Added\changed 'generis' version to '>=<I>' in `requires` secition | oat-sa_extension-tao-delivery-rdf | train | php |
18a041e75d24abea98e8f390d0e965659f221486 | diff --git a/scenarios/kubernetes_verify.py b/scenarios/kubernetes_verify.py
index <HASH>..<HASH> 100755
--- a/scenarios/kubernetes_verify.py
+++ b/scenarios/kubernetes_verify.py
@@ -131,8 +131,7 @@ def main(branch, script, force, on_prow):
'-e', 'KUBE_FORCE_VERIFY_CHECKS=%s' % force,
'-e', 'KUBE_VERIFY_GIT_BRANCH=%s' % branch,
'-e', 'REPO_DIR=%s' % k8s, # hack/lib/swagger.sh depends on this
- '-e', 'TMPDIR=/tmp', # https://golang.org/src/os/file_unix.go
- '--tmpfs', '/tmp:exec,mode=777',
+ '--tmpfs', '/tmp:exec,mode=1777',
'gcr.io/k8s-testimages/kubekins-test:%s' % tag,
'bash', '-c', 'cd kubernetes && %s' % script,
]) | don't set TMPDIR on prow verify scenario | kubernetes_test-infra | train | py |
3735ae8afefd31831fa5d8d8445412b0f55ac41a | diff --git a/packages/razzle/config/paths.js b/packages/razzle/config/paths.js
index <HASH>..<HASH> 100644
--- a/packages/razzle/config/paths.js
+++ b/packages/razzle/config/paths.js
@@ -36,7 +36,7 @@ module.exports = {
appPublic: resolveApp('public'),
appNodeModules: resolveApp('node_modules'),
appSrc: resolveApp('src'),
- appServerIndexJs: resolveApp('src/index.js'),
+ appServerIndexJs: resolveApp('src'),
appClientIndexJs: resolveApp('src/client'),
appBabelRc: resolveApp('.babelrc'),
appRazzleConfig: resolveApp('razzle.config.js'), | Make path to server more TS friendly by removing strict file type | jaredpalmer_razzle | train | js |
94d2426d9b3374fa587adc764a691c05bada52f5 | diff --git a/kiner/producer.py b/kiner/producer.py
index <HASH>..<HASH> 100644
--- a/kiner/producer.py
+++ b/kiner/producer.py
@@ -43,12 +43,14 @@ class KinesisProducer:
def __init__(self, stream_name, batch_size=500,
batch_time=5, max_retries=5, threads=10,
- kinesis_client=boto3.client('kinesis')):
+ kinesis_client=None):
self.stream_name = stream_name
self.queue = Queue()
self.batch_size = batch_size
self.batch_time = batch_time
self.max_retries = max_retries
+ if kinesis_client is None:
+ kinesis_client = boto3.client('kinesis')
self.kinesis_client = kinesis_client
self.pool = ThreadPoolExecutor(threads)
self.last_flush = time.time() | Remove boto3 instantiation from constructor definition | bufferapp_kiner | train | py |
ae62c5ba33a5cb1d09dd7573d11ccb3e982f9809 | diff --git a/salt/utils/templates.py b/salt/utils/templates.py
index <HASH>..<HASH> 100644
--- a/salt/utils/templates.py
+++ b/salt/utils/templates.py
@@ -85,11 +85,12 @@ def render_jinja_tmpl(tmplstr, context, tmplpath=None):
loader = jinja2.FileSystemLoader(context, os.path.dirname(tmplpath))
else:
loader = JinjaSaltCacheLoader(opts, context['env'])
+ env_args = {'extensions': ['jinja2.ext.with_'], 'loader': loader}
if opts.get('allow_undefined', False):
- jinja_env = jinja2.Environment(loader=loader)
+ jinja_env = jinja2.Environment(**env_args)
else:
jinja_env = jinja2.Environment(
- loader=loader, undefined=jinja2.StrictUndefined)
+ undefined=jinja2.StrictUndefined,**env_args)
try:
output = jinja_env.from_string(tmplstr).render(**context)
except jinja2.exceptions.TemplateSyntaxError, exc: | Enable with-tag extension in Jinja2 render.
Closes #<I>. | saltstack_salt | train | py |
3741529e647baea5955b55d7eb793a784b56612e | diff --git a/src/Command/Generate/ModuleCommand.php b/src/Command/Generate/ModuleCommand.php
index <HASH>..<HASH> 100644
--- a/src/Command/Generate/ModuleCommand.php
+++ b/src/Command/Generate/ModuleCommand.php
@@ -211,7 +211,7 @@ class ModuleCommand extends Command
'composer' => $composer,
'dependencies' => $dependencies,
'test' => $test,
- 'twigTemplate' => $twigTemplate,
+ 'twig_template' => $twigTemplate,
]);
return 0; | Fix the wrong param name (#<I>) | hechoendrupal_drupal-console | train | php |
361b68b34aa2eb50751c5bf3b891367f2b0f2e5e | diff --git a/lib/editor/dialog.js b/lib/editor/dialog.js
index <HASH>..<HASH> 100644
--- a/lib/editor/dialog.js
+++ b/lib/editor/dialog.js
@@ -61,7 +61,9 @@ Dialog._geckoOpenModal = function(url, action, init) {
};
capwin(window);
// capture other frames
- for (var i = 0; i < window.frames.length; capwin(window.frames[i++]));
+ if(document.all) {
+ for (var i = 0; i < window.frames.length; capwin(window.frames[i++]));
+ }
// make up a function to be called when the Dialog ends.
Dialog._return = function (val) {
if (val && action) {
@@ -69,7 +71,9 @@ Dialog._geckoOpenModal = function(url, action, init) {
}
relwin(window);
// capture other frames
- for (var i = 0; i < window.frames.length; relwin(window.frames[i++]));
+ if(document.all) {
+ for (var i = 0; i < window.frames.length; relwin(window.frames[i++]));
+ }
Dialog._modal = null;
};
}; | Not so nice fix for "Not allowed to write to dialogs" on FireFox! | moodle_moodle | train | js |
3e4f297b92a158bbaa3e8fd91002c0db6f1f94a6 | diff --git a/tests/test_secrets.py b/tests/test_secrets.py
index <HASH>..<HASH> 100644
--- a/tests/test_secrets.py
+++ b/tests/test_secrets.py
@@ -92,18 +92,14 @@ def test_counterspell_wild_pyromancer():
def test_dart_trap():
- game = prepare_game(CardClass.WARRIOR, CardClass.WARRIOR)
+ game = prepare_game(CardClass.WARLOCK, CardClass.WARLOCK)
darttrap = game.player1.give("LOE_021")
darttrap.play()
game.end_turn()
- wisp = game.player2.give(WISP)
- wisp.play()
- assert darttrap in game.player1.secrets
assert game.player2.hero.health == 30
game.player2.hero.power.use()
- assert darttrap not in game.player1.secrets
- assert wisp.dead ^ (game.player2.hero.health == 25)
+ assert game.player2.hero.health == 30 - 5 - 2
def test_duplicate(): | Make Dart Trap test more deterministic | jleclanche_fireplace | train | py |
4c995d3bc9bfe9c5c01777ba760762d6fb3c4db6 | diff --git a/apps/actor-web/src/app/components/common/MessageItem.react.js b/apps/actor-web/src/app/components/common/MessageItem.react.js
index <HASH>..<HASH> 100644
--- a/apps/actor-web/src/app/components/common/MessageItem.react.js
+++ b/apps/actor-web/src/app/components/common/MessageItem.react.js
@@ -112,9 +112,7 @@ const markedOptions = {
const processText = function(text) {
var markedText = marked(text, markedOptions);
// need hack with replace because of https://github.com/Ranks/emojify.js/issues/127
- console.log(markedText);
var emojifiedText = emojify.replace(markedText.replace(/<p>/g, '<p> '));
- console.log(emojifiedText);
return emojifiedText;
}; | fix(web): removed unnessesary console.log | actorapp_actor-platform | train | js |
27fe283c3a023c66e6ad8e9c5a801553ba6e8606 | diff --git a/leeroy/base.py b/leeroy/base.py
index <HASH>..<HASH> 100644
--- a/leeroy/base.py
+++ b/leeroy/base.py
@@ -103,7 +103,7 @@ def github_notification():
"%s %s (%s): %s",
base_repo_name, number, html_url, action)
- if action not in ("opened", "synchronize"):
+ if action not in ("opened", "reopened", "synchronize"):
logging.debug("Ignored '%s' action." % action)
return Response(status=204) | Initiate build when PR is reopened.
When a PR has been reopened, kick off another build for the commit(s). This
also helps address issue #9 as you can close/reopen a PR to force a rebuild. | litl_leeroy | train | py |
b03531b306be7fa7ac6d7f33258d69febc121665 | diff --git a/onecodex/lib/upload.py b/onecodex/lib/upload.py
index <HASH>..<HASH> 100644
--- a/onecodex/lib/upload.py
+++ b/onecodex/lib/upload.py
@@ -661,7 +661,11 @@ def upload_sequence_fileobj(file_obj, file_name, fields, retry_fields, session,
_direct_upload(file_obj, file_name, fields, session, samples_resource)
sample_id = fields["sample_id"]
except RetryableUploadException:
- # upload failed--retry direct upload to S3 intermediate
+ # upload failed -- retry direct upload to S3 intermediate; first try to cancel pending upload
+ try:
+ samples_resource.cancel_upload({"sample_id": sample_id})
+ except Exception as e:
+ logging.debug("Failed to cancel upload: {}".format(e))
logging.error("{}: Connectivity issue, trying direct upload...".format(file_name))
file_obj.seek(0) # reset file_obj back to start
diff --git a/onecodex/version.py b/onecodex/version.py
index <HASH>..<HASH> 100644
--- a/onecodex/version.py
+++ b/onecodex/version.py
@@ -1 +1 @@
-__version__ = "0.5.2"
+__version__ = "0.5.3" | Add additional cancelation check for failed proxy uploads. Release <I>. | onecodex_onecodex | train | py,py |
4549060fd3cdda9c5d70548d3ff487772f6813c8 | diff --git a/phraseapp/config.go b/phraseapp/config.go
index <HASH>..<HASH> 100644
--- a/phraseapp/config.go
+++ b/phraseapp/config.go
@@ -231,8 +231,8 @@ func ParseYAMLToMap(unmarshal func(interface{}) error, keysToField map[string]in
*val, err = ValidateIsInt(k, v)
case *bool:
*val, err = ValidateIsBool(k, v)
- case map[string]interface{}:
- val, err = ValidateIsRawMap(k, v)
+ case *map[string]interface{}:
+ *val, err = ValidateIsRawMap(k, v)
default:
err = fmt.Errorf(cfgValueErrStr, k)
} | config: fix issue with map handling
The map must be given as reference. | phrase_phraseapp-go | train | go |
163735afa9dd03acef0a30007dd70365787f9efa | diff --git a/spec/test_helper.rb b/spec/test_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/test_helper.rb
+++ b/spec/test_helper.rb
@@ -2,7 +2,7 @@
require 'rubygems'
# To get the specs to run on Ruby 1.9.x.
-gem 'test-unit', '= 2.0.2'
+gem 'test-unit', '= 1.2.3'
gem 'activesupport', '>= 2.3.3'
gem 'actionpack', '>= 2.3.3'
gem 'rspec', '>= 1.2.6' | Force test-unit <I> - test-unit <I>.x causes problems. | justinfrench_formtastic | train | rb |
2ac644d983d1acd4a9cdafcc21c786a6bf919c0d | diff --git a/api/client.go b/api/client.go
index <HASH>..<HASH> 100644
--- a/api/client.go
+++ b/api/client.go
@@ -260,9 +260,9 @@ func NewClient(c *Config) (*Client, error) {
// but in e.g. http_test actual redirect handling is necessary
c.HttpClient.CheckRedirect = func(req *http.Request, via []*http.Request) error {
// Returning this value causes the Go net library to not close the
- // response body and nil out the error. Otherwise pester tries
+ // response body and to nil out the error. Otherwise pester tries
// three times on every redirect because it sees an error from this
- // function being passed through.
+ // function (to prevent redirects) passing through to it.
return http.ErrUseLastResponse
}
}
@@ -298,6 +298,11 @@ func (c *Client) Address() string {
return c.addr.String()
}
+// SetMaxRetries sets the number of retries that will be used in the case of certain errors
+func (c *Client) SetMaxRetries(retries int) {
+ c.config.MaxRetries = retries
+}
+
// SetWrappingLookupFunc sets a lookup function that returns desired wrap TTLs
// for a given operation and path
func (c *Client) SetWrappingLookupFunc(lookupFunc WrappingLookupFunc) { | Add ability to set max retries to API | hashicorp_vault | train | go |
c4c58ea4a31c460a543c11ed69156d3c0075c14a | diff --git a/bugtool/cmd/configuration.go b/bugtool/cmd/configuration.go
index <HASH>..<HASH> 100644
--- a/bugtool/cmd/configuration.go
+++ b/bugtool/cmd/configuration.go
@@ -77,7 +77,7 @@ func defaultCommands(confDir string, cmdDir string, k8sPods []string) []string {
"ip -6 route show table 200",
// xfrm
"ip xfrm policy",
- "ip -s xfrm state",
+ "ip -s xfrm state | awk '!/auth|enc/'",
// gops
fmt.Sprintf("gops memstats $(pidof %s)", components.CiliumAgentName),
fmt.Sprintf("gops stack $(pidof %s)", components.CiliumAgentName), | cilium: scrub keys from bugtool xfrm
Remove keys from xfrm debug output. We want the state output to
identify any issues with xfrm setup, the output has the stats.
We don't however want to record any keys.
Fixes: <I>b<I>ee<I> ("cilium: bugtool add xfrm details") | cilium_cilium | train | go |
be2e5f0da3cce74b0f201a094b99b48b8fdd1bba | diff --git a/tests/TestCase/Console/Command/CommandListShellTest.php b/tests/TestCase/Console/Command/CommandListShellTest.php
index <HASH>..<HASH> 100644
--- a/tests/TestCase/Console/Command/CommandListShellTest.php
+++ b/tests/TestCase/Console/Command/CommandListShellTest.php
@@ -107,6 +107,7 @@ class CommandListShellTest extends TestCase {
* @return void
*/
public function testMainXml() {
+ $this->assertFalse(defined('HHVM_VERSION'), 'Remove when travis updates to hhvm 2.5');
$this->Shell->params['xml'] = true;
$this->Shell->main(); | Skipping test that is broken in hhvm | cakephp_cakephp | train | php |
a64612d175259bdcb313aa088254477708c72437 | diff --git a/generators/app/index.js b/generators/app/index.js
index <HASH>..<HASH> 100644
--- a/generators/app/index.js
+++ b/generators/app/index.js
@@ -466,6 +466,7 @@ module.exports = class extends BaseGenerator {
this.warning(
'The generated application could not be committed to Git, as a Git repository could not be initialized.'
);
+ done();
}
});
} | Need to call done() when the project is not a git repo otherwise other generator end() methods won't be called. | jhipster_generator-jhipster | train | js |
37581f8dc63ba0c55b417f79fc96a2e85c37a3b2 | diff --git a/scoop/futures.py b/scoop/futures.py
index <HASH>..<HASH> 100644
--- a/scoop/futures.py
+++ b/scoop/futures.py
@@ -156,7 +156,6 @@ def mapScan(mapFunc, reductionOp, *iterables, **kargs):
"Be sure to start your program with the "
"'-m scoop' parameter. You can find further "
"information in the documentation.")
- child = Future(control.current.id, mapFunc, *args, **kargs)
child.add_done_callback(partial(reduction, operation=reductionOp),
inCallbackType=CallbackType.universal,
inCallbackGroup=thisCallbackGroupID)
@@ -204,7 +203,6 @@ def mapReduce(mapFunc, reductionOp, *iterables, **kargs):
"Be sure to start your program with the "
"'-m scoop' parameter. You can find further "
"information in the documentation.")
- child = Future(control.current.id, mapFunc, *args, **kargs)
child.add_done_callback(partial(reduction, operation=reductionOp),
inCallbackType=CallbackType.universal,
inCallbackGroup=thisCallbackGroupID) | - Removed extraneous statement. | soravux_scoop | train | py |
5010c765bf969ff21f3e8919b350eeeb2d82cf94 | diff --git a/tensorflow_probability/python/distributions/generalized_pareto.py b/tensorflow_probability/python/distributions/generalized_pareto.py
index <HASH>..<HASH> 100644
--- a/tensorflow_probability/python/distributions/generalized_pareto.py
+++ b/tensorflow_probability/python/distributions/generalized_pareto.py
@@ -175,9 +175,7 @@ class GeneralizedPareto(distribution.AutoCompositeTensorDistribution):
scale=parameter_properties.ParameterProperties(
default_constraining_bijector_fn=(
lambda: softplus_bijector.Softplus(low=dtype_util.eps(dtype)))),
- concentration=parameter_properties.ParameterProperties(
- default_constraining_bijector_fn=(
- lambda: softplus_bijector.Softplus(low=dtype_util.eps(dtype)))))
+ concentration=parameter_properties.ParameterProperties())
# pylint: enable=g-long-lambda
@property | GeneralizedPareto is not constrained to positive concentration.
PiperOrigin-RevId: <I> | tensorflow_probability | train | py |
5cb93134107d7e5262d8f3035b28998eccdc609a | diff --git a/soco.py b/soco.py
index <HASH>..<HASH> 100644
--- a/soco.py
+++ b/soco.py
@@ -689,7 +689,7 @@ class SoCo(object):
Returns:
A dictionary containing the following information about the speakers playing state
- CurrentTransportState (PLAYING or PAUSED_PLAYBACK), CurrentTrasnportStatus (OK, ?),
+ CurrentTransportState (PLAYING, PAUSED_PLAYBACK, STOPPED), CurrentTrasnportStatus (OK, ?),
CurrentSpeed(1,?)
This allows us to know if speaker is playing or not. Don't know other states of | Update soco.py
added stopped to currenttransportstate | amelchio_pysonos | train | py |
cd6bac9458498d0e225d80a358f77382f7921075 | diff --git a/lib/mincer/processor.js b/lib/mincer/processor.js
index <HASH>..<HASH> 100644
--- a/lib/mincer/processor.js
+++ b/lib/mincer/processor.js
@@ -55,15 +55,12 @@ inherits(Processor, Template);
// Run processor
-Processor.prototype.evaluate = function (context, locals, callback) {
+Processor.prototype.evaluate = function (context) {
if (Processor === this.constructor) {
- callback(new Error("Processor can't be used directly. Use `Processor.create()`."));
- return;
+ throw new Error("Processor can't be used directly. Use `Processor.create()`.");
}
- this.constructor.__func__(context, this.data, function (err, data) {
- callback(err, data);
- });
+ return this.constructor.__func__(context, this.data);
}; | Make Processor#evaluate synchronous.
Resolves #<I>
Closes #<I> | nodeca_mincer | train | js |
08d9d22993360e50aa8269eafa82362f29c38cf4 | diff --git a/tests/test_task_utils.py b/tests/test_task_utils.py
index <HASH>..<HASH> 100644
--- a/tests/test_task_utils.py
+++ b/tests/test_task_utils.py
@@ -1,4 +1,5 @@
import pytest
+import asyncio
from task_utils import pipe, Component
@@ -40,6 +41,35 @@ async def test_component_start_raise():
@pytest.mark.asyncio
+async def test_component_start_event():
+ EVENT = 'EVENT'
+
+ flag = False
+
+ async def component(x, *, commands, events):
+ nonlocal flag
+
+ # send WRONG event
+ events.send_nowait(EVENT)
+ await asyncio.sleep(0.05)
+ flag = True
+
+
+ comp = Component(component, 1)
+ with pytest.raises(Component.LifecycleError):
+ await comp.start()
+
+ await asyncio.sleep(0.1)
+ assert not flag
+
+ with pytest.raises(Component.Failure) as exc_info:
+ await comp.task
+ exc, = exc_info.value.args
+ with pytest.raises(asyncio.CancelledError):
+ raise exc
+
+
[email protected]
async def test_component_result_success():
async def component(x, *, commands, events):
events.send_nowait(Component.EVENT_START) | test that a wrong event on startup will cancel a component | SillyFreak_ConcurrentUtils | train | py |
3debab6bdd336e2d0593b5e4672cda73009f662a | diff --git a/ca/django_ca/tests/tests_extensions.py b/ca/django_ca/tests/tests_extensions.py
index <HASH>..<HASH> 100644
--- a/ca/django_ca/tests/tests_extensions.py
+++ b/ca/django_ca/tests/tests_extensions.py
@@ -44,6 +44,7 @@ from ..extensions import SubjectAlternativeName
from ..extensions import SubjectKeyIdentifier
from ..extensions import TLSFeature
from .base import DjangoCAWithCertTestCase
+from .base import cryptography_version
if ca_settings.CRYPTOGRAPHY_HAS_PRECERT_POISON: # pragma: only cryptography>=2.4
from ..extensions import PrecertPoison
@@ -909,7 +910,9 @@ class PrecertPoisonTestCase(TestCase):
PrecertPoison({'critical': False})
-class PrecertificateSignedCertificateTimestamps(DjangoCAWithCertTestCase):
[email protected](cryptography_version < (2, 4),
+ 'SCTs do not compare as equal in cryptography<2.4.')
+class PrecertificateSignedCertificateTimestamps(DjangoCAWithCertTestCase): # pragma: only cryptography>=2.4
def test_basic(self):
cert = self.cert_letsencrypt_jabber_at
ext = cert.x509.extensions.get_extension_for_oid(ExtensionOID.PRECERT_SIGNED_CERTIFICATE_TIMESTAMPS) | skip test in cryptography<<I> | mathiasertl_django-ca | train | py |
58ae280ec0458fa48639d3161d7fe71127da6313 | diff --git a/src/main/docs/resources/js/multi-language-sample.js b/src/main/docs/resources/js/multi-language-sample.js
index <HASH>..<HASH> 100644
--- a/src/main/docs/resources/js/multi-language-sample.js
+++ b/src/main/docs/resources/js/multi-language-sample.js
@@ -102,6 +102,11 @@ function postProcessCodeBlocks() {
multiLanguageSelectorElement.classList.add("multi-language-selector");
languageSelectorFragment.appendChild(multiLanguageSelectorElement);
+ if (sampleCollection.every(function(element) {
+ return element.classList.contains("hidden");
+ })) {
+ sampleCollection[0].classList.remove("hidden");
+ }
sampleCollection.forEach(function (sampleEl) {
var optionEl = document.createElement("code"); | Show the first sample in a multi language if none match the language choice | micronaut-projects_micronaut-core | train | js |
036346b604db75f2936ee6571031b88f68b52493 | diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go
index <HASH>..<HASH> 100644
--- a/reposerver/repository/repository.go
+++ b/reposerver/repository/repository.go
@@ -1117,7 +1117,8 @@ func (s *Service) GetAppDetails(ctx context.Context, q *apiclient.RepoServerAppD
continue
}
fName := f.Name()
- if strings.Contains(fName, "values") && (filepath.Ext(fName) == ".yaml" || filepath.Ext(fName) == ".yml") {
+ fileNameExt := strings.ToLower(filepath.Ext(fName))
+ if strings.Contains(fName, "values") && (fileNameExt == ".yaml" || fileNameExt == ".yml") {
res.Helm.ValueFiles = append(res.Helm.ValueFiles, fName)
}
} | fix: file exention comparisons are case sensitive (#<I>) | argoproj_argo-cd | train | go |
2822fdb39e6a0a85881f164a972b21f28fe7f166 | diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
+++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
@@ -619,7 +619,7 @@ class SecurityExtension extends Extension
->register($id, 'Symfony\Component\ExpressionLanguage\SerializedParsedExpression')
->setPublic(false)
->addArgument($expression)
- ->addArgument(serialize($this->getExpressionLanguage()->parse($expression, array('token', 'user', 'object', 'roles', 'request'))->getNodes()))
+ ->addArgument(serialize($this->getExpressionLanguage()->parse($expression, array('token', 'user', 'object', 'roles', 'request', 'trust_resolver'))->getNodes()))
;
return $this->expressions[$id] = new Reference($id); | [SecurityBundle] Add trust_resolver variable into expression
| Q | A
| ------------- | ---
| Bug fix? | [yes]
| New feature? | [no]
| BC breaks? | [no]
| Deprecations? | [no]
| Tests pass? | [yes]
| Fixed tickets | [#<I>]
| License | MIT
| Doc PR | [-] | symfony_symfony | train | php |
988e239d6efdd12c934b31f91cf5e198f797f301 | diff --git a/libraries/lithium/core/Libraries.php b/libraries/lithium/core/Libraries.php
index <HASH>..<HASH> 100644
--- a/libraries/lithium/core/Libraries.php
+++ b/libraries/lithium/core/Libraries.php
@@ -553,7 +553,7 @@ class Libraries {
* @return void
*/
protected static function _addPlugins($plugins) {
- $defaults = array('bootstrap' => true, 'route' => true);
+ $defaults = array('bootstrap' => null, 'route' => true);
$params = array('app' => LITHIUM_APP_PATH, 'root' => LITHIUM_LIBRARY_PATH);
$result = array();
@@ -572,6 +572,9 @@ class Libraries {
}
}
}
+ if (is_null($plugin['bootstrap'])) {
+ $options['bootstrap'] = file_exists($options['path'] . '/config/bootstrap.php');
+ }
$plugin = static::add($name, $options + $defaults);
if ($plugin['route']) { | By default, plugins now conditionally load bootstrap files, only if they exist. | UnionOfRAD_framework | train | php |
6318d68005dfbb892af86b3a2af9101f9df1f277 | diff --git a/src/Model/Behavior/DuplicatableBehavior.php b/src/Model/Behavior/DuplicatableBehavior.php
index <HASH>..<HASH> 100644
--- a/src/Model/Behavior/DuplicatableBehavior.php
+++ b/src/Model/Behavior/DuplicatableBehavior.php
@@ -292,7 +292,7 @@ class DuplicatableBehavior extends Behavior
break;
case 'set':
- if (is_callable($value) && !is_string($value)) {
+ if (!is_string($value) && is_callable($value)) {
$value = $value($entity);
}
$entity->set($prop, $value); | Check for a string first to pass the condition quicker | riesenia_cakephp-duplicatable | train | php |
0cbf4cccf798cc4c7dbd3541ed1060d27c62adec | diff --git a/tests/PHPUnit/TestingEnvironment.php b/tests/PHPUnit/TestingEnvironment.php
index <HASH>..<HASH> 100644
--- a/tests/PHPUnit/TestingEnvironment.php
+++ b/tests/PHPUnit/TestingEnvironment.php
@@ -95,6 +95,12 @@ class Piwik_TestingEnvironment
}
}
+ if ($testingEnvironment->globalsOverride) {
+ foreach ($testingEnvironment->globalsOverride as $key => $value) {
+ $GLOBALS[$key] = $value;
+ }
+ }
+
Config::setSingletonInstance(new Config(
$testingEnvironment->configFileGlobal, $testingEnvironment->configFileLocal, $testingEnvironment->configFileCommon
));
@@ -139,7 +145,6 @@ class Piwik_TestingEnvironment
if ($testingEnvironment->configOverride) {
$cache = $testingEnvironment->arrayMergeRecursiveDistinct($cache, $testingEnvironment->configOverride);
}
-
});
}
Piwik::addAction('Request.dispatch', function() { | Allow global variables to be manipulated through TestingEnvironment class. | matomo-org_matomo | train | php |
2d2ac84eb0f8cfb9a9dd700db66d5ae97995b8a0 | diff --git a/application/briefkasten/tests/test_settings.py b/application/briefkasten/tests/test_settings.py
index <HASH>..<HASH> 100644
--- a/application/briefkasten/tests/test_settings.py
+++ b/application/briefkasten/tests/test_settings.py
@@ -2,8 +2,8 @@ from py.test import fixture
size_values = {
'200': 200,
- '20M': 20971520,
- '1Gb': 1073741824
+ '20M': 20000000,
+ '1Gb': 1000000000
} | Adjust to new values
(probably due to updated library, not sure at this point, the change
seems innocent enough, though) | ZeitOnline_briefkasten | train | py |
6c144382289ff2d68e5f0621c0f041aaaa2e3c47 | diff --git a/src/Auth/BaseAuthenticate.php b/src/Auth/BaseAuthenticate.php
index <HASH>..<HASH> 100644
--- a/src/Auth/BaseAuthenticate.php
+++ b/src/Auth/BaseAuthenticate.php
@@ -122,7 +122,7 @@ abstract class BaseAuthenticate implements EventListenerInterface
// null passwords as authentication systems
// like digest auth don't use passwords
// and hashing *could* create a timing side-channel.
- if (strlen($password) > 0) {
+ if ($password !== null) {
$hasher = $this->passwordHasher();
$hasher->hash($password);
} | Apply hashing to empty passwords as well.
Only when the password is null should hashing be skipped. | cakephp_cakephp | train | php |
061949de6b487e2cc29a9d31205b096284c8cb4a | diff --git a/src/Form/Factory/MelisSiteSelectFactory.php b/src/Form/Factory/MelisSiteSelectFactory.php
index <HASH>..<HASH> 100644
--- a/src/Form/Factory/MelisSiteSelectFactory.php
+++ b/src/Form/Factory/MelisSiteSelectFactory.php
@@ -26,7 +26,7 @@ class MelisSiteSelectFactory extends MelisSelectFactory
for ($i = 0; $i < $max; $i++)
{
$site = $sites->current();
- $valueoptions[$site->site_id] = $site->site_name;
+ $valueoptions[$site->site_id] = $site->site_label;
$sites->next();
} | changed MelisSiteSelect options from site_name to site_label | melisplatform_melis-core | train | php |
55cc2d408d38672ed10bcce6bb54909703a4b920 | diff --git a/src/test/java/com/jnape/palatable/lambda/io/IOTest.java b/src/test/java/com/jnape/palatable/lambda/io/IOTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/com/jnape/palatable/lambda/io/IOTest.java
+++ b/src/test/java/com/jnape/palatable/lambda/io/IOTest.java
@@ -352,7 +352,6 @@ public class IOTest {
IO<Unit> two = io(() -> {
oneStarted.await();
accesses.add("two entered");
- Thread.sleep(10);
accesses.add("two exited");
finishLine.countDown();
});
@@ -365,7 +364,7 @@ public class IOTest {
start();
}};
- if (!finishLine.await(1, SECONDS))
+ if (!finishLine.await(5, SECONDS))
fail("Expected threads to have completed by now");
assertEquals(asList("one entered", "one exited", "two entered", "two exited"), accesses);
} | travis is unable to run monitorSync in 1 second? | palatable_lambda | train | java |
7e340f54352efc8c41a5f6ceefd50756e931ae5e | diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/ServiceProvider.php
+++ b/src/ServiceProvider.php
@@ -8,6 +8,8 @@ use Illuminate\Support\ServiceProvider as BaseServiceProvider;
class ServiceProvider extends BaseServiceProvider
{
+ protected $transKey = 'mailgun-email-validation::validation.mailgun_email';
+
public function boot()
{
$this->publishes([
@@ -16,7 +18,7 @@ class ServiceProvider extends BaseServiceProvider
$this->loadTranslationsFrom(__DIR__ . '/../lang/', 'mailgun-email-validation');
- $message = $this->app->translator->trans('mailgun-email-validation::validation.mailgun_email');
+ $message = $this->getMessage();
Validator::extend('mailgun_email', 'Kouz\LaravelMailgunValidation\EmailRule@validate', $message);
}
@@ -27,4 +29,13 @@ class ServiceProvider extends BaseServiceProvider
return new EmailRule(new Client(), $app['log'], config('mailgun-email-validation.key'));
});
}
+
+ protected function getMessage()
+ {
+ if (method_exists($this->app->translator, 'trans')) {
+ return $this->app->translator->trans($this->transKey);
+ }
+
+ return $this->app->translator->get($this->transKey);
+ }
} | Add support for laravel 6 | TheoKouzelis_laravel-mailgun-email-validation | train | php |
b74dea7bfd297c0d38ea12e7c52a8ae59f43c980 | diff --git a/src/phpDocumentor/Application.php b/src/phpDocumentor/Application.php
index <HASH>..<HASH> 100644
--- a/src/phpDocumentor/Application.php
+++ b/src/phpDocumentor/Application.php
@@ -63,17 +63,7 @@ final class Application
public function cacheFolder() : string
{
- if ($this->cacheFolder === null) {
- throw new \RuntimeException('Cache folder should be declared before first use');
- }
-
- return $this->cacheFolder;
- //return sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'phpdocumentor' . DIRECTORY_SEPARATOR . 'pools';
- }
-
- public function withCacheFolder(string $cacheFolder) : void
- {
- $this->cacheFolder = $cacheFolder;
+ return sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'phpdocumentor' . DIRECTORY_SEPARATOR . 'pools';
}
/** | Revert cache folder change
The cache folder is checked in the constructor and far before we can
actually determine one. As such we cannot pass our own, and perhaps need
to find another way to do caching. | phpDocumentor_phpDocumentor2 | train | php |
f5d8b575b4e30979e6a37a8f85007b00fc741bc8 | diff --git a/packages/neos-ui/src/Containers/Modals/NodeCreationDialog/index.js b/packages/neos-ui/src/Containers/Modals/NodeCreationDialog/index.js
index <HASH>..<HASH> 100644
--- a/packages/neos-ui/src/Containers/Modals/NodeCreationDialog/index.js
+++ b/packages/neos-ui/src/Containers/Modals/NodeCreationDialog/index.js
@@ -145,10 +145,9 @@ export default class NodeCreationDialog extends PureComponent {
onRequestClose={this.handleCancel}
isOpen
isWide
- id="ddd"
>
<DisplayName name="NodeCreationDialogBody">
- <div className={style.body} id="ddd-d">
+ <div className={style.body}>
{Object.keys(configuration.elements).map((elementName, index) => {
//
// Only display errors after user input (isDirty) | CLEANUP: remove test id selectors | neos_neos-ui | train | js |
1080bfc6765291da06ac94b58e95b7ba278676f5 | diff --git a/src/cells.js b/src/cells.js
index <HASH>..<HASH> 100644
--- a/src/cells.js
+++ b/src/cells.js
@@ -11,7 +11,7 @@ const appendDefaultCell = appendFromTemplate(
, appendRow = appendFromTemplate('<li class="zambezi-grid-row"></li>')
, changed = selectionChanged()
, firstLastChanged = selectionChanged().key(firstAndLast)
- , indexChanged = selectionChanged().key(d => d.index).debug(true)
+ , indexChanged = selectionChanged().key(d => d.index)
, id = property('id')
, isFirst = property('isFirst')
, isLast = property('isLast') | Turn off debug for cell top change. | zambezi_grid | train | js |
57015d523be0d46beceb72bbf0aa730c266baf1e | diff --git a/test/unittest_checker_python3.py b/test/unittest_checker_python3.py
index <HASH>..<HASH> 100644
--- a/test/unittest_checker_python3.py
+++ b/test/unittest_checker_python3.py
@@ -28,6 +28,8 @@ def python2_only(test):
return unittest.skipIf(sys.version_info[0] > 2, 'Python 2 only')(test)
+# TODO(cpopa): Port these to the functional test framework instead.
+
class Python3CheckerTest(testutils.CheckerTestCase):
CHECKER_CLASS = checker.Python3Checker | Add a new TODO entry. | PyCQA_pylint | train | py |
a266446746c49f55c3447c467f053f88c2059c66 | diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index <HASH>..<HASH> 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -3246,6 +3246,12 @@ class Cmd(cmd.Cmd):
"""
expanded_filename = os.path.expanduser(filename)
+ if not expanded_filename.endswith('.py'):
+ self.pwarning("'{}' does not appear to be a Python file".format(expanded_filename))
+ selection = self.select('Yes No', 'Continue to try to run it as a Python script? ')
+ if selection != 'Yes':
+ return
+
# cmd_echo defaults to False for scripts. The user can always toggle this value in their script.
py_bridge.cmd_echo = False
@@ -3756,9 +3762,9 @@ class Cmd(cmd.Cmd):
self.perror("'{}' is not an ASCII or UTF-8 encoded text file".format(expanded_path))
return
- if expanded_path.endswith('.py') or expanded_path.endswith('.pyc'):
+ if expanded_path.endswith('.py'):
self.pwarning("'{}' appears to be a Python file".format(expanded_path))
- selection = self.select('Yes No', 'Continue to try to run it as a text file script? ')
+ selection = self.select('Yes No', 'Continue to try to run it as a text script? ')
if selection != 'Yes':
return | Print warning if a user tries to run something other than a *.py file with run_pyscript and ask them if they want to continue | python-cmd2_cmd2 | train | py |
25ec3f3c3add7964570383cd3c9592946152baf5 | diff --git a/tests/selenium_test.go b/tests/selenium_test.go
index <HASH>..<HASH> 100644
--- a/tests/selenium_test.go
+++ b/tests/selenium_test.go
@@ -1,3 +1,5 @@
+// +build selenium
+
/*
* Copyright (C) 2017 Red Hat, Inc.
* | test: restrict selenium tests runs only in selenium ci job
Change-Id: I<I>aa<I>ab<I>a<I>a<I>a<I>c5ce7bbc<I>
Reviewed-on: <URL> | skydive-project_skydive | train | go |
5b417e8d8ba2156930bf112a15fa702e116bcd97 | diff --git a/core/src/main/java/com/google/errorprone/refaster/UTemplater.java b/core/src/main/java/com/google/errorprone/refaster/UTemplater.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/google/errorprone/refaster/UTemplater.java
+++ b/core/src/main/java/com/google/errorprone/refaster/UTemplater.java
@@ -930,7 +930,13 @@ public class UTemplater extends SimpleTreeVisitor<Tree, Void> {
(Class) annotationClazz,
AnnotationProxyMaker.generateAnnotation(compound, annotationClazz));
} catch (ClassNotFoundException e) {
- throw new IllegalArgumentException("Unrecognized annotation type", e);
+ String friendlyMessage =
+ "Tried to instantiate an instance of the annotation "
+ + annotationClassName
+ + " while processing "
+ + symbol.getSimpleName()
+ + ", but the annotation class file was not present on the classpath.";
+ throw new LinkageError(friendlyMessage, e);
}
}
return builder.build(); | Expand on the error when a Refaster template is trying to be loaded, but the annotations required aren't on the classpath.
RELNOTES=n/a
PiperOrigin-RevId: <I> | google_error-prone | train | java |
b9c2f460792c579bf3bbc07ad057c18a4a662ad7 | diff --git a/openid/consumer/consumer.py b/openid/consumer/consumer.py
index <HASH>..<HASH> 100644
--- a/openid/consumer/consumer.py
+++ b/openid/consumer/consumer.py
@@ -1,7 +1,7 @@
# -*- test-case-name: openid.test.consumer -*-
"""
This module documents the main interface with the OpenID consumer
-libary. The only part of the library which has to be used and isn't
+library. The only part of the library which has to be used and isn't
documented in full here is the store required to create an
C{L{Consumer}} instance. More on the abstract store type and
concrete implementations of it that are provided in the documentation | [project @ consumer.consumer: doc typo] | openid_python-openid | train | py |
e6199c3327182fab13cf9c6fd4cd13b3b3206daa | diff --git a/holoviews/core/data/interface.py b/holoviews/core/data/interface.py
index <HASH>..<HASH> 100644
--- a/holoviews/core/data/interface.py
+++ b/holoviews/core/data/interface.py
@@ -146,7 +146,7 @@ class Interface(param.Parameterized):
however if the type is expensive to import at load time the
method may be overridden.
"""
- return any(isinstance(obj, t) for t in cls.types)
+ return type(obj) in cls.types
@classmethod
def register(cls, interface): | Fixed bug in Interface.applies (#<I>) | pyviz_holoviews | train | py |
4d140a61de5717f5136e1decb7bb3e5dc80cd5e9 | diff --git a/spec/examples/spec_support/preparation_spec.rb b/spec/examples/spec_support/preparation_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/examples/spec_support/preparation_spec.rb
+++ b/spec/examples/spec_support/preparation_spec.rb
@@ -75,6 +75,7 @@ describe Cequel::SpecSupport::Preparation do
after(:each) do
begin
+ Cequel::Record.connection.clear_active_connections!
Cequel::Record.connection.schema.create!
rescue
nil | another attempt to harden the spec prep tests against intermittent failures | cequel_cequel | train | rb |
25f62af16273441a5510261e04699895da5fa28f | diff --git a/nsinit/nsinit/main.go b/nsinit/nsinit/main.go
index <HASH>..<HASH> 100644
--- a/nsinit/nsinit/main.go
+++ b/nsinit/nsinit/main.go
@@ -24,7 +24,7 @@ var (
ErrWrongArguments = errors.New("Wrong argument count")
)
-func init() {
+func registerFlags() {
flag.StringVar(&console, "console", "", "console (pty slave) path")
flag.StringVar(&logFile, "log", "none", "log options (none, stderr, or a file path)")
flag.IntVar(&pipeFd, "pipe", 0, "sync pipe fd")
@@ -33,6 +33,8 @@ func init() {
}
func main() {
+ registerFlags()
+
if flag.NArg() < 1 {
log.Fatal(ErrWrongArguments)
} | Fix tests with dockerinit lookup path
Docker-DCO-<I>- | opencontainers_runc | train | go |
f18cc3590ac5fef57cfdc56f90ff7c6491d9d21c | diff --git a/arangodb/api.py b/arangodb/api.py
index <HASH>..<HASH> 100644
--- a/arangodb/api.py
+++ b/arangodb/api.py
@@ -326,6 +326,30 @@ class Database(object):
return db
+ @classmethod
+ def get_all(cls):
+ """
+ """
+
+ api = Client.instance().api
+
+ data = api.database.get()
+
+ database_names = data['result']
+
+ return database_names
+
+
+ @classmethod
+ def remove(cls, name):
+ """
+ """
+
+ api = Client.instance().api
+
+ api.database(name).delete()
+
+
def __init__(self, name, api, **kwargs):
"""
""" | Now the names of all databases can be retrieved and a database can be deleted | saeschdivara_ArangoPy | train | py |
c8cdec58d9b162e6549a6d9248ca4f8c00b14b49 | diff --git a/lib/mycroft.rb b/lib/mycroft.rb
index <HASH>..<HASH> 100644
--- a/lib/mycroft.rb
+++ b/lib/mycroft.rb
@@ -2,7 +2,6 @@ require 'mycroft/version'
require 'mycroft/cli'
require 'mycroft/helpers'
require 'mycroft/messages'
-require 'mycroft/logger'
require 'mycroft/client'
module Mycroft | Remove logger from mycroft.rb | rit-sse-mycroft_template-ruby | train | rb |
b66330326d6647af186fe63e7435cc6c73a9b713 | diff --git a/src/codegeneration/ModuleTransformer.js b/src/codegeneration/ModuleTransformer.js
index <HASH>..<HASH> 100644
--- a/src/codegeneration/ModuleTransformer.js
+++ b/src/codegeneration/ModuleTransformer.js
@@ -42,7 +42,7 @@ import {assert} from '../util/assert.js';
import {
resolveUrl,
canonicalizeUrl
-} from '../../src/util/url.js';
+} from '../util/url.js';
import {
createArgumentList,
createExpressionStatement, | Fix import path
Towards #<I>. The extra `../src/` made this load the file in src
instead of dist. | google_traceur-compiler | train | js |
e9925f4e3bdf275d17c203516c8bd9464af9cf59 | diff --git a/tests/settings.py b/tests/settings.py
index <HASH>..<HASH> 100644
--- a/tests/settings.py
+++ b/tests/settings.py
@@ -18,3 +18,7 @@ INSTALLED_APPS = (
'django.contrib.admin',
'djangosaml2',
)
+
+AUTHENTICATION_BACKENDS = (
+ 'djangosaml2.backends.Saml2Backend',
+) | Add saml auth backend to settings in test project.
Now that this isn't being monkey patched in, our test project needs to have it. | knaperek_djangosaml2 | train | py |
601fc9013f65fc3b15e5470836413ed59d693791 | diff --git a/core/src/main/java/net/kuujo/copycat/internal/cluster/coordinator/DefaultClusterCoordinator.java b/core/src/main/java/net/kuujo/copycat/internal/cluster/coordinator/DefaultClusterCoordinator.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/net/kuujo/copycat/internal/cluster/coordinator/DefaultClusterCoordinator.java
+++ b/core/src/main/java/net/kuujo/copycat/internal/cluster/coordinator/DefaultClusterCoordinator.java
@@ -201,7 +201,7 @@ public class DefaultClusterCoordinator implements ClusterCoordinator {
private synchronized CompletableFuture<Void> closeResources() {
List<CompletableFuture<Void>> futures = new ArrayList<>(resources.size());
for (ResourceHolder resource : resources.values()) {
- futures.add(resource.state.close().thenCompose(v -> resource.cluster.close()));
+ futures.add(resource.state.close().thenCompose(v -> resource.cluster.close()).thenRun(() -> resource.state.executor().shutdown()));
}
return CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()]));
} | Shut down resource executors when cluster is shut down. | atomix_atomix | train | java |
7d551ba80f95113db22b53212929f00986d17667 | diff --git a/Vps/Setup.php b/Vps/Setup.php
index <HASH>..<HASH> 100644
--- a/Vps/Setup.php
+++ b/Vps/Setup.php
@@ -26,7 +26,7 @@ class Vps_Setup
public static function setUpZend()
{
- error_reporting(E_ALL ^ E_STRICT);
+ error_reporting(E_ALL & ~E_STRICT);
if (file_exists(VPS_PATH.'/include_path')) {
$zendPath = trim(file_get_contents(VPS_PATH.'/include_path'));
@@ -112,10 +112,10 @@ class Vps_Setup
ini_set('memory_limit', '128M');
- error_reporting(E_ALL ^ E_STRICT);
+ error_reporting(E_ALL & ~E_STRICT);
date_default_timezone_set('Europe/Berlin');
mb_internal_encoding('UTF-8');
- set_error_handler(array('Vps_Debug', 'handleError'), E_ALL ^ E_STRICT);
+ set_error_handler(array('Vps_Debug', 'handleError'), E_ALL & ~E_STRICT);
set_exception_handler(array('Vps_Debug', 'handleException'));
umask(000); //nicht 002 weil wwwrun und vpcms in unterschiedlichen gruppen | use proper operator when removing strict from error reporting | koala-framework_koala-framework | train | php |
92b2ce63fd30d595065706327293b78f8c2b86e2 | diff --git a/fetcher.go b/fetcher.go
index <HASH>..<HASH> 100644
--- a/fetcher.go
+++ b/fetcher.go
@@ -253,7 +253,7 @@ func (f *consumerFetcherRoutine) start() {
Warnf(f, "Current offset %d for topic %s and partition %s is out of range.", offset, nextTopicPartition.Topic, nextTopicPartition.Partition)
f.handleOffsetOutOfRange(&nextTopicPartition)
} else {
- Warnf(f, "Got a fetch error: %s", err)
+ Warnf(f, "Got a fetch error for topic %s, partition %d: %s", nextTopicPartition.Topic, nextTopicPartition.Partition, err)
//TODO new backoff type?
time.Sleep(1 * time.Second)
} | Added topic-partition logging on fetch errors | elodina_go_kafka_client | train | go |
5d2b7fe438ee1171afa95e214968ff9bed3d82d7 | diff --git a/lib/store.js b/lib/store.js
index <HASH>..<HASH> 100644
--- a/lib/store.js
+++ b/lib/store.js
@@ -81,8 +81,15 @@ Store.prototype.get = function(url, cb) {
}
this.Resource.one({url: url}, function(err, obj) {
if (obj) {
- // TODO populate obj.resources - needed if raja cache is not volatile
- this.lfu.set(url, this.raja.shallow(obj));
+ var lfuObj = this.raja.shallow(obj);
+ lfuObj.resources = {};
+ obj.getChildren(function(err, children) {
+ if (err) return cb(err);
+ children.forEach(function(child) {
+ lfuObj.resources[child.url] = true;
+ });
+ this.lfu.set(url, lfuObj);
+ }.bind(this));
}
cb(err, obj);
}.bind(this)); | Populate lfuObj.resources from disk store | kapouer_raja | train | js |
1e25976dd49f0300fee1d3d063afa6d13648236b | diff --git a/src/main/java/org/takes/facets/fallback/FbStatus.java b/src/main/java/org/takes/facets/fallback/FbStatus.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/takes/facets/fallback/FbStatus.java
+++ b/src/main/java/org/takes/facets/fallback/FbStatus.java
@@ -51,7 +51,7 @@ public final class FbStatus extends FbWrap {
/**
* Whitespace pattern, used for splitting.
*/
- private static final Pattern WHITESPACE_PATTERN = Pattern.compile("\\s");
+ private static final Pattern SPLIT_PATTERN = Pattern.compile("\\s");
/**
* Ctor.
@@ -82,7 +82,7 @@ public final class FbStatus extends FbWrap {
new RsWithBody(
res,
String.format(
- "%s: %s", WHITESPACE_PATTERN.split(
+ "%s: %s", SPLIT_PATTERN.split(
res.head().iterator().next(),
2
)[1], req.throwable().getLocalizedMessage() | Rename the WHITESPACE_PATTERN variable to SPLIT_PATTERN. | yegor256_takes | train | java |
cd41451eceac98ffde6bf7acfab2a58671af0555 | diff --git a/Command/WatchCommand.php b/Command/WatchCommand.php
index <HASH>..<HASH> 100644
--- a/Command/WatchCommand.php
+++ b/Command/WatchCommand.php
@@ -82,6 +82,10 @@ class WatchCommand extends AbstractAssetsCommand
$runCommand = new RunCommand();
$runCommand->setContainer($this->container);
$runCommand->run(new ArrayInput([]), $output);
+
+ // re-index the sources because they could have been changed during the previous build (for example,
+ // if the destination of a task is the source of an other task, it could lead to infinite build)
+ $indexer->index($sources);
$this
->io | fix infinite build if a destination of a task is the source of an other one (refs #4) | johnkrovitch_SamBundle | train | php |
f09bfb4100ef763ae56074d6dfbca9f2e7e238a8 | diff --git a/app/controllers/cfp/controller.rb b/app/controllers/cfp/controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/cfp/controller.rb
+++ b/app/controllers/cfp/controller.rb
@@ -1,11 +1,14 @@
class Cfp::Controller < ::ApplicationController
- before_filter :check_for_profile
+ before_filter :check_for_profile, :set_locale
layout 'cfp/application'
def check_for_profile
if current_user
redirect_to new_profile_path if current_user.should_create_profile?
- I18n.locale = current_user.profile.locale if current_user.profile
end
end
+
+ def set_locale
+ I18n.locale = current_user.profile.locale if current_user && current_user.profile
+ end
end | Separate the controller code that sets the locale | crowdint_cfp | train | rb |
11e4f1751caf8ccdbc001c1d130333b00f8c2382 | diff --git a/saltcloud/clouds/ec2.py b/saltcloud/clouds/ec2.py
index <HASH>..<HASH> 100644
--- a/saltcloud/clouds/ec2.py
+++ b/saltcloud/clouds/ec2.py
@@ -175,7 +175,7 @@ def get_configured_provider():
'''
return config.is_provider_configured(
__opts__,
- 'ec2',
+ __active_provider_name__ or 'ec2',
('id', 'key', 'keyname', 'private_key')
) | EC2 is now aware of the `__active_profile_name__` context variable. Refs #<I> | saltstack_salt | train | py |
56978206a37476b919980c2ccff6d36141ae4161 | diff --git a/lark/load_grammar.py b/lark/load_grammar.py
index <HASH>..<HASH> 100644
--- a/lark/load_grammar.py
+++ b/lark/load_grammar.py
@@ -605,6 +605,7 @@ def import_from_grammar_into_namespace(grammar, namespace, aliases):
_, tree, _ = imported_rules[symbol]
except KeyError:
raise GrammarError("Missing symbol '%s' in grammar %s" % (symbol, namespace))
+ tree = next(tree.find_data("expansion")) # Skip "alias" or other annotations
return tree.scan_values(lambda x: x.type in ('RULE', 'TERMINAL'))
def get_namespace_name(name): | No longer confusing aliases and rules when importing (Issue #<I>) | lark-parser_lark | train | py |
c6c436cda06419b24ba3f3b5c3d941b8d3544079 | diff --git a/www/src/py_exceptions.js b/www/src/py_exceptions.js
index <HASH>..<HASH> 100644
--- a/www/src/py_exceptions.js
+++ b/www/src/py_exceptions.js
@@ -74,14 +74,14 @@ $B.$syntax_err_line = function(exc, module, src, pos, line_num){
line = lines[line_num - 1],
lpos = pos - line_pos[line_num],
len = line.length
- exc.text = line
+ exc.text = line + '\n'
lpos -= len - line.length
if(lpos < 0){lpos = 0}
while(line.charAt(0) == ' '){
line = line.substr(1)
if(lpos > 0){lpos--}
}
- exc.offset = lpos
+ exc.offset = lpos + 1 // starts at column 1, not 0
exc.args = $B.fast_tuple([$B.$getitem(exc.args, 0),
$B.fast_tuple([module, line_num, lpos, line])])
} | Change in attribute offset of SyntaxError instances | brython-dev_brython | train | js |
36e85b2da19c759162d9a6aea3efe06665bbd426 | diff --git a/pylint/checkers/logging.py b/pylint/checkers/logging.py
index <HASH>..<HASH> 100644
--- a/pylint/checkers/logging.py
+++ b/pylint/checkers/logging.py
@@ -49,7 +49,7 @@ MSGS = {
the end of a conversion specifier.'),
'E1205': ('Too many arguments for logging format string',
'logging-too-many-args',
- 'Used when a logging format string is given too many arguments'),
+ 'Used when a logging format string is given too many arguments.'),
'E1206': ('Not enough arguments for logging format string',
'logging-too-few-args',
'Used when a logging format string is given too few arguments.'), | Fix description of E<I>
Add full stop to E<I> to make it more consistent with other descriptions. | PyCQA_pylint | train | py |
010ffec4ac769c4e8b104ec79ceeec5986205f91 | diff --git a/lib/mini_term/windows/win_32_api.rb b/lib/mini_term/windows/win_32_api.rb
index <HASH>..<HASH> 100644
--- a/lib/mini_term/windows/win_32_api.rb
+++ b/lib/mini_term/windows/win_32_api.rb
@@ -2,8 +2,6 @@
# Replacement support for deprecated win_32_api gem.
# With thanks to rb-readline gem from which this code comes.
-# This is the ugliest, smelliest Ruby code I've ever seen.
-# When the gem is up and running, clean up this crap.
module MiniTerm
require 'fiddle' | Got rid of snarky comments. | PeterCamilleri_mini_term | train | rb |
4d84981e6c7a703a14e6918f770644c36ca63871 | diff --git a/src/Router.php b/src/Router.php
index <HASH>..<HASH> 100644
--- a/src/Router.php
+++ b/src/Router.php
@@ -157,7 +157,7 @@ class Router {
return $response;
}
];
- register_rest_route( $this->_namespace, $route->get_path(), $args, true );
+ register_rest_route( $this->_namespace, $route->get_path(), $args );
}
} | set param in call of register_rest_route func to default (false) to prevent routes overriding | shtrihstr_simple-rest-api | train | php |
7fc4ad793843f5c6852b4bcf4ef92e99daf05748 | diff --git a/Resources/bundle-creator/skel/Installation/AdditionalInstaller.php b/Resources/bundle-creator/skel/Installation/AdditionalInstaller.php
index <HASH>..<HASH> 100644
--- a/Resources/bundle-creator/skel/Installation/AdditionalInstaller.php
+++ b/Resources/bundle-creator/skel/Installation/AdditionalInstaller.php
@@ -6,7 +6,7 @@ use Claroline\InstallationBundle\Additional\AdditionalInstaller as BaseInstaller
class AdditionalInsaller extends BaseInstaller
{
- private $logger;
+ protected $logger;
public function preUpdate($currentVersion, $targetVersion)
{ | [CoreBundle] Update AdditionalInstaller.php | claroline_Distribution | train | php |
8481febac78b61a19623a9b58696c2c8891f5e88 | diff --git a/src/Event/Dispatcher.php b/src/Event/Dispatcher.php
index <HASH>..<HASH> 100644
--- a/src/Event/Dispatcher.php
+++ b/src/Event/Dispatcher.php
@@ -70,7 +70,7 @@ class Dispatcher implements EventDispatcherInterface
/**
* {@inheritdoc}
*/
- public function getListeners(string $eventName = null)
+ public function getListeners(string $eventName = null): array
{
throw new \Exception('Please use `Event::getListeners()`.');
}
@@ -78,7 +78,7 @@ class Dispatcher implements EventDispatcherInterface
/**
* {@inheritdoc}
*/
- public function getListenerPriority(string $eventName, $listener)
+ public function getListenerPriority(string $eventName, $listener): ?int
{
throw new \Exception('Event priority is not supported anymore in Laravel.');
}
@@ -86,7 +86,7 @@ class Dispatcher implements EventDispatcherInterface
/**
* {@inheritdoc}
*/
- public function hasListeners(string $eventName = null)
+ public function hasListeners(string $eventName = null): bool
{
throw new \Exception('Please use `Event::hasListeners()`.');
} | Add return types to event dispatcher
Fixes #<I> | sebdesign_laravel-state-machine | train | php |
16bca449ac61bb0e33625accdaa5ad579041f51e | diff --git a/src/main/java/com/basho/riak/client/raw/http/HTTPClientConfig.java b/src/main/java/com/basho/riak/client/raw/http/HTTPClientConfig.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/basho/riak/client/raw/http/HTTPClientConfig.java
+++ b/src/main/java/com/basho/riak/client/raw/http/HTTPClientConfig.java
@@ -199,7 +199,6 @@ public class HTTPClientConfig implements Configuration {
* @return a {@link HTTPClientConfig}
*/
public HTTPClientConfig build() {
-
String builderUrl = url;
if (builderUrl == null) {
StringBuilder sb = new StringBuilder(scheme).append("://").append(host).append(":").append(port);
@@ -236,16 +235,13 @@ public class HTTPClientConfig implements Configuration {
// In order to allow you to change the host or port through the
// the builder when we're starting from an existing config,
// we need to parse them out (and not copy the existing url).
- if (copyConfig.url != null)
- {
+ if (copyConfig.url != null) {
Pattern p = Pattern.compile("//(.*):(\\d+)/");
Matcher m = p.matcher(copyConfig.url);
- if (m.find())
- {
+ if (m.find()) {
b.host = m.group(1);
b.port = Integer.parseInt(m.group(2));
}
-
}
return b; | Fixed style, with apolgies to Russell | basho_riak-java-client | train | java |
6566118c518e281275fc3d4b0e151452fee99e90 | diff --git a/lib/datalib.php b/lib/datalib.php
index <HASH>..<HASH> 100644
--- a/lib/datalib.php
+++ b/lib/datalib.php
@@ -49,14 +49,9 @@ function setup_DB() {
$CFG->dboptions = array();
}
- if ($CFG->dblibrary == 'adodb') {
- $classname = $CFG->dbtype.'_adodb_moodle_database';
- require_once($CFG->libdir.'/dml/'.$classname.'.php');
- $DB = new $classname();
-
- } else {
- error('Not implemented db library yet: '.$CFG->dblibrary);
- }
+ $classname = $CFG->dbtype.'_'.$CFG->dblibrary.'_moodle_database';
+ require_once($CFG->libdir.'/dml/'.$classname.'.php');
+ $DB = new $classname();
$CFG->dbfamily = $DB->get_dbfamily(); // TODO: BC only for now | MDL-<I> support for other database driver types | moodle_moodle | train | php |
c160ccdd3e3f3a9a8893397108f6035fb458780c | diff --git a/tests/Aura/Intl/IntlFormatterTest.php b/tests/Aura/Intl/IntlFormatterTest.php
index <HASH>..<HASH> 100644
--- a/tests/Aura/Intl/IntlFormatterTest.php
+++ b/tests/Aura/Intl/IntlFormatterTest.php
@@ -26,7 +26,7 @@ class IntlFormatterTest extends BasicFormatterTest
$string = '{:pages,plural,'
. '=0{No pages.}'
. '=1{One page only.}'
- . 'other{Page {:page} of {:pages} pages.}'
+ . 'other{Page {:page} of # pages.}'
. '}';
$tokens_values = ['page' => 0, 'pages' => 0]; | use # instead of {:pages} as the latter causes trouble in some cases | auraphp_Aura.Intl | train | php |
3d0682c3a4c0be2e2ddfe5ce40f0a252b04a340c | diff --git a/src/Convert/Converters/Gd.php b/src/Convert/Converters/Gd.php
index <HASH>..<HASH> 100644
--- a/src/Convert/Converters/Gd.php
+++ b/src/Convert/Converters/Gd.php
@@ -353,6 +353,8 @@ class Gd extends AbstractConverter
// I'm not certain that the error handler takes care of Throwable errors.
// and - sorry - was to lazy to find out right now. So for now: better safe than sorry. #320
$error = null;
+ $success = false;
+
try {
// Beware: This call can throw FATAL on windows (cannot be catched)
// This for example happens on palette images | make sure $success is defined | rosell-dk_webp-convert | train | php |
620496b37e68fabb63bc9d530b3cf76620e6b6f7 | diff --git a/youtubemodal/index.js b/youtubemodal/index.js
index <HASH>..<HASH> 100644
--- a/youtubemodal/index.js
+++ b/youtubemodal/index.js
@@ -259,7 +259,10 @@ function dispose() {
}
singleton.dispose();
singleton = null;
- player = null;
+ if (player) {
+ player.destroy();
+ player = null;
+ }
}
/** | destroy() YT player in youtubemodal dispose | grow_airkit | train | js |
56a43728ff19e7087e2773fed0f3598f4368b6c7 | diff --git a/src/ResourceStorage.php b/src/ResourceStorage.php
index <HASH>..<HASH> 100644
--- a/src/ResourceStorage.php
+++ b/src/ResourceStorage.php
@@ -86,7 +86,7 @@ final class ResourceStorage implements ResourceStorageInterface
assert($pool instanceof AdapterInterface);
if ($etagPool instanceof AdapterInterface) {
- $this->roPool = new TagAwareAdapter($pool, $etagPool);
+ $this->roPool = new TagAwareAdapter($pool, $etagPool, 0);
$this->etagPool = new TagAwareAdapter($etagPool);
return; | Add red condition
Set $knownTagVersionsTtl 0 | bearsunday_BEAR.QueryRepository | train | php |
267065406757cb3632da2f875be11b0771523f00 | diff --git a/py3status/__init__.py b/py3status/__init__.py
index <HASH>..<HASH> 100755
--- a/py3status/__init__.py
+++ b/py3status/__init__.py
@@ -5,6 +5,7 @@ import os
import select
import sys
+from collections import OrderedDict
from contextlib import contextmanager
from copy import deepcopy
from datetime import datetime, timedelta
@@ -846,7 +847,7 @@ class Module(Thread):
self.i3status_thread = i3_thread
self.last_output = []
self.lock = lock
- self.methods = {}
+ self.methods = OrderedDict()
self.module_class = None
self.module_inst = ''.join(module.split(' ')[1:])
self.module_name = module.split(' ')[0] | fix issue #<I>, ensure modules methods are always iterated alphabetically thx to @shankargopal | ultrabug_py3status | train | py |
8675453e8207a9cf3adc628136ed8ecfc698ecca | diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php
index <HASH>..<HASH> 100644
--- a/mod/quiz/lib.php
+++ b/mod/quiz/lib.php
@@ -590,7 +590,7 @@ function quiz_get_user_attempts($quizids, $userid, $status = 'finished', $includ
return $DB->get_records_select('quiz_attempts',
"quiz $insql AND userid = :userid" . $previewclause . $statuscondition,
- $params, 'attempt ASC');
+ $params, 'quiz, attempt ASC');
}
/** | MDL-<I> quiz: Ensure user attempts are deterministic for testing. | moodle_moodle | train | php |
bcd32986275e3a0f4d442754c5da077488106a66 | diff --git a/lxd/network/network_interface.go b/lxd/network/network_interface.go
index <HASH>..<HASH> 100644
--- a/lxd/network/network_interface.go
+++ b/lxd/network/network_interface.go
@@ -16,6 +16,7 @@ type Network interface {
fillConfig(config map[string]string) error
// Config.
+ ValidateName(name string) error
Validate(config map[string]string) error
Name() string
Type() string | lxd/network/network/interfaces: Adds ValidateName | lxc_lxd | train | go |
1da7699321468efda4b8002530e711f99015c7df | diff --git a/src/components/DatePicker/index.js b/src/components/DatePicker/index.js
index <HASH>..<HASH> 100644
--- a/src/components/DatePicker/index.js
+++ b/src/components/DatePicker/index.js
@@ -165,13 +165,11 @@ class DatePickerComponent extends Component {
}
}
-function DatePicker({ locale, ...rest }) {
- return (
- <Consumer>
- {values => <DatePickerComponent locale={getLocale(values, locale)} {...rest} />}
- </Consumer>
- );
-}
+const DatePicker = React.forwardRef(({ locale, ...rest }, ref) => (
+ <Consumer>
+ {values => <DatePickerComponent ref={ref} locale={getLocale(values, locale)} {...rest} />}
+ </Consumer>
+));
DatePicker.propTypes = {
/** Sets the date for the DatePicker programmatically. */ | fix: warning 'Function components cannot be given refs' on DatePicker component (#<I>) | 90milesbridge_react-rainbow | train | js |
7639b639f43f7ad103bc80894467ef822f3ed8d4 | diff --git a/salt/pillar/git_pillar.py b/salt/pillar/git_pillar.py
index <HASH>..<HASH> 100644
--- a/salt/pillar/git_pillar.py
+++ b/salt/pillar/git_pillar.py
@@ -124,15 +124,15 @@ def init(branch, repo_location):
def update(branch, repo_location):
'''
- Execute a git pull on all of the repos
+ Enxure you are on the right branch, and execute a git pull
'''
pid = os.getpid()
repo = init(branch, repo_location)
- origin = repo.remotes[0]
+ repo.git.checkout(branch)
lk_fn = os.path.join(repo.working_dir, 'update.lk')
with open(lk_fn, 'w+') as fp_:
fp_.write(str(pid))
- origin.fetch()
+ repo.git.pull()
try:
os.remove(lk_fn)
except (OSError, IOError):
@@ -188,10 +188,6 @@ def ext_pillar(pillar, repo_string):
if __opts__['pillar_roots'][branch_env] == [repo.working_dir]:
return {}
- git_ = repo.git
-
- git_.checkout(branch)
-
opts = deepcopy(__opts__)
opts['pillar_roots'][branch_env] = [repo.working_dir] | Fixing update of repo, it was updating the .git directory, but not the filesystem that is used for the pillar data | saltstack_salt | train | py |
48de210169d469dd803af8372e19f6faa19bb8e0 | diff --git a/oauth2/__init__.py b/oauth2/__init__.py
index <HASH>..<HASH> 100644
--- a/oauth2/__init__.py
+++ b/oauth2/__init__.py
@@ -99,7 +99,7 @@ from oauth2.web import Request, Response
from oauth2.tokengenerator import Uuid4
from oauth2.grant import Scope
-VERSION = "0.5.0"
+VERSION = "0.6.0"
class Provider(object):
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
from setuptools import setup
-VERSION = "0.5.0"
+VERSION = "0.6.0"
setup(name="python-oauth2",
version=VERSION, | Bumping version to <I> | wndhydrnt_python-oauth2 | train | py,py |
3ae150d65c577d94fdefe41f6d5588d8ae5c490f | diff --git a/collatex-pythonport/collatex/collatex_core.py b/collatex-pythonport/collatex/collatex_core.py
index <HASH>..<HASH> 100644
--- a/collatex-pythonport/collatex/collatex_core.py
+++ b/collatex-pythonport/collatex/collatex_core.py
@@ -11,6 +11,7 @@ import networkx as nx
from _collections import deque
from networkx.algorithms.dag import topological_sort
from prettytable import PrettyTable
+from textwrap import wrap, fill
class Row(object):
@@ -73,7 +74,7 @@ class AlignmentTable(object):
self.rows.append(row)
for column in self.columns:
if sigil in column.tokens_per_witness:
- row.append(column.tokens_per_witness[sigil])
+ row.append(fill(column.tokens_per_witness[sigil], 20))
else:
row.append("-")
@@ -81,6 +82,7 @@ class AlignmentTable(object):
def print_plain_text(self):
# print the table vertically
x = PrettyTable()
+ x.hrules=1
for row in self.rows:
x.add_column("blah", row.cells)
print(x) | Added horizal rulers between rows of the table. Added wrapping of the
text segments in the cells. | interedition_collatex | train | py |
5da48296ea50090cd450baaf86cefe4306885cb4 | diff --git a/shared/tracker/index.desktop.js b/shared/tracker/index.desktop.js
index <HASH>..<HASH> 100644
--- a/shared/tracker/index.desktop.js
+++ b/shared/tracker/index.desktop.js
@@ -109,6 +109,7 @@ export default class TrackerRender extends PureComponent<RenderProps> {
>
{this.props.showTeam &&
this.props.showTeam.fqName === team.fqName &&
+ this.props.selectedTeamRect &&
<Box key={team.fqName + 'popup'} style={{zIndex: 50}}>
<ModalPopupComponent
{...this.props} | Fix tracker popup jank (#<I>) | keybase_client | train | js |
4716b5cfa07dc483d0308689b3acbb2fb05b18ae | diff --git a/Doctrineum/Tests/SelfRegisteringType/AbstractSelfRegisteringTypeTest.php b/Doctrineum/Tests/SelfRegisteringType/AbstractSelfRegisteringTypeTest.php
index <HASH>..<HASH> 100644
--- a/Doctrineum/Tests/SelfRegisteringType/AbstractSelfRegisteringTypeTest.php
+++ b/Doctrineum/Tests/SelfRegisteringType/AbstractSelfRegisteringTypeTest.php
@@ -15,6 +15,9 @@ abstract class AbstractSelfRegisteringTypeTest extends TestWithMockery
public function I_can_register_it()
{
$typeClass = $this->getTypeClass();
+ /** @var Type $instance */
+ $instance = (new \ReflectionClass($typeClass))->newInstanceWithoutConstructor();
+ self::assertSame($this->getExpectedTypeName(), $instance->getName(), 'Expected different name of the type');
$typeClass::registerSelf();
self::assertTrue(
Type::hasType($this->getExpectedTypeName()), | Test of self registering type is more clear about problem with self registration | doctrineum_doctrineum-self-registering-type | train | php |
81d735988858e579beacc4826cbb129f9b57fee9 | diff --git a/src/view.js b/src/view.js
index <HASH>..<HASH> 100644
--- a/src/view.js
+++ b/src/view.js
@@ -24,7 +24,9 @@ export default function view (Comp) {
scheduler: () => setState({}),
lazy: true
}),
- []
+ // Adding the original Comp here is necessary to make React Hot Reload work
+ // it does not affect behavior otherwise
+ [Comp]
)
// cleanup the reactive connections after the very last render of the component | fix behavior with react hot reload | solkimicreb_react-easy-state | train | js |
5dff48b9dc8ac24a3c0f11495ce856f169b3a996 | diff --git a/devices.js b/devices.js
index <HASH>..<HASH> 100644
--- a/devices.js
+++ b/devices.js
@@ -229,7 +229,7 @@ const devices = [
description: 'MiJia door & window contact sensor',
supports: 'contact',
fromZigbee: [
- fz.xiaomi_battery_3v, fz.xiaomi_contact, fz.xiaomi_contact_interval, fz.ignore_onoff_change,
+ fz.xiaomi_battery_3v, fz.xiaomi_contact, fz.ignore_onoff_change,
fz.ignore_basic_change,
],
toZigbee: [], | Fixes issue #<I> (#<I>) | Koenkk_zigbee-shepherd-converters | train | js |
213f3f68664b5b32584b1a059526c1e06f6dfd55 | diff --git a/tests/PHPUnit/Integration/HttpTest.php b/tests/PHPUnit/Integration/HttpTest.php
index <HASH>..<HASH> 100644
--- a/tests/PHPUnit/Integration/HttpTest.php
+++ b/tests/PHPUnit/Integration/HttpTest.php
@@ -128,7 +128,7 @@ class HttpTest extends \PHPUnit_Framework_TestCase
/**
* @expectedException \Exception
- * @expectedExceptionMessage curl_exec: SSL certificate problem: Invalid certificate chain.
+ * @expectedExceptionMessage curl_exec: SSL certificate
*/
public function testCurlHttpsFailsWithInvalidCertificate()
{ | Looser assertion in tests to pass on Travis | matomo-org_matomo | train | php |
90b3f8cedbf97162d1d1f215a88cb4c07e672aaa | diff --git a/gutter/client/models.py b/gutter/client/models.py
index <HASH>..<HASH> 100644
--- a/gutter/client/models.py
+++ b/gutter/client/models.py
@@ -310,6 +310,7 @@ class Manager(threading.local):
def __getstate__(self):
inner_dict = vars(self).copy()
+ inner_dict.pop('inputs', False)
inner_dict.pop('storage', False)
return inner_dict
diff --git a/tests/test_integration.py b/tests/test_integration.py
index <HASH>..<HASH> 100644
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -367,4 +367,18 @@ class TestIntegrationWithRedis(TestIntegration):
@fixture
def manager(self):
- return Manager(storage=RedisDict('gutter-tests', self.redis))
\ No newline at end of file
+ return Manager(storage=RedisDict('gutter-tests', self.redis))
+
+ def test_parent_switch_pickle_input(self):
+ import pickle
+
+ # Passing in module `pickle` as unpicklable input.
+ evil = User(deterministicstring('evil'), pickle)
+ self.manager.input(evil)
+
+ self.manager.autocreate = True
+
+ try:
+ self.manager.active('new:switch')
+ except pickle.PicklingError, e:
+ self.fail('Encountered pickling error: "%s"' % e) | Fixed issue where global inputs could get cached for parent switches.
This is a workaround for a bug where an input could be unpicklable, and
auto-creating switches would fail when the manager has an unpicklable
input.
The underlying issue (which still exists) is that Manager.register handles
unsetting Switch.manager before persisting except it does not take into
account parent switches having managers attached still. | disqus_gutter | train | py,py |
cde51e333a80868f0da61a5646d4c3ddcdbc7490 | diff --git a/TYPO3.Flow/Classes/AOP/F3_FLOW3_AOP_EmptyMethodInterceptorBuilder.php b/TYPO3.Flow/Classes/AOP/F3_FLOW3_AOP_EmptyMethodInterceptorBuilder.php
index <HASH>..<HASH> 100644
--- a/TYPO3.Flow/Classes/AOP/F3_FLOW3_AOP_EmptyMethodInterceptorBuilder.php
+++ b/TYPO3.Flow/Classes/AOP/F3_FLOW3_AOP_EmptyMethodInterceptorBuilder.php
@@ -29,9 +29,8 @@ namespace F3\FLOW3\AOP;
*/
/**
- * A AOP method interceptor code builder which generates an empty method as used
- * for introductions without advices delivering the implementation of the introduced
- * method.
+ * A AOP method interceptor code builder which generates an empty method as used for
+ * introductions without advices delivering the implementation of the introduced method.
*
* @package FLOW3
* @subpackage AOP | FLOW3:
* weirdest bugfix I ever did in PHP - yes, this comment reformat actually makes a bus error go away.
Original-Commit-Hash: <I>ab8c<I>ba<I>e6dff7ef<I>da<I>d<I>c5f7db8 | neos_flow-development-collection | train | php |
6dfeb27cf36a96d9d09f28d5511ff15abe9512b9 | diff --git a/bcbio/variation/strelka2.py b/bcbio/variation/strelka2.py
index <HASH>..<HASH> 100644
--- a/bcbio/variation/strelka2.py
+++ b/bcbio/variation/strelka2.py
@@ -188,8 +188,9 @@ def _af_annotate_and_filter(paired, items, in_file, out_file):
else: # germline?
alt_counts = rec.format('AD')[:,1:] # AD=REF,ALT1,ALT2,...
dp = np.sum(rec.format('AD')[:,0:], axis=1)
- assert np.all(dp > 0), rec
- af = np.true_divide(alt_counts, dp)
+ with np.errstate(divide='ignore', invalid='ignore'): # ignore division by zero and put AF=.0
+ af = np.true_divide(alt_counts, dp)
+ af[~np.isfinite(af)] = .0 # -inf inf NaN -> .0
rec.set_format('AF', af)
if np.any(af[tumor_index] < min_freq):
vcfutils.cyvcf_add_filter(rec, 'MinAF') | Strelka2 AF calc: silent div by zero and replace AF=inf with AF=<I> | bcbio_bcbio-nextgen | train | py |
0ebdbb26750fb4a6f026c4047754e0bcd99ea7ef | diff --git a/github/__init__.py b/github/__init__.py
index <HASH>..<HASH> 100644
--- a/github/__init__.py
+++ b/github/__init__.py
@@ -46,6 +46,7 @@ from .GithubException import ( # type: ignore
BadCredentialsException,
BadUserAgentException,
GithubException,
+ IncompletableObject,
RateLimitExceededException,
TwoFactorException,
UnknownObjectException,
@@ -73,6 +74,7 @@ __all__ = [
Github,
GithubException,
GithubIntegration,
+ IncompletableObject,
InputFileContent,
InputGitAuthor,
InputGitTreeElement,
diff --git a/tests/Exceptions.py b/tests/Exceptions.py
index <HASH>..<HASH> 100644
--- a/tests/Exceptions.py
+++ b/tests/Exceptions.py
@@ -34,7 +34,6 @@
import pickle
import github
-from github.GithubException import IncompletableObject
from . import Framework
@@ -142,4 +141,4 @@ class SpecificExceptions(Framework.TestCase):
def testIncompletableObject(self):
github.UserKey.UserKey.setCheckAfterInitFlag(False)
obj = github.UserKey.UserKey(None, {}, {}, False)
- self.assertRaises(IncompletableObject, obj._completeIfNeeded)
+ self.assertRaises(github.IncompletableObject, obj._completeIfNeeded) | Export IncompletableObject in the github namespace (#<I>)
When IncompletableObject was added, it was only added to
GithubException, and not imported directly into the github namespace
like other exceptions. Correct that, and clean up the resultant now
unrequired import. | PyGithub_PyGithub | train | py,py |
aed75890e90b73ce705f55dbd1eb601e3729fa68 | diff --git a/templates/zebra/index.js b/templates/zebra/index.js
index <HASH>..<HASH> 100644
--- a/templates/zebra/index.js
+++ b/templates/zebra/index.js
@@ -10,6 +10,7 @@
module.exports = (template, modules) => {
// modules: _, Promise, fs, dust, HtmlParser, utils
+ // const { _ } = modules;
const helper = require('./helper')(template, modules);
@@ -25,10 +26,10 @@ module.exports = (template, modules) => {
outline: 'tree', // "flat" | "tree"
collapsed: false,
toolbar: true,
- folded: false,
+ itemsFolded: false,
+ itemsOverflow: 'crop', // "crop" | "shrink"
badges: true, // true | false | <string>
search: true,
- fitItems: 'crop', // "crop" | "shrink"
animations: true
},
symbols: {
@@ -43,6 +44,7 @@ module.exports = (template, modules) => {
},
navbar: {
enabled: true,
+ dark: false,
animations: true,
menu: []
}
@@ -63,6 +65,7 @@ module.exports = (template, modules) => {
helper.setTitle();
helper.setDarkLightLogos();
+ helper.configNavMenu();
});
template.postBuild(() => { | refactor itemsOverflow, itemsFolded | onury_docma | train | js |
99778bb3edb1c6708416fe07e9e85a07bf6a59cc | diff --git a/app/templates/src/main/java/package/config/audit/_AuditEventConverter.java b/app/templates/src/main/java/package/config/audit/_AuditEventConverter.java
index <HASH>..<HASH> 100644
--- a/app/templates/src/main/java/package/config/audit/_AuditEventConverter.java
+++ b/app/templates/src/main/java/package/config/audit/_AuditEventConverter.java
@@ -2,12 +2,12 @@ package <%=packageName%>.config.audit;
import <%=packageName%>.domain.PersistentAuditEvent;
import org.springframework.boot.actuate.audit.AuditEvent;
-import org.springframework.context.annotation.Configuration;
import org.springframework.security.web.authentication.WebAuthenticationDetails;
+import org.springframework.stereotype.Component;
import java.util.*;
-@Configuration
+@Component
public class AuditEventConverter {
/** | Refactored the AuditEventConverter to a Spring bean
Fix #<I> | jhipster_generator-jhipster | train | java |
c8a10b0db6e97b18b8cc71b3bf68b72e57708d13 | diff --git a/src/test/java/common/VersionTest.java b/src/test/java/common/VersionTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/common/VersionTest.java
+++ b/src/test/java/common/VersionTest.java
@@ -31,6 +31,20 @@ public class VersionTest {
assert oldVersion.compareTo(newVersion) == -1;
assert newVersion.compareTo(oldVersion) == 1;
}
+
+ @Test
+ public void compareSnapshotVersionWithTimestampTest(){
+ String olderVersionString = "0.0.1-SNAPSHOT";
+ String oldTimestamp = "20160401";
+ String newerVersionString = "0.0.1-SNAPSHOT";
+ String newTimestamp = "20160402";
+ Version oldVersion = new Version(olderVersionString);
+ oldVersion.setTimestamp(oldTimestamp);
+ Version newVersion = new Version(newerVersionString);
+ newVersion.setTimestamp(newTimestamp);
+ assert oldVersion.compareTo(newVersion) == -1;
+ assert newVersion.compareTo(oldVersion) == 1;
+ }
@Test
public void compareEqualReleaseVersionTest() { | Added compareSnapshotVersionWithTimestampTest | vatbub_common | train | java |
4cfaeb89fcb189bc9563a59eb72ec3f7e6231bc0 | diff --git a/tasklib/task.py b/tasklib/task.py
index <HASH>..<HASH> 100644
--- a/tasklib/task.py
+++ b/tasklib/task.py
@@ -99,6 +99,15 @@ class SerializingObject(object):
def deserialize_wait(self, value):
return self.timestamp_deserializer(value)
+ def serialize_annotations(self, value):
+ value = value if value is not None else []
+ serialized_annotations = [annotation.export_data() for annotation in value]
+
+ if serialized_annotations:
+ return '[' + ','.join(serialized_annotations) + ']'
+ else:
+ return ''
+
def deserialize_annotations(self, data):
return [TaskAnnotation(self, d) for d in data] if data else [] | SerializingObject: Add missing serialize_annotations method | robgolding_tasklib | train | py |
c466eb2d271fc7431cc22b948418bfc6774d8b29 | diff --git a/lib/handlers/bin.js b/lib/handlers/bin.js
index <HASH>..<HASH> 100644
--- a/lib/handlers/bin.js
+++ b/lib/handlers/bin.js
@@ -25,7 +25,8 @@ module.exports = Observable.extend({
this.renderFiles(req, res);
},
getCustom: function (req, res, next) {
- var overrides = custom[req.subdomain].defaults,
+ var config = custom[req.subdomain],
+ overrides = config.defaults,
_this = this;
this.loadFiles(this.defaultFiles(), req.helpers, function (err, defaults) {
@@ -38,7 +39,7 @@ module.exports = Observable.extend({
defaults[key] = overrides[key];
}
}
- _this.render(req, res, defaults);
+ _this.render(req, res, defaults, config.settings);
});
},
getBin: function (req, res, next) { | Allow a custom settings property to be set on the jsbin object | jsbin_jsbin | train | js |
a53531162cddfc35fd603ce6f2bf95267652af0c | diff --git a/src/Kernel/Support/Str.php b/src/Kernel/Support/Str.php
index <HASH>..<HASH> 100644
--- a/src/Kernel/Support/Str.php
+++ b/src/Kernel/Support/Str.php
@@ -89,6 +89,7 @@ class Str
* @throws RuntimeException
*
* @codeCoverageIgnore
+ *
* @throws \Exception
*/
public static function randomBytes($length = 16) | Apply fixes from StyleCI (#<I>)
[ci skip] [skip ci] | overtrue_wechat | train | php |
5beb220fcf5fdb301016f06aec82269320d65e87 | diff --git a/src/SALib/analyze/hdmr.py b/src/SALib/analyze/hdmr.py
index <HASH>..<HASH> 100644
--- a/src/SALib/analyze/hdmr.py
+++ b/src/SALib/analyze/hdmr.py
@@ -496,7 +496,7 @@ def f_test(Y, f0, Y_em, R, alpha, m1, m2, m3, n1, n2, n3, n):
# Number of parameters of proposed model (order dependent)
if i <= n1:
p1 = m1 # 1st order
- elif n1 < i <= n1 + n2:
+ elif n1 < i <= (n1 + n2):
p1 = m2 # 2nd order
else:
p1 = m3 # 3rd order | add brackets for n1 + n2 | SALib_SALib | train | py |
d0408b148f9c142e7176866657a768025a47a61c | diff --git a/Consoloid/OS/File/RemoteClientFile.js b/Consoloid/OS/File/RemoteClientFile.js
index <HASH>..<HASH> 100644
--- a/Consoloid/OS/File/RemoteClientFile.js
+++ b/Consoloid/OS/File/RemoteClientFile.js
@@ -42,7 +42,6 @@ defineClass('Consoloid.OS.File.RemoteClientFile', 'Consoloid.OS.File.FileInterfa
__retrivedFileInfos: function(fileInfos, id, callback)
{
if (!(id in fileInfos)) {
- console.log("ITT", id, fileInfos)
callback("Unknown file");
return;
} | Removed random console.log from RemoteClientFile | agmen-hu_consoloid-os | train | js |
aaf4638585dfcc81f8a4a86a23f605766cea361f | diff --git a/lib/runtime/procs/base.js b/lib/runtime/procs/base.js
index <HASH>..<HASH> 100644
--- a/lib/runtime/procs/base.js
+++ b/lib/runtime/procs/base.js
@@ -28,7 +28,7 @@ var base = Base.extend({
this.stats = {points_in: 0, points_out: 0};
this.last_used_output = DEFAULT_OUT_NAME;
job_id = this.program.id ? '-' + this.program.id : '';
- this.logger_name = 'juttle-procs ' + this.procName + job_id;
+ this.logger_name = 'proc-' + this.procName + job_id;
this.logger = JuttleLogger.getLogger(this.logger_name);
}, | procs: tweak the logger path for the base proc | juttle_juttle | train | js |
b20f5e61463ad80fcdebe9e6395162b6bcd7487b | diff --git a/ndbench-core/src/main/java/com/netflix/ndbench/core/config/IConfiguration.java b/ndbench-core/src/main/java/com/netflix/ndbench/core/config/IConfiguration.java
index <HASH>..<HASH> 100644
--- a/ndbench-core/src/main/java/com/netflix/ndbench/core/config/IConfiguration.java
+++ b/ndbench-core/src/main/java/com/netflix/ndbench/core/config/IConfiguration.java
@@ -119,7 +119,7 @@ public interface IConfiguration {
* grows larger than 1% auto tune triggered rate increases will cease.
*
*/
- @DefaultValue("0.01F")
+ @DefaultValue("0.01")
Float getAutoTuneWriteFailureRatioThreshold();
} | take off "F" from floating pnt constant for fast prop | Netflix_ndbench | train | java |
920b30f4b880756bc25751fb628baf6530f11b57 | diff --git a/drop_sync.rb b/drop_sync.rb
index <HASH>..<HASH> 100755
--- a/drop_sync.rb
+++ b/drop_sync.rb
@@ -1,7 +1,4 @@
require File.expand_path('../dropbox-sdk-ruby-1.6.4/lib/dropbox_sdk', __FILE__)
-require 'pp'
-require 'shellwords'
-require 'open-uri'
class DropSync | Removes unnecessary requires/imports | FrankKair_DropSync | train | rb |
84068757767cc793d26c00ddfad17701a75dcecc | diff --git a/tensorboard/plugins/debugger_v2/debugger_v2_plugin_test.py b/tensorboard/plugins/debugger_v2/debugger_v2_plugin_test.py
index <HASH>..<HASH> 100644
--- a/tensorboard/plugins/debugger_v2/debugger_v2_plugin_test.py
+++ b/tensorboard/plugins/debugger_v2/debugger_v2_plugin_test.py
@@ -57,6 +57,7 @@ def _generate_tfdbg_v2_data(
logarithm_times: Optionally take logarithm of the final `x` file _ times
iteratively, in order to produce nans.
"""
+ x = tf.constant([1, 3, 3, 7], dtype=tf.float32)
writer = tf.debugging.experimental.enable_dump_debug_info(
logdir, circular_buffer_size=-1, tensor_debug_mode=tensor_debug_mode
)
@@ -81,7 +82,6 @@ def _generate_tfdbg_v2_data(
times = tf.constant(3, dtype=tf.int32)
return repeated_add(unstack_and_sum(x), times)
- x = tf.constant([1, 3, 3, 7], dtype=tf.float32)
for i in range(3):
assert my_function(x).numpy() == 42.0 | Move constant creation in debugger_v2_plugin_test (#<I>)
Prepares for a TensorFlow change which will make `tf.constant` run an op, which would otherwise have upset the assertions in this test.
Specifically, it moves the `tf.constant` declaration before `enable_dump_debug_info` which alters
internal behavior of TensorFlow. | tensorflow_tensorboard | train | py |
c0c5f4c81c2e6f992c47bfb813fe6526d9fd1833 | diff --git a/dblock.go b/dblock.go
index <HASH>..<HASH> 100644
--- a/dblock.go
+++ b/dblock.go
@@ -97,6 +97,7 @@ func GetDBlock(keymr string) (dblock *DBlock, raw []byte, err error) {
// TODO: we need a better api call for dblock by keymr so that API will
// retrun the same as dblock-byheight
+ fmt.Println("SequenceNumber: ", db.Header.SequenceNumber)
return GetDBlockByHeight(db.Header.SequenceNumber)
} | added sequence number back to get head call | FactomProject_factom | train | go |
77434df4d92d9597d1af828cebba3d18bac2486b | diff --git a/Sockets/Socket.php b/Sockets/Socket.php
index <HASH>..<HASH> 100644
--- a/Sockets/Socket.php
+++ b/Sockets/Socket.php
@@ -33,6 +33,11 @@ class Socket
}
}
+ public function getResource()
+ {
+ return $this->resource;
+ }
+
public function poll()
{
if ($this->selectRead()) { | Additional helper to access raw socket resource | clue_php-socket-react | train | php |
Subsets and Splits