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
cb3b76ef8187d7550857dd75095055c9c980000d
diff --git a/tests/test_api.py b/tests/test_api.py index <HASH>..<HASH> 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -4,6 +4,8 @@ from unittest import TestCase +import gevent.hub + from mock import mock_open, patch from paramiko import ( PasswordRequiredException, @@ -32,6 +34,9 @@ from .paramiko_util import ( FakeSSHClient, ) +# Don't print out exceptions inside greenlets (because here we expect them!) +gevent.hub.Hub.NOT_ERROR = (Exception,) + def make_inventory(hosts=('somehost', 'anotherhost'), **kwargs): return Inventory( @@ -117,10 +122,6 @@ class TestSSHApi(TestCase): self.assertEqual(len(state.active_hosts), 2) def test_connect_all_password(self): - ''' - Ensure we can connect using a password. - ''' - inventory = make_inventory(ssh_password='test') # Get a host
Don't print greenlet exceptions during the API tests.
Fizzadar_pyinfra
train
py
c56e8453aff7126bf0fee88822b4a96083b91ae8
diff --git a/pyprophet/main.py b/pyprophet/main.py index <HASH>..<HASH> 100644 --- a/pyprophet/main.py +++ b/pyprophet/main.py @@ -11,7 +11,7 @@ except: from pyprophet import PyProphet from config import standard_config, fix_config_types -import sys +import sys, time def print_help(): print @@ -103,9 +103,12 @@ def main(): print return + start_at = time.time() summ_stat, final_stat, scored_table = PyProphet().process_csv(path, delim_in, config) + needed = time.time() - start_at + print print "="*78 print @@ -121,3 +124,17 @@ def main(): scored_table.to_csv(scored_table_path, sep=delim_out) print "WRITTEN: ", scored_table_path print + + seconds = int(needed) + msecs = int(1000*(needed-seconds)) + minutes = int(needed/60.0) + + print "NEEDED", + if minutes: + print minutes, "minutes and", + + print "%d seconds and %d msecs wall time" % (seconds, msecs) + print + + +
[FEATURE] output needed wall time
PyProphet_pyprophet
train
py
ce4f97ee4a3a18e4b39b1e6eab8b882e43a99eda
diff --git a/src/org/selfip/bkimmel/util/ClassUtil.java b/src/org/selfip/bkimmel/util/ClassUtil.java index <HASH>..<HASH> 100644 --- a/src/org/selfip/bkimmel/util/ClassUtil.java +++ b/src/org/selfip/bkimmel/util/ClassUtil.java @@ -26,7 +26,7 @@ public final class ClassUtil { * bytecode definition may be read. */ public static InputStream getClassAsStream(Class<?> cl) { - String resourceName = cl.getName() + ".class"; + String resourceName = cl.getSimpleName() + ".class"; return cl.getResourceAsStream(resourceName); }
Bug fix: full class name needed to get class definition resource.
bwkimmel_java-util
train
java
e1f0fb9b2dcb442e88c11b5155271b106beaa57d
diff --git a/lib/bigfloat/binfloat.rb b/lib/bigfloat/binfloat.rb index <HASH>..<HASH> 100644 --- a/lib/bigfloat/binfloat.rb +++ b/lib/bigfloat/binfloat.rb @@ -36,9 +36,28 @@ class BinFloat < Num super(BinFloat, *options) end - end + # The special values are normalized for binary floats: this keeps the context precision in the values + # which will be used in conversion to decimal text to yield more natural results. + + # Normalized epsilon; see Num::Context.epsilon() + def epsilon(sign=+1) + super.normalize + end + + # Normalized strict epsilon; see Num::Context.epsilon() + def strict_epsilon(sign=+1) + super.normalize + end + + # Normalized strict epsilon; see Num::Context.epsilon() + def half_epsilon(sign=+1) + super.normalize - class <<self + end + + end # BinFloat::Context + + class <<self # BinFloat class methods def base_coercible_types unless defined? @base_coercible_types @@ -67,6 +86,7 @@ class BinFloat < Num end @base_coercible_types end + end # the DefaultContext is the base for new contexts; it can be changed. @@ -248,6 +268,11 @@ class BinFloat < Num BinFloat(x.to_s, binfloat_context) end + # For BinFloat the generic Num#ulp() is normalized + def ulp(context=nil, mode=:low) + super(context, mode).normalize(context) + end + private # Convert to a text literal in the specified base. If the result is
BinFloat epsilons and ulps are normalized now.
jgoizueta_flt
train
rb
cf54e340cfddc1d32a0d6fa3eef7006a9210a35d
diff --git a/js/forms.js b/js/forms.js index <HASH>..<HASH> 100644 --- a/js/forms.js +++ b/js/forms.js @@ -144,14 +144,31 @@ hiddenDiv.css('width', $(window).width()/2); } - $textarea.css('height', hiddenDiv.height()); + /** + * Resize if the new height is greater than the + * original height of the textarea + */ + if($textarea.data("original-height") <= hiddenDiv.height()){ + $textarea.css('height', hiddenDiv.height()); + }else if($textarea.val().length < $textarea.data("previous-length")){ + /** + * In case the new height is less than original height, it + * means the textarea has less text than before + * So we set the height to the original one + */ + $textarea.css('height', $textarea.data("original-height")); + } + $textarea.data("previous-length", $textarea.val().length); } $(text_area_selector).each(function () { var $textarea = $(this); - if ($textarea.val().length) { - textareaAutoResize($textarea); - } + /** + * Instead of resizing textarea on document load, + * store the original height and the original length + */ + $textarea.data("original-height", $textarea.height()); + $textarea.data("previous-length", $textarea.val().length); }); $('body').on('keyup keydown autoresize', text_area_selector, function () {
Fixed Textarea Resizing Bug Instead of setting the height of textarea default on document load, MZ should store the height and then resize textarea according to the length and the original height of the textarea.
Dogfalo_materialize
train
js
6b57a693ce751cd14880eac2d578169d878a405e
diff --git a/pandas/tests/extension/base/casting.py b/pandas/tests/extension/base/casting.py index <HASH>..<HASH> 100644 --- a/pandas/tests/extension/base/casting.py +++ b/pandas/tests/extension/base/casting.py @@ -1,6 +1,8 @@ import numpy as np import pytest +import pandas.util._test_decorators as td + import pandas as pd from pandas.core.internals import ObjectBlock from pandas.tests.extension.base.base import BaseExtensionTests @@ -43,8 +45,19 @@ class BaseCastingTests(BaseExtensionTests): expected = pd.Series([str(x) for x in data[:5]], dtype=str) self.assert_series_equal(result, expected) + @pytest.mark.parametrize( + "nullable_string_dtype", + [ + "string", + pytest.param( + "arrow_string", marks=td.skip_if_no("pyarrow", min_version="1.0.0") + ), + ], + ) def test_astype_string(self, data, nullable_string_dtype): # GH-33465 + from pandas.core.arrays.string_arrow import ArrowStringDtype # noqa: F401 + result = pd.Series(data[:5]).astype(nullable_string_dtype) expected = pd.Series([str(x) for x in data[:5]], dtype=nullable_string_dtype) self.assert_series_equal(result, expected)
TST: fix casting extension tests for external users (#<I>)
pandas-dev_pandas
train
py
e7d99c37b3e02f07308d60cf13f933c3d57c0c29
diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index <HASH>..<HASH> 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -196,8 +196,7 @@ EOT } $locker = $composer->getLocker(); $lockedRepo = $locker->getLockedRepository(true); - $installedRepo = new InstalledRepository(array($lockedRepo)); - $repos = new CompositeRepository(array_merge(array($installedRepo), $composer->getRepositoryManager()->getRepositories())); + $repos = $installedRepo = new InstalledRepository(array($lockedRepo)); } else { // --installed / default case if (!$composer) { @@ -349,7 +348,7 @@ EOT foreach ($repos as $repo) { if ($repo === $platformRepo) { $type = 'platform'; - } elseif($lockedRepo !== null && $repo === $lockedRepo) { + } elseif ($lockedRepo !== null && $repo === $lockedRepo) { $type = 'locked'; } elseif ($repo === $installedRepo || in_array($repo, $installedRepo->getRepositories(), true)) { $type = 'installed';
Fix show --locked to avoid listing all the things
composer_composer
train
php
c39158d48ca60f99d1274152b53d2f4fa7b4e5b8
diff --git a/docs/storage/driver/rados/rados.go b/docs/storage/driver/rados/rados.go index <HASH>..<HASH> 100644 --- a/docs/storage/driver/rados/rados.go +++ b/docs/storage/driver/rados/rados.go @@ -404,7 +404,7 @@ func (d *driver) List(ctx context.Context, dirPath string) ([]string, error) { files, err := d.listDirectoryOid(dirPath) if err != nil { - return nil, err + return nil, storagedriver.PathNotFoundError{Path: dirPath} } keys := make([]string, 0, len(files))
driver/rados: treat OMAP EIO as a PathNotFoundError RADOS returns a -EIO when trying to read a non-existing OMAP, treat it as a PathNotFoundError when trying to list a non existing virtual directory.
docker_distribution
train
go
72694df04d704d191c6e1be82b9307365f2a59ef
diff --git a/sling/core/console/src/main/resources/root/libs/composum/nodes/console/browser/js/browser.js b/sling/core/console/src/main/resources/root/libs/composum/nodes/console/browser/js/browser.js index <HASH>..<HASH> 100644 --- a/sling/core/console/src/main/resources/root/libs/composum/nodes/console/browser/js/browser.js +++ b/sling/core/console/src/main/resources/root/libs/composum/nodes/console/browser/js/browser.js @@ -97,7 +97,7 @@ copy: false, check_while_dragging: false, drag_selection: false, - touch: 'selection', + touch: false, //'selection', large_drag_target: true, large_drop_target: true, use_html5: false
fix for the scroll issue (tree) on touch devices
ist-dresden_composum
train
js
c5b97671f53a101a23e3fad0e116c8ad531a7698
diff --git a/osc/osc_test.go b/osc/osc_test.go index <HASH>..<HASH> 100644 --- a/osc/osc_test.go +++ b/osc/osc_test.go @@ -362,7 +362,7 @@ func TestWritePaddedString(t *testing.T) { if got, want := n, tt.n; got != want { t.Errorf("%s: Count of bytes written don't match; got = %d, want = %d", tt.s, got, want) } - if got, want := bytesBuffer, tt.buf; bytes.Equal(got, want) { + if got, want := bytesBuffer, tt.buf; bytes.Equal(got.Bytes(), want) { t.Errorf("%s: Buffers don't match; got = %s, want = %s", tt.s, got.Bytes(), want) } }
Fix the type of an argument to equal
hypebeast_go-osc
train
go
0ac17bb54b31019f50e42a3809e0ffdb33d814e3
diff --git a/oscrypto/trust_list.py b/oscrypto/trust_list.py index <HASH>..<HASH> 100644 --- a/oscrypto/trust_list.py +++ b/oscrypto/trust_list.py @@ -130,6 +130,8 @@ def get_path(temp_dir=None, cache_length=24, cert_callback=None): if cert_callback: cert_callback(Certificate.load(cert), 'explicitly distrusted for TLS') continue + if cert_callback: + cert_callback(Certificate.load(cert), None) f.write(armor('CERTIFICATE', cert)) if not ca_path:
Fix regression in trust_list.get_path() not calling the cert callback when a certificate is exported
wbond_oscrypto
train
py
7ec39ccc23ad80d272a6e82d7db68d290500bf51
diff --git a/troposphere/ec2.py b/troposphere/ec2.py index <HASH>..<HASH> 100644 --- a/troposphere/ec2.py +++ b/troposphere/ec2.py @@ -464,9 +464,9 @@ class Volume(AWSObject): 'AutoEnableIO': (boolean, False), 'AvailabilityZone': (basestring, True), 'Encrypted': (boolean, False), - 'Iops': (integer, False), + 'Iops': (positive_integer, False), 'KmsKeyId': (basestring, False), - 'Size': (basestring, False), + 'Size': (positive_integer, False), 'SnapshotId': (basestring, False), 'Tags': (list, False), 'VolumeType': (basestring, False),
Size/IOPS should be positive_integers (#<I>) This isn't <I>% correct, only because positive_integers allows for a value of 0, but changing that functionality seems like it'd break things elsewhere.
cloudtools_troposphere
train
py
0bdf48f37b0c6fc1d52c0bb215e7e52af0d6db10
diff --git a/spec/victor/svg_spec.rb b/spec/victor/svg_spec.rb index <HASH>..<HASH> 100644 --- a/spec/victor/svg_spec.rb +++ b/spec/victor/svg_spec.rb @@ -134,6 +134,17 @@ describe SVG do end expect(subject.content).to eq ["<universe>", "<world>", "<me />", "</world>", "</universe>"] end + + it "ignores the block's return value", :focus do + subject.build do + element :group do + element :one + element :two + element :three if false + end + end + expect(subject.content).to eq ["<group>", "<one />", "<two />", "</group>"] + end end context "with a plain text value" do
add specs to test the case broken by the element refactor
DannyBen_victor
train
rb
f59996b6676d572828bc0143fffb1dad4ca4ddc1
diff --git a/cell/executor_test.go b/cell/executor_test.go index <HASH>..<HASH> 100644 --- a/cell/executor_test.go +++ b/cell/executor_test.go @@ -16,6 +16,7 @@ import ( "github.com/cloudfoundry-incubator/inigo/helpers" "github.com/cloudfoundry-incubator/inigo/inigo_announcement_server" "github.com/cloudfoundry-incubator/receptor" + "github.com/cloudfoundry-incubator/rep" "github.com/cloudfoundry-incubator/runtime-schema/models" "github.com/cloudfoundry-incubator/runtime-schema/models/factories" . "github.com/onsi/ginkgo" @@ -178,11 +179,12 @@ var _ = Describe("Executor", func() { }).Should(HaveLen(1)) instanceGuid = actualLRPs[0].InstanceGuid + containerGuid := rep.LRPContainerGuid(processGuid, instanceGuid) executorClient := componentMaker.ExecutorClient() Eventually(func() executor.State { - container, err := executorClient.GetContainer(instanceGuid) + container, err := executorClient.GetContainer(containerGuid) if err == nil { return container.State }
Instance guid != container guid [#<I>]
cloudfoundry_inigo
train
go
fca7f3db624a579a05dc648818394742e091b5dd
diff --git a/lib/smalltalk.js b/lib/smalltalk.js index <HASH>..<HASH> 100644 --- a/lib/smalltalk.js +++ b/lib/smalltalk.js @@ -104,7 +104,7 @@ function showDialog(title, msg, value, buttons, options) { } function keyDown(dialog, ok, cancel) { - return event => { + return (event) => { const KEY = { ENTER : 13, ESC : 27, @@ -122,8 +122,6 @@ function keyDown(dialog, ok, cancel) { const names = find(dialog, namesAll) .map(getDataName); - let is; - switch(keyCode) { case KEY.ENTER: closeDialog(el, dialog, ok, cancel); @@ -144,12 +142,11 @@ function keyDown(dialog, ok, cancel) { break; default: - is = ['left', 'right', 'up', 'down'].some((name) => { + ['left', 'right', 'up', 'down'].filter((name) => { return keyCode === KEY[name.toUpperCase()]; - }); - - if (is) + }).forEach(() => { changeButtonFocus(dialog, names); + }); break; }
refactor(keydown) let, some -> filter
coderaiser_smalltalk
train
js
9fbfda89f08858d3362e035d1db0bb101af07e58
diff --git a/DependencyInjection/Compiler/EasyAdminFormTypePass.php b/DependencyInjection/Compiler/EasyAdminFormTypePass.php index <HASH>..<HASH> 100644 --- a/DependencyInjection/Compiler/EasyAdminFormTypePass.php +++ b/DependencyInjection/Compiler/EasyAdminFormTypePass.php @@ -34,5 +34,16 @@ class EasyAdminFormTypePass implements CompilerPassInterface $guesserChain = new Definition('Symfony\Component\Form\FormTypeGuesserChain', array($guessers)); $formTypeDefinition->replaceArgument(2, $guesserChain); + + if (!$this->isLegacySymfonyForm()) { + $formTypeDefinition->setTags(array('form.type' => array( + array('alias' => 'JavierEguiluz\\Bundle\\EasyAdminBundle\\Form\\Type\\EasyAdminFormType') + ))); + } + } + + private function isLegacySymfonyForm() + { + return false === method_exists('JavierEguiluz\Bundle\EasyAdminBundle\Form\Type\EasyAdminFormType', 'getBlockPrefix'); } }
I don't know what I'm doing
EasyCorp_EasyAdminBundle
train
php
cb52303c74a76bfaf8f3017b9be78f3620b00483
diff --git a/ovp_core/migrations/0004_load_skills_and_causes.py b/ovp_core/migrations/0004_load_skills_and_causes.py index <HASH>..<HASH> 100644 --- a/ovp_core/migrations/0004_load_skills_and_causes.py +++ b/ovp_core/migrations/0004_load_skills_and_causes.py @@ -20,7 +20,7 @@ def load_data(apps, schema_editor): c = Cause(name=cause) c.save() -def unload_data(apps, schema_editor): +def unload_data(apps, schema_editor): #pragma: no cover Skill = apps.get_model("ovp_core", "Skill") Cause = apps.get_model("ovp_core", "Cause")
Add pragma: no cover to migration data unload
OpenVolunteeringPlatform_django-ovp-core
train
py
a86fd29c41b9c0ead878fac7706d0d437860757f
diff --git a/go/vt/workflow/manager_test.go b/go/vt/workflow/manager_test.go index <HASH>..<HASH> 100644 --- a/go/vt/workflow/manager_test.go +++ b/go/vt/workflow/manager_test.go @@ -22,7 +22,8 @@ func startManager(t *testing.T, m *Manager) (*sync.WaitGroup, context.CancelFunc }() // Wait for the manager to start, by watching its ctx object. - for timeout := 0; ; timeout++ { + timeout := 0 + for { m.mu.Lock() running := m.ctx != nil m.mu.Unlock() @@ -96,7 +97,8 @@ func TestManagerRestart(t *testing.T) { wg, cancel = startManager(t, m) // Make sure the job is in there shortly. - for timeout := 0; ; timeout++ { + timeout := 0 + for { tree, err := m.NodeManager().GetFullTree() if err != nil { t.Fatalf("cannot get full node tree: %v", err)
Fixing timeouts in workflow tests. Although I don't see how that triggers the 'go test -race' timing out fater <I> minutes.
vitessio_vitess
train
go
6210f0da68fb5b528cf621c15342629cc0c27354
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -57,7 +57,7 @@ setup( version = __version__, packages = ['argh'], provides = ['argh'], - requires = ['python(>=2.5)', 'argparse(>=1.1)'], + requires = ['python(>=2.6)', 'argparse(>=1.1)'], install_requires = ['argparse>=1.1'], # for Python 2.6 (no bundled argparse; setuptools is likely to exist) # copyright
Update setup.py: support for Python ≤ <I> was dropped since Argh <I>
neithere_argh
train
py
ef8c793d7447b10660ccb7d579cb86f807269ca5
diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php index <HASH>..<HASH> 100644 --- a/grade/report/grader/lib.php +++ b/grade/report/grader/lib.php @@ -391,8 +391,7 @@ class grade_report_grader extends grade_report { list($enrolledsql, $enrolledparams) = get_enrolled_sql($this->context); //fields we need from the user table - $userfields = user_picture::fields('u'); - $userfields .= get_extra_user_fields_sql($this->context); + $userfields = user_picture::fields('u', get_extra_user_fields($this->context)); $sortjoin = $sort = $params = null;
MDL-<I> duplicated columns cause Oracle error in grader report
moodle_moodle
train
php
4f74a77268e7bab70ca5df3d4b3ddcf3b6047985
diff --git a/test/test_remote.py b/test/test_remote.py index <HASH>..<HASH> 100644 --- a/test/test_remote.py +++ b/test/test_remote.py @@ -100,9 +100,6 @@ run: time.sleep(20) out = subprocess.check_output('sos status {} -c docker.yml -q docker'.format(tasks), shell=True).decode() self.assertEqual(out.count('completed'), len(res['pending_tasks'])) - # now, local status should still be pending - out = subprocess.check_output('sos status {} -c docker.yml'.format(tasks), shell=True).decode() - self.assertEqual(out.count('pending'), len(res['pending_tasks'])) Host.reset() # until we run the workflow again
Try again to fix travis CI tests
vatlab_SoS
train
py
c654a359f9d4768cbec4d7d9b081303f9605b695
diff --git a/src/sync.js b/src/sync.js index <HASH>..<HASH> 100644 --- a/src/sync.js +++ b/src/sync.js @@ -15,7 +15,8 @@ const configDefaults = { remove: false }, files: [], - include: [] + include: [], + includes: [] }; const optionDefaults = { @@ -48,9 +49,12 @@ async function sync(cfg, opt) { ); } + // Make include alias includes for backward compat, for now. + cfg.includes = cfg.includes.concat(cfg.include); + // If there's no files or includes, it's not really an error but there's // nothing to do. - if (!cfg.files.length && !cfg.include.length) { + if (!cfg.files.length && !cfg.includes.length) { console.warn( 'You have not provided any "files" or "includes". For more information see https://github.com/treshugart/conartist#install for ways you can configure conartist.' ); @@ -66,7 +70,7 @@ async function sync(cfg, opt) { } // Includes are like Babel plugins. - for (let inc of cfg.include) { + for (let inc of cfg.includes) { let arg; // Like in Babel configs, you can specify an array to pass options to
Make "includes" work along-side "include" for backward compat.
treshugart_conartist
train
js
f840486ee1a8fd8eaf4cd14aea4421e809704ee5
diff --git a/src/main/java/fr/wseduc/webutils/http/Renders.java b/src/main/java/fr/wseduc/webutils/http/Renders.java index <HASH>..<HASH> 100644 --- a/src/main/java/fr/wseduc/webutils/http/Renders.java +++ b/src/main/java/fr/wseduc/webutils/http/Renders.java @@ -171,9 +171,8 @@ public class Renders { } path = "view/" + template + ".html"; } - Template t = templates.get(path); - if (t != null) { - handler.handle(t); + if (!"dev".equals(container.config().getString("mode")) && templates.containsKey(path)) { + handler.handle(templates.get(path)); } else { final String p = path; vertx.fileSystem().readFile(p, new Handler<AsyncResult<Buffer>>() { @@ -182,7 +181,11 @@ public class Renders { if (ar.succeeded()) { Mustache.Compiler compiler = Mustache.compiler().defaultValue(""); Template template = compiler.compile(ar.result().toString("UTF-8")); - templates.putIfAbsent(p, template); + if("dev".equals(container.config().getString("mode"))) { + templates.put(p, template); + } else { + templates.putIfAbsent(p, template); + } handler.handle(template); } else { handler.handle(null);
[render] Do not cache server view in dev mode
opendigitaleducation_web-utils
train
java
f4c33bdd29eb18c707758ec479c5aa67b734b997
diff --git a/ui/build/build.api.js b/ui/build/build.api.js index <HASH>..<HASH> 100644 --- a/ui/build/build.api.js +++ b/ui/build/build.api.js @@ -146,6 +146,18 @@ const objectTypes = { isBoolean: [ 'internal' ] }, + Event: { + props: [ 'desc', 'required', 'category', 'examples', 'addedIn', 'internal' ], + required: [ 'desc' ], + isBoolean: [ 'internal' ] + }, + + SubmitEvent: { + props: [ 'desc', 'required', 'category', 'examples', 'addedIn', 'internal' ], + required: [ 'desc' ], + isBoolean: [ 'internal' ] + }, + // component only slots: { props: [ 'desc', 'link', 'scope', 'addedIn', 'internal' ],
chore(ui): fix build broken by previous PR #<I>
quasarframework_quasar
train
js
97cb1668de0448914e808cd7bef8afd7e53c669b
diff --git a/src/components/body/body.js b/src/components/body/body.js index <HASH>..<HASH> 100644 --- a/src/components/body/body.js +++ b/src/components/body/body.js @@ -190,8 +190,10 @@ var Body = { * Removes the component and all physics and scene side effects. */ remove: function () { - delete this.body.el; - delete this.body; + if (this.body) { + delete this.body.el; + delete this.body; + } delete this.el.body; delete this.wireframe; }, @@ -245,7 +247,7 @@ var Body = { this.wireframe.add(wireframe); } - + this.syncWireframe(); },
check for existence of body property in remove
donmccurdy_aframe-physics-system
train
js
4959d04b1269a87d7a28dd2ca68b326f3a43728b
diff --git a/driver/src/main/java/org/kaazing/k3po/driver/internal/netty/bootstrap/http/HttpBootstrapFactorySpi.java b/driver/src/main/java/org/kaazing/k3po/driver/internal/netty/bootstrap/http/HttpBootstrapFactorySpi.java index <HASH>..<HASH> 100644 --- a/driver/src/main/java/org/kaazing/k3po/driver/internal/netty/bootstrap/http/HttpBootstrapFactorySpi.java +++ b/driver/src/main/java/org/kaazing/k3po/driver/internal/netty/bootstrap/http/HttpBootstrapFactorySpi.java @@ -70,11 +70,11 @@ public class HttpBootstrapFactorySpi extends BootstrapFactorySpi { @Override public void shutdown() { - // ignore + serverChannelFactory.shutdown(); } @Override public void releaseExternalResources() { - // ignore + serverChannelFactory.releaseExternalResources(); } }
Not sure why shutdown and release external resources was ignored on http, I've added logic to shut them down
k3po_k3po
train
java
a69469c1be98613ff25e9a76aa9a88a7fc5ff85d
diff --git a/sonar-server/src/main/java/org/sonar/server/search/BaseIndex.java b/sonar-server/src/main/java/org/sonar/server/search/BaseIndex.java index <HASH>..<HASH> 100644 --- a/sonar-server/src/main/java/org/sonar/server/search/BaseIndex.java +++ b/sonar-server/src/main/java/org/sonar/server/search/BaseIndex.java @@ -31,8 +31,6 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.xcontent.XContentBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.sonar.server.search.IndexAction; -import org.sonar.server.search.IndexAction.Method; import org.sonar.core.cluster.WorkQueue; import org.sonar.core.db.Dao; import org.sonar.core.db.Dto; @@ -88,7 +86,7 @@ public abstract class BaseIndex<K extends Serializable, E extends Dto<K>> implem this.intializeIndex(); /* Launch synchronization */ - synchronizer.start(); +// synchronizer.start(); } @Override
Commented out synchronizer in BaseIndex
SonarSource_sonarqube
train
java
3e9398714247f009cbfdc6b626de65ff00ede7a6
diff --git a/lib/setup.php b/lib/setup.php index <HASH>..<HASH> 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -36,6 +36,7 @@ * - $CFG->dataroot - Path to moodle data files directory on server's filesystem. * - $CFG->dirroot - Path to moodle's library folder on server's filesystem. * - $CFG->libdir - Path to moodle's library folder on server's filesystem. + * - $CFG->tempdir - Path to moodle's temp file directory on server's filesystem. * * @global object $CFG * @name $CFG @@ -96,6 +97,11 @@ if (!isset($CFG->admin)) { // Just in case it isn't defined in config.php // Set up some paths. $CFG->libdir = $CFG->dirroot .'/lib'; +// Allow overriding of tempdir but be backwards compatible with dataroot/temp +if (!isset($CFG->tempdir)) { + $CFG->tempdir = "$CFG->dataroot/temp"; +} + // The current directory in PHP version 4.3.0 and above isn't necessarily the // directory of the script when run from the command line. The require_once() // would fail, so we'll have to chdir()
MDL-<I> Added $CFG->tempdir setting
moodle_moodle
train
php
412194a7d937954d7af23a8dda2e1dd01ac03c76
diff --git a/lib/ticketmaster/project.rb b/lib/ticketmaster/project.rb index <HASH>..<HASH> 100644 --- a/lib/ticketmaster/project.rb +++ b/lib/ticketmaster/project.rb @@ -34,7 +34,7 @@ module TicketMasterMod def tickets # Lets ask that cute little API if I have any tickets # associated with me, shall we? - self.const_get("#{@system}::Project").tickets(self) + TicketMasterMod.const_get(@system)::Project.tickets(self) end end end
Eval => const_get (faster, better, safer)
hybridgroup_taskmapper
train
rb
0c4b066bbdcdf6c036f52420822b9da5ae9cca81
diff --git a/classes/Gems/Tracker.php b/classes/Gems/Tracker.php index <HASH>..<HASH> 100644 --- a/classes/Gems/Tracker.php +++ b/classes/Gems/Tracker.php @@ -235,7 +235,7 @@ class Gems_Tracker extends Gems_Loader_TargetLoaderAbstract implements Gems_Trac * @param array $trackFieldsData * @return Gems_Tracker_RespondentTrack The newly created track */ - public function createRespondentTrack($patientId, $organizationId, $trackId, $userId, $respTrackData = null, array $trackFieldsData = array()) + public function createRespondentTrack($patientId, $organizationId, $trackId, $userId, $respTrackData = array(), array $trackFieldsData = array()) { $trackEngine = $this->getTrackEngine($trackId); diff --git a/classes/Gems/Tracker/Token.php b/classes/Gems/Tracker/Token.php index <HASH>..<HASH> 100644 --- a/classes/Gems/Tracker/Token.php +++ b/classes/Gems/Tracker/Token.php @@ -118,7 +118,7 @@ class Gems_Tracker_Token extends Gems_Registry_TargetAbstract protected $survey; /** - * + * @deprecated MD: 20111108 Found no reference and defined class is missing. Remove? * @var Gems_Tracker_Track */ protected $track;
Added possible deprecated comment in Toke fixed Tracker->createRespondentTrack when no $respTrackData was given
GemsTracker_gemstracker-library
train
php,php
7006a559dc6475fe3e8785430892f584565d5bf7
diff --git a/pyvisa-py/highlevel.py b/pyvisa-py/highlevel.py index <HASH>..<HASH> 100644 --- a/pyvisa-py/highlevel.py +++ b/pyvisa-py/highlevel.py @@ -314,6 +314,19 @@ class PyVisaLibrary(highlevel.VisaLibraryBase): return ret + def read_stb(self, session): + """Reads a status byte of the service request. + Corresponds to viReadSTB function of the VISA library. + :param session: Unique logical identifier to a session. + :return: Service request status byte, return value of the library call. + :rtype: int, :class:`pyvisa.constants.StatusCode` + """ + try: + sess = self.sessions[session] + except KeyError: + return None, constants.StatusCode.error_invalid_object + return sess.read_stb() + def get_attribute(self, session, attribute): """Retrieves the state of an attribute.
Add missing read_stb() to high_level.py
pyvisa_pyvisa-py
train
py
d6f73dc179f873cacacd48bba7191a690fe4ab2a
diff --git a/lib/eggs.js b/lib/eggs.js index <HASH>..<HASH> 100644 --- a/lib/eggs.js +++ b/lib/eggs.js @@ -250,7 +250,7 @@ var factory = function(htmlString,options,ViewModel,callback){ tree = select(selector)(virtualdom); } if (!tree || !tree.length) { - if(callback) callback(null,null); + if(callback) callback(null,htmlString); return eggs; } else if (tree.length > 1){ var error = new Error('Eggs selectors must only match one node.'); diff --git a/test/view-engine/index.js b/test/view-engine/index.js index <HASH>..<HASH> 100644 --- a/test/view-engine/index.js +++ b/test/view-engine/index.js @@ -17,6 +17,9 @@ describe('eggs view engine',function(){ routes.push({ selector : '#index', viewmodel : require('../fixtures/viewmodels/index') + },{ + selector : '#fake', + viewmodel : function(){} }); app = express();
fix a bug where unmatched routes caused view engine to barf
misejs_eggs
train
js,js
ae3a02f55301f27fef247263d643c68d31c74940
diff --git a/score_test.go b/score_test.go index <HASH>..<HASH> 100644 --- a/score_test.go +++ b/score_test.go @@ -594,6 +594,31 @@ func TestScoreRejectMessageDeliveries(t *testing.T) { time.Sleep(1 * time.Millisecond) ps.deliveries.gc() + // insert a record in the message deliveries + ps.ValidateMessage(&msg) + + // this should have no effect in the score, and subsequent duplicate messages should have no + // effect either + ps.RejectMessage(&msg, rejectValidationIgnored) + ps.DuplicateMessage(&msg2) + + aScore = ps.Score(peerA) + expected = 0.0 + if aScore != expected { + t.Fatalf("Score: %f. Expected %f", aScore, expected) + } + + bScore = ps.Score(peerB) + expected = 0.0 + if bScore != expected { + t.Fatalf("Score: %f. Expected %f", aScore, expected) + } + + // now clear the delivery record + ps.deliveries.head.expire = time.Now() + time.Sleep(1 * time.Millisecond) + ps.deliveries.gc() + // insert a new record in the message deliveries ps.ValidateMessage(&msg)
add test for rejections with ignore validator decision
libp2p_go-libp2p-pubsub
train
go
78c8a2950083a10ad0a7ca511898a53e896d1c04
diff --git a/robotium-solo/src/main/java/com/jayway/android/robotium/solo/Getter.java b/robotium-solo/src/main/java/com/jayway/android/robotium/solo/Getter.java index <HASH>..<HASH> 100644 --- a/robotium-solo/src/main/java/com/jayway/android/robotium/solo/Getter.java +++ b/robotium-solo/src/main/java/com/jayway/android/robotium/solo/Getter.java @@ -60,7 +60,7 @@ class Getter { public <T extends TextView> T getView(Class<T> classToFilterBy, String text, boolean onlyVisible) { - T viewToReturn = (T) waiter.waitForText(classToFilterBy, text, 0, 10000, false, onlyVisible, false); + T viewToReturn = (T) waiter.waitForText(classToFilterBy, text, 0, Timeout.getSmallTimeout(), false, onlyVisible, false); if(viewToReturn == null) Assert.assertTrue(classToFilterBy.getSimpleName() + " with text: '" + text + "' is not found!", false);
Changed so that getView() uses Timeout.getSmallTimeout()
RobotiumTech_robotium
train
java
d4336d82b7f4d2906fcdb833acb727c70f11c279
diff --git a/lib/core/util.js b/lib/core/util.js index <HASH>..<HASH> 100644 --- a/lib/core/util.js +++ b/lib/core/util.js @@ -47,12 +47,13 @@ function destroy (stream, err) { } } +const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)s/ function parseKeepAliveTimeout (headers) { for (let n = 0; n < headers.length; n += 2) { const key = headers[n + 0] if (key.length === 10 && key.toLowerCase() === 'keep-alive') { - const timeout = parseInt(headers[n + 1].split('timeout=', 2)[1]) - return timeout ? timeout * 1000 : undefined + const m = headers[n + 1].match(KEEPALIVE_TIMEOUT_EXPR) + return m ? parseInt(m[1]) * 1000 : null } } }
perf: parseKeepAliveTimeout The regex version is fastest.
mcollina_undici
train
js
ca554dbc083c3a75d3df4ac627001c55f4833c9b
diff --git a/hazelcast-client/src/main/java/com/hazelcast/client/impl/HazelcastClientInstanceImpl.java b/hazelcast-client/src/main/java/com/hazelcast/client/impl/HazelcastClientInstanceImpl.java index <HASH>..<HASH> 100644 --- a/hazelcast-client/src/main/java/com/hazelcast/client/impl/HazelcastClientInstanceImpl.java +++ b/hazelcast-client/src/main/java/com/hazelcast/client/impl/HazelcastClientInstanceImpl.java @@ -408,6 +408,7 @@ public class HazelcastClientInstanceImpl implements HazelcastInstance, Serializa return getDistributedObject(XAService.SERVICE_NAME, XAService.SERVICE_NAME); } + @Override public Config getConfig() { throw new UnsupportedOperationException("Client cannot access cluster config!"); } @@ -502,6 +503,7 @@ public class HazelcastClientInstanceImpl implements HazelcastInstance, Serializa return getDistributedObject(DistributedDurableExecutorService.SERVICE_NAME, name); } + @Override public <T> T executeTransaction(TransactionalTask<T> task) throws TransactionException { return transactionManager.executeTransaction(task); } @@ -623,6 +625,7 @@ public class HazelcastClientInstanceImpl implements HazelcastInstance, Serializa return config; } + @Override public SerializationService getSerializationService() { return serializationService; }
Added missing @Override annotations in HazelcastClientInstanceImpl.
hazelcast_hazelcast
train
java
6f5344ecedd9b136f39198f99456a1ba3063e9fe
diff --git a/lib/tire/model/search.rb b/lib/tire/model/search.rb index <HASH>..<HASH> 100644 --- a/lib/tire/model/search.rb +++ b/lib/tire/model/search.rb @@ -19,6 +19,9 @@ module Tire # module Search + def self.dependents + @dependents ||= Set.new + end # Alias for Tire::Model::Naming::ClassMethods.index_prefix # def self.index_prefix(*args) @@ -254,6 +257,7 @@ module Tire # A hook triggered by the `include Tire::Model::Search` statement in the model. # def self.included(base) + self.dependents << base base.class_eval do # Returns proxy to the _Tire's_ class methods.
[#<I>] Added `included` tracking to Model::Search
karmi_retire
train
rb
4f3c2d5403f185a29d895aed82ef844d45cad25f
diff --git a/rake-tasks/crazy_fun/mappings/javascript.rb b/rake-tasks/crazy_fun/mappings/javascript.rb index <HASH>..<HASH> 100644 --- a/rake-tasks/crazy_fun/mappings/javascript.rb +++ b/rake-tasks/crazy_fun/mappings/javascript.rb @@ -837,7 +837,7 @@ module Javascript MAX_STR_LENGTH_JAVA = MAX_LINE_LENGTH_JAVA - " .append\(\"\"\)\n".length COPYRIGHT = "/*\n" + - " * Copyright 2011-2012 WebDriver committers\n" + + " * Copyright 2011-2014 Software Freedom Conservancy\n" + " *\n" + " * Licensed under the Apache License, Version 2.0 (the \"License\");\n" + " * you may not use this file except in compliance with the License.\n" + @@ -1050,7 +1050,7 @@ module Javascript def generate_java(dir, name, task_name, output, js_files, package) file output => js_files do - task_name =~ /([a-z]+)-driver/ + task_name =~ /([a-z]+)-(driver|atoms)/ implementation = $1.capitalize output_dir = File.dirname(output) mkdir_p output_dir unless File.exists?(output_dir)
fix javascript to java build for 'android-atoms' update the copyright header that gets generated
SeleniumHQ_selenium
train
rb
c78a3f3e3fd3d9a460a7e0f889230b9a0cbc7f4d
diff --git a/lib/vagrant.rb b/lib/vagrant.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant.rb +++ b/lib/vagrant.rb @@ -11,7 +11,7 @@ end require File.expand_path("util/glob_loader", libdir) # Load them up -Vagrant::GlobLoader.glob_require(libdir, %w{util/stacked_proc_runner +Vagrant::GlobLoader.glob_require(libdir, %w{util util/stacked_proc_runner downloaders/base config provisioners/base provisioners/chef systems/base commands/base commands/box action/exception_catcher hosts/base})
Include util.rb early so the included hook is set up properly. Fixes a NoMethodError running any command that invokes Environment.load!
hashicorp_vagrant
train
rb
20444db326a4a9d0f8e43a92f513abdead2d64c3
diff --git a/src/manhole.py b/src/manhole.py index <HASH>..<HASH> 100644 --- a/src/manhole.py +++ b/src/manhole.py @@ -87,8 +87,8 @@ class Manhole(threading.Thread): self.sigmask = sigmask @staticmethod - def get_socket(): - sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) + def get_socket(factory=None): + sock = (factory or socket.socket)(socket.AF_UNIX, socket.SOCK_STREAM) pid = os.getpid() name = "/tmp/manhole-%s" % pid if os.path.exists(name): @@ -212,9 +212,9 @@ def run_repl(): 'traceback': traceback, }).interact() -def _handle_oneshot(_signum, _frame): +def _handle_oneshot(_signum, _frame, _socket=socket._socketobject): try: - sock, pid = Manhole.get_socket() + sock, pid = Manhole.get_socket(_socket) cry("Waiting for new connection (in pid:%s) ..." % pid) client, _ = sock.accept() ManholeConnection.check_credentials(client)
Make oneshot use the original socket object (no more monkey business).
ionelmc_python-manhole
train
py
27ea3e31569ed1fa57ffcdb43d433a71ebca6546
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -52,7 +52,7 @@ master_doc = 'index' # General information about the project. project = u'Dependency Injector' -copyright = u'2017, ETS Labs' +copyright = u'2020, ETS Labs' author = u'ETS Labs' # The version info for the project you're documenting, acts as replacement for
Update copyright year in the docs
ets-labs_python-dependency-injector
train
py
50a3bd0032e8a21794cfc79fa5591bd517879d1c
diff --git a/code/libraries/koowa/libraries/http/token/token.php b/code/libraries/koowa/libraries/http/token/token.php index <HASH>..<HASH> 100644 --- a/code/libraries/koowa/libraries/http/token/token.php +++ b/code/libraries/koowa/libraries/http/token/token.php @@ -308,7 +308,7 @@ class KHttpToken extends KObject implements KHttpTokenInterface public function setIssueTime(DateTime $date) { $date->setTimezone(new DateTimeZone('UTC')); - $this->_claims['iat'] = $date->format('U'); + $this->_claims['iat'] = (int)$date->format('U'); return $this; }
re #<I>: Make sure JWT tokens follow the specs
joomlatools_joomlatools-framework
train
php
33c4ac46395fa60440f906570fc1933ec5c45278
diff --git a/pycannon/connection.py b/pycannon/connection.py index <HASH>..<HASH> 100644 --- a/pycannon/connection.py +++ b/pycannon/connection.py @@ -6,7 +6,7 @@ class Connection: Connection to go-cannon for sending emails. """ - def __init__(self, tls=False, host='localhost', port=8025, username=None, + def __init__(self, host='localhost', port=8025, tls=False, username=None, password=None): """ Provide the security information and credentials necessary to make @@ -26,8 +26,22 @@ class Connection: host, port, ) + def send(self, from_, to, subject, text, html='', cc=[], bcc=[]): + """ + Send an email using go-cannon. + """ + return self._session.post("{}/send".format(self._url), json={ + 'from': from_, + 'to': to, + 'cc': cc, + 'bcc': bcc, + 'subject': subject, + 'text': text, + 'html': html, + }).json() + def version(self): """ Obtain the current version of go-cannon. """ - return self._session.get("{}/version".format(self._url)).json()['version'] + return self._session.get("{}/version".format(self._url)).json()
Added /send method.
hectane_python-hectane
train
py
0c72fa99c518088aa4505ee16721f85ac42eb0c2
diff --git a/umi_tools/extract.py b/umi_tools/extract.py index <HASH>..<HASH> 100644 --- a/umi_tools/extract.py +++ b/umi_tools/extract.py @@ -311,7 +311,7 @@ def main(argv=None): U.error("option --retain-umi only works with --extract-method=regex") if (options.filtered_out and not options.extract_method == "regex" and - whitelist is None): + options.whitelist is None): U.error("Reads will not be filtered unless extract method is" "set to regex (--extract-method=regex) or cell" "barcodes are filtered (--whitelist)")
Insert missing "options" in test for white list conditions (#<I>) fixes #<I>
CGATOxford_UMI-tools
train
py
d78921b8c7e289d54c7d905554d1603e356a79a9
diff --git a/reflekt/src/main/java/io/advantageous/boon/core/value/LazyValueMap.java b/reflekt/src/main/java/io/advantageous/boon/core/value/LazyValueMap.java index <HASH>..<HASH> 100644 --- a/reflekt/src/main/java/io/advantageous/boon/core/value/LazyValueMap.java +++ b/reflekt/src/main/java/io/advantageous/boon/core/value/LazyValueMap.java @@ -217,7 +217,7 @@ public class LazyValueMap extends AbstractMap<String, Object> implements ValueMa } private final void buildMap() { - map = new HashMap<>( items.length ); + map = new LinkedHashMap<>( items.length ); for ( Entry<String, Value> miv : items ) { if ( miv == null ) {
Don't lose order in LazyValueMap, close #<I>
advantageous_boon
train
java
596d1149656682d029276c787bf1503db0a34547
diff --git a/gems/rake-support/lib/torquebox/deploy_utils.rb b/gems/rake-support/lib/torquebox/deploy_utils.rb index <HASH>..<HASH> 100644 --- a/gems/rake-support/lib/torquebox/deploy_utils.rb +++ b/gems/rake-support/lib/torquebox/deploy_utils.rb @@ -189,6 +189,7 @@ module TorqueBox d = {} d['application'] = {} d['application']['root'] = root + d['environment'] = {} d['environment']['RACK_ENV'] = env.to_s if env if !context_path &&
Can't set RACK_ENV on a nil environment.
torquebox_torquebox
train
rb
1c860a07b6397709f2778bb9d993833964a7f3ec
diff --git a/src/readers/csv/csv.js b/src/readers/csv/csv.js index <HASH>..<HASH> 100644 --- a/src/readers/csv/csv.js +++ b/src/readers/csv/csv.js @@ -214,6 +214,8 @@ const CSVReader = Reader.extend({ return typeof condition !== 'object' ? (rowValue === condition + // if the column is missing, then don't apply filter + || rowValue === undefined || condition === true && utils.isString(rowValue) && rowValue.toLowerCase().trim() === 'true' || condition === false && utils.isString(rowValue) && rowValue.toLowerCase().trim() === 'false' ) :
Make all values pass the filter when a column for filtering is absent from the CSV file
vizabi_vizabi
train
js
5f9ed819170c4df20b26de991ac2c29ef11cd32c
diff --git a/connection.go b/connection.go index <HASH>..<HASH> 100644 --- a/connection.go +++ b/connection.go @@ -66,11 +66,20 @@ func (cn *connection) WriteStatus(w io.Writer) { fmt.Fprintf(w, "%c", b) } // https://trac.transmissionbt.com/wiki/PeerStatusText + if cn.PeerInterested && !cn.Choked { + c('O') + } if len(cn.Requests) != 0 { c('D') - } else if cn.Interested { + } + if cn.PeerChoked && cn.Interested { c('d') } + if !cn.Choked && cn.PeerInterested { + c('U') + } else { + c('u') + } if !cn.PeerChoked && !cn.Interested { c('K') }
Add some extra char flags to connection status
anacrolix_torrent
train
go
7599aa970df6df222e5d525e28d13ab79db6a74d
diff --git a/src/test/java/com/googlecode/lanterna/gui2/TestBase.java b/src/test/java/com/googlecode/lanterna/gui2/TestBase.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/googlecode/lanterna/gui2/TestBase.java +++ b/src/test/java/com/googlecode/lanterna/gui2/TestBase.java @@ -13,7 +13,7 @@ public abstract class TestBase { void run(String[] args) throws IOException, InterruptedException { Screen screen = new TestTerminalFactory(args).createScreen(); screen.startScreen(); - MultiWindowTextGUI textGUI = new MultiWindowTextGUI(new SeparateTextGUIThread.Factory(), screen); + MultiWindowTextGUI textGUI = createTextGUI(screen); textGUI.setBlockingIO(false); textGUI.setEOFWhenNoWindows(true); textGUI.isEOFWhenNoWindows(); //No meaning, just to silence IntelliJ:s "is never used" alert @@ -29,5 +29,9 @@ public abstract class TestBase { } } + protected MultiWindowTextGUI createTextGUI(Screen screen) { + return new MultiWindowTextGUI(new SeparateTextGUIThread.Factory(), screen); + } + public abstract void init(WindowBasedTextGUI textGUI); }
Allow the tests to customize how the TextGUI is created
mabe02_lanterna
train
java
8f445f3249bc9785f279ee0e2aea2a7e93792b08
diff --git a/bcbio/distributed/resources.py b/bcbio/distributed/resources.py index <HASH>..<HASH> 100644 --- a/bcbio/distributed/resources.py +++ b/bcbio/distributed/resources.py @@ -29,7 +29,7 @@ def _get_ensure_functions(fn, algs): def _get_used_programs(fn, algs): used_progs = set(["gatk", "gemini", "bcbio_coverage", "samtools", - "snpEff", "cufflinks", "picard", "rnaseqc"]) + "snpeff", "cufflinks", "picard", "rnaseqc"]) for alg in algs: # get aligners used aligner = alg.get("aligner")
Ensure snpeff resource requirements passed along with new all lowercase approach to input keys
bcbio_bcbio-nextgen
train
py
c1951fe598f7f876a2cee3efcc15b5e6c925525f
diff --git a/asset_allocation/asset_allocation.py b/asset_allocation/asset_allocation.py index <HASH>..<HASH> 100644 --- a/asset_allocation/asset_allocation.py +++ b/asset_allocation/asset_allocation.py @@ -11,7 +11,7 @@ def cli(): @click.command() @click.option("--format", default="ascii", help="format for the report output. ascii or html.") # prompt="output format") -def print(format): +def list(format): """ Print current allocation to the console. """ print(f"This would print the Asset Allocation report in {format} format. Incomplete.") @@ -22,5 +22,5 @@ def add(name): print("in add") -cli.add_command(print) +cli.add_command(list) cli.add_command(add)
abandoning the default option as displaying all options is preferable and "list" command is easy to type
MisterY_asset-allocation
train
py
000a21969f0a57e829434a5e7de6498afe4bef48
diff --git a/src/Monolog/Handler/SlackHandler.php b/src/Monolog/Handler/SlackHandler.php index <HASH>..<HASH> 100644 --- a/src/Monolog/Handler/SlackHandler.php +++ b/src/Monolog/Handler/SlackHandler.php @@ -156,9 +156,15 @@ class SlackHandler extends SocketHandler * * @param int $level * @return string + * @deprecated Use underlying SlackRecord instead */ protected function getAttachmentColor($level) { + trigger_error( + 'SlackHandler::getAttachmentColor() is deprecated. Use underlying SlackRecord instead.', + E_USER_DEPRECATED + ); + return $this->slackRecord->getAttachmentColor($level); } @@ -167,9 +173,15 @@ class SlackHandler extends SocketHandler * * @param array $fields * @return string + * @deprecated Use underlying SlackRecord instead */ protected function stringify($fields) { + trigger_error( + 'SlackHandler::stringify() is deprecated. Use underlying SlackRecord instead.', + E_USER_DEPRECATED + ); + return $this->slackRecord->stringify($fields); } }
Mark former public methods of SlackHandler as deprecated The SlackRecord could be used now
Seldaek_monolog
train
php
d46f8298429a4ca6b89a531fe7a9682c5c769f91
diff --git a/src/Data/Log.php b/src/Data/Log.php index <HASH>..<HASH> 100644 --- a/src/Data/Log.php +++ b/src/Data/Log.php @@ -30,24 +30,9 @@ final class Log implements LogDataInterface { /** * @var string */ - private $message; - - /** - * @var string - */ - private $channel; - - /** - * @var string - */ private $level; /** - * @var array - */ - private $context; - - /** * @param \WP_Error $error * @param int $level * @param string $channel
Don't overwrite properties declared in trait #4
inpsyde_Wonolog
train
php
5f56085550cce1326f71466e10e8e54b1adb74a1
diff --git a/src/Calendar/Calendar.php b/src/Calendar/Calendar.php index <HASH>..<HASH> 100644 --- a/src/Calendar/Calendar.php +++ b/src/Calendar/Calendar.php @@ -16,6 +16,11 @@ class Calendar implements CalendarInterface, \IteratorAggregate $this->recurrenceFactory = $recurrenceFactory; } + public static function create(RecurrenceFactoryInterface $recurrenceFactory = null) + { + return new static($recurrenceFactory); + } + public function getIterator() { if($this->events === null) {
Calendar create method to allow instant chaining on an instance.
benplummer_calendarful
train
php
f48085c7c62101e63fda49e1fffb99ff73a0176e
diff --git a/exa/core/editor.py b/exa/core/editor.py index <HASH>..<HASH> 100644 --- a/exa/core/editor.py +++ b/exa/core/editor.py @@ -324,7 +324,7 @@ class Editor(object): def to_stream(self): """Create an io.StringIO object from the current editor text.""" - return io.StringIO(str(self)) + return io.StringIO(six.u(self)) @property def variables(self):
StringIO as six.unicode
exa-analytics_exa
train
py
1f877f644251c8f1bf1363b313a770e646797b96
diff --git a/blimpy/calib_utils/calib_plots.py b/blimpy/calib_utils/calib_plots.py index <HASH>..<HASH> 100644 --- a/blimpy/calib_utils/calib_plots.py +++ b/blimpy/calib_utils/calib_plots.py @@ -218,7 +218,7 @@ def plot_diode_fold(dio_cross,bothfeeds=True,feedtype='l',min_samp=-500,max_samp """ Plots the calculated average power and time sampling of ON (red) and OFF (blue) for a noise diode measurement over the observation time series - ''' + """ #Get full stokes data of ND measurement obs = Waterfall(dio_cross,max_load=150) tsamp = obs.header['tsamp']
Issue #<I> During setup.py execution, the function description border of plot_diode_fold() caused a misscan in Python to the end of file.
UCBerkeleySETI_blimpy
train
py
2bd5b3d245ff5833fdbbcccdc3ea04f49fd7d208
diff --git a/Generator/ConfigEntityType.php b/Generator/ConfigEntityType.php index <HASH>..<HASH> 100644 --- a/Generator/ConfigEntityType.php +++ b/Generator/ConfigEntityType.php @@ -296,9 +296,19 @@ class ConfigEntityType extends EntityTypeBase { $description .= '.'; } + // The PHP type is not the same as the config schema type! + switch ($schema_item['type']) { + case 'label': + $php_type = 'string'; + break; + + default: + $php_type = $schema_item['type']; + } + $this->properties[] = $this->createPropertyBlock( $schema_item['name'], - $schema_item['type'], // TODO: config schema type not the same as PHP type!!!!! + $php_type, [ 'docblock_first_line' => $schema_item['label'] . '.', ]
Fixed config entity properties getting wrong PHP property types.
drupal-code-builder_drupal-code-builder
train
php
bbac63821c80c4d53dbb15632d993873afee91a1
diff --git a/src/Composer/Command/SearchCommand.php b/src/Composer/Command/SearchCommand.php index <HASH>..<HASH> 100644 --- a/src/Composer/Command/SearchCommand.php +++ b/src/Composer/Command/SearchCommand.php @@ -27,7 +27,7 @@ use Composer\Factory; class SearchCommand extends Command { protected $matches; - protected $lowMatches; + protected $lowMatches = array(); protected $tokens; protected $output; @@ -67,10 +67,8 @@ EOT $this->output = $output; $repos->filterPackages(array($this, 'processPackage'), 'Composer\Package\CompletePackage'); - if (!empty($this->lowMatches)) { - foreach ($this->lowMatches as $details) { - $output->writeln($details['name'] . '<comment>:</comment> '. $details['description']); - } + foreach ($this->lowMatches as $details) { + $output->writeln($details['name'] . '<comment>:</comment> '. $details['description']); } }
Search: initialize lowMatches as empty array.
mothership-ec_composer
train
php
c2d31e55dd7ee2708f3f0efddbf4cf78adda6ff9
diff --git a/code/controllers/CMSSettingsController.php b/code/controllers/CMSSettingsController.php index <HASH>..<HASH> 100644 --- a/code/controllers/CMSSettingsController.php +++ b/code/controllers/CMSSettingsController.php @@ -8,6 +8,12 @@ class CMSSettingsController extends LeftAndMain { static $tree_class = 'SiteConfig'; static $required_permission_codes = array('EDIT_SITECONFIG'); + public function init() { + parent::init(); + + Requirements::javascript(CMS_DIR . '/javascript/CMSMain.EditForm.js'); + } + public function getResponseNegotiator() { $neg = parent::getResponseNegotiator(); $controller = $this;
BUG Hiding group selections in "Settings" JS functionality was only applied to page-specific settings with similar fields, but not to SiteConfig settings.
silverstripe_silverstripe-siteconfig
train
php
bf43aaf1c6a74fc5c3937e17b129ad85340141ee
diff --git a/src/service-broker.js b/src/service-broker.js index <HASH>..<HASH> 100644 --- a/src/service-broker.js +++ b/src/service-broker.js @@ -1044,7 +1044,7 @@ class ServiceBroker { }; } }); - const flattenedStatuses = serviceStatuses.flatMap(s => s); + const flattenedStatuses = _.flatMap(serviceStatuses, s => s); const names = flattenedStatuses.map(s => s.name); const availableServices = flattenedStatuses.filter(s => s.available);
support node <I> (flatMap)
moleculerjs_moleculer
train
js
a4b87423f9f7285838ef8771ca70552ecbdb8836
diff --git a/lib/irc.js b/lib/irc.js index <HASH>..<HASH> 100644 --- a/lib/irc.js +++ b/lib/irc.js @@ -540,8 +540,9 @@ function Client(server, nick, opt) { } else { if ( self.opt.debug ) - util.log("\u001b[01;31mUnhandled message: " + util.inspect(message) + "\u001b + util.log("\u001b[01;31mUnhandled message: " + util.inspect(message) + "\u001b[0m"); break; + } } }); // }}}
fix unfinished code from merging #<I>
martynsmith_node-irc
train
js
9913f8d517a7fb6b17357575c20e9b8d2c801727
diff --git a/Settings/General/SettingsManager.php b/Settings/General/SettingsManager.php index <HASH>..<HASH> 100644 --- a/Settings/General/SettingsManager.php +++ b/Settings/General/SettingsManager.php @@ -160,7 +160,7 @@ class SettingsManager { $setting = $this->repo->find($profile . '_' . $name); if ($setting === null) { - if ($mustExist == true) { + if ($mustExist === true) { throw new \UnexpectedValueException(); } $setting = $this->createSetting($name, $profile, $type); diff --git a/Twig/HiddenExtension.php b/Twig/HiddenExtension.php index <HASH>..<HASH> 100644 --- a/Twig/HiddenExtension.php +++ b/Twig/HiddenExtension.php @@ -68,10 +68,10 @@ class HiddenExtension extends \Twig_Extension */ public function generate($environment, $data, $checkRequest = false) { - if ($checkRequest && ($this->request != null)) { + if ($checkRequest && ($this->request !== null)) { foreach ($data as $name => $value) { $requestVal = $this->request->get($name); - if (!isset($requestVal) || empty($requestVal) || ($requestVal != null)) { + if (!isset($requestVal) || empty($requestVal) || ($requestVal !== null)) { unset($data[$name]); } }
Strict boolean compare
ongr-io_SettingsBundle
train
php,php
7d1458ee03c0cce5bca290eb84cd8a47264f2231
diff --git a/tests/IcalTest/Component/EventTest.php b/tests/IcalTest/Component/EventTest.php index <HASH>..<HASH> 100644 --- a/tests/IcalTest/Component/EventTest.php +++ b/tests/IcalTest/Component/EventTest.php @@ -41,7 +41,10 @@ class EventTest extends \PHPUnit_Framework_TestCase { * @depends testDefaultConstruct */ public function testAllDay() { - $event = new Event('test-1'); + $event = new Event('test-1'); + + $event->allDay(false); + $this->assertSame(DateTimeStamp::OUTPUT_UTC, $event->dateFormat); $event->allDay(true); $this->assertSame(DateTimeStamp::OUTPUT_UTC | DateTimeStamp::OUTPUT_NOTIME, $event->dateFormat);
Test setting allDay to false when it isn't set works
rb-cohen_ical-php
train
php
16b5ba217cf9a9c545b52c3e244e1a1179ef9927
diff --git a/src/configs/eslint/core/variables.js b/src/configs/eslint/core/variables.js index <HASH>..<HASH> 100644 --- a/src/configs/eslint/core/variables.js +++ b/src/configs/eslint/core/variables.js @@ -67,6 +67,6 @@ module.exports = { // This rule will warn when it encounters a reference to an identifier that // has not yet been declared. - 'no-use-before-define': 'error', + 'no-use-before-define': ['error', {functions: false}], }, }
Relax lint rule for functions
borela-tech_js-toolbox
train
js
3ef77f490a628e662fe6680718c65c880ec07e55
diff --git a/salt/client/__init__.py b/salt/client/__init__.py index <HASH>..<HASH> 100644 --- a/salt/client/__init__.py +++ b/salt/client/__init__.py @@ -201,7 +201,6 @@ class LocalClient(object): timeout = self.opts['gather_job_timeout'] arg = [jid] - arg = condition_kwarg(arg, kwargs) pub_data = self.run_job(tgt, 'saltutil.find_job', arg=arg,
Stop passing **kwargs to find_job
saltstack_salt
train
py
fe14f13d2c4fd87784f22be74a56314269e6dd50
diff --git a/src/EventRepository.php b/src/EventRepository.php index <HASH>..<HASH> 100644 --- a/src/EventRepository.php +++ b/src/EventRepository.php @@ -410,13 +410,8 @@ class EventRepository implements RepositoryInterface, LoggerAwareInterface $contactInfo = new CultureFeed_Cdb_Data_ContactInfo(); $event->setContactInfo($contactInfo); - $cdbXml = new CultureFeed_Cdb_Default(); - $cdbXml->addItem($event); - $this->createImprovedEntryAPIFromMetadata($metadata) - ->createEvent((string)$cdbXml); - - return $eventCreated->getEventId(); + ->createEvent($event); } /**
III-<I>: Update call to EntryAPI which expects a CultureFeed_Cdb_Item_Event instead of a xml string
cultuurnet_udb3-udb2-bridge
train
php
fb14ac15bcb1db14f756e8943f551ba428de4c7f
diff --git a/dusty/systems/known_hosts/__init__.py b/dusty/systems/known_hosts/__init__.py index <HASH>..<HASH> 100644 --- a/dusty/systems/known_hosts/__init__.py +++ b/dusty/systems/known_hosts/__init__.py @@ -11,6 +11,8 @@ def _get_known_hosts_path(): def ensure_known_hosts(hosts): known_hosts_path = _get_known_hosts_path() + if not os.path.exists(known_hosts_path): + open(known_hosts_path, 'a+').close() modified = False with open(known_hosts_path, 'r+') as f: contents = f.read()
Create required known_hosts file if it does not exists
gamechanger_dusty
train
py
939483db3d3a5eabd2f2efa8215971865f19a743
diff --git a/src/Css/Style.php b/src/Css/Style.php index <HASH>..<HASH> 100644 --- a/src/Css/Style.php +++ b/src/Css/Style.php @@ -555,7 +555,7 @@ class Style static $cache = []; if (!isset($ref_size)) { - $ref_size = self::$default_font_size; + $ref_size = $this->__get("font_size"); } if (!is_array($length)) {
Set default ref size to the current font size Calculations based on font size should be calculated based on the current font size, not the default.
dompdf_dompdf
train
php
77dcac0df58d3d774884bb6efbf85064ae25d88e
diff --git a/blueprints/ember-cli-typescript/index.js b/blueprints/ember-cli-typescript/index.js index <HASH>..<HASH> 100644 --- a/blueprints/ember-cli-typescript/index.js +++ b/blueprints/ember-cli-typescript/index.js @@ -32,7 +32,8 @@ module.exports = { return this.addPackagesToProject([ { name: 'typescript', target: '^2.1' }, { name: '@types/ember', target: '^2.7.41' }, - { name: '@types/rsvp', target: '^3.3.0' } + { name: '@types/rsvp', target: '^3.3.0' }, + { name: '@types/ember-testing-helpers' }, ]); } }
Add @types/ember-testing-helpers to `afterInstall`.
typed-ember_ember-cli-typescript
train
js
a1dd152a88c2be0e0de1809a2ec22cfee1fa0d92
diff --git a/client/controller/shared.js b/client/controller/shared.js index <HASH>..<HASH> 100644 --- a/client/controller/shared.js +++ b/client/controller/shared.js @@ -24,16 +24,12 @@ export function makeLayoutMiddleware( LayoutComponent ) { // On server, only render LoggedOutLayout when logged-out. if ( ! context.isServerSide || ! getCurrentUser( context.store.getState() ) ) { - let redirectUri; - if ( context.isServerSide ) { - redirectUri = `${ context.protocol }://${ context.host }${ context.originalUrl }`; - } context.layout = ( <LayoutComponent store={ store } primary={ primary } secondary={ secondary } - redirectUri={ redirectUri } + redirectUri={ context.originalUrl } /> ); } diff --git a/server/isomorphic-routing/index.js b/server/isomorphic-routing/index.js index <HASH>..<HASH> 100644 --- a/server/isomorphic-routing/index.js +++ b/server/isomorphic-routing/index.js @@ -71,8 +71,6 @@ function getEnhancedContext( req, res ) { pathname: req.path, params: req.params, query: req.query, - protocol: req.protocol, - host: req.headers.host, redirect: res.redirect.bind( res ), res, } );
SSR: Fix reconciliation error on Masterbar login link (#<I>) A recent PR #<I> changed the `redirect_to` arg in masterbar login links to be relative links instead of absolute links generated from window.location.href. For server renders, where there was no access to window, this arg was historically being generated as an absolute link to match. This PR changes the server-generated links to be relative to match the client side, fixing some SSR reconciliation errors.
Automattic_wp-calypso
train
js,js
0d58afb53e9d9a8d1e5ea945f4b3e0d78d672640
diff --git a/src/to-markdown.js b/src/to-markdown.js index <HASH>..<HASH> 100644 --- a/src/to-markdown.js +++ b/src/to-markdown.js @@ -22,7 +22,7 @@ var toMarkdown = function(string) { { patterns: 'br', type: 'void', - replacement: '\n' + replacement: ' \n' }, { patterns: 'h([1-6])',
br should be replaced with two spaces and newline Otherwise, it will be rendered without line break once converted back to html
laurent22_joplin-turndown
train
js
0fe5c90a0583a4bd3e3b3dc3bb3d8c3a98f80d2e
diff --git a/salt/returners/local_cache.py b/salt/returners/local_cache.py index <HASH>..<HASH> 100644 --- a/salt/returners/local_cache.py +++ b/salt/returners/local_cache.py @@ -239,6 +239,7 @@ def save_minions(jid, minions, syndic_id=None): ''' Save/update the serialized list of minions for a given job ''' + minions = list(minions) log.debug( 'Adding minions for job %s%s: %s', jid,
Py3 compat: Force minions to be a list for local serialized caches
saltstack_salt
train
py
5dc06970b5b8ed1fbf26b2ecb4136e885387a668
diff --git a/lfs/credentials.go b/lfs/credentials.go index <HASH>..<HASH> 100644 --- a/lfs/credentials.go +++ b/lfs/credentials.go @@ -17,7 +17,8 @@ type credentialFunc func(Creds, string) (credentialFetcher, error) var execCreds credentialFunc func credentials(u *url.URL) (Creds, error) { - creds := Creds{"protocol": u.Scheme, "host": u.Host, "path": u.Path} + path := strings.TrimPrefix(u.Path, "/") + creds := Creds{"protocol": u.Scheme, "host": u.Host, "path": path} cmd, err := execCreds(creds, "fill") if err != nil { return nil, err
Trim leading slash from the path passed to credential fill
git-lfs_git-lfs
train
go
e6eb36d51120c9e65de0df2efb09acac8ebf6855
diff --git a/classes/Boom/Controller/Cms/Page/Version/Save.php b/classes/Boom/Controller/Cms/Page/Version/Save.php index <HASH>..<HASH> 100644 --- a/classes/Boom/Controller/Cms/Page/Version/Save.php +++ b/classes/Boom/Controller/Cms/Page/Version/Save.php @@ -59,7 +59,9 @@ class Boom_Controller_Cms_Page_Version_Save extends Controller_Cms_Page_Version // Are we saving and publishing the new version? if (isset($post->publish)) { - $this->new_version->set('embargoed_until', $_SERVER['REQUEST_TIME']); + $this->new_version + ->set('embargoed_until', $_SERVER['REQUEST_TIME']) + ->set('published', TRUE); } // Has the page title been changed?
Bugfix: save and publish not publishing a page which hasn't been published before
boomcms_boom-core
train
php
6983ff24da639a15a14bf78aecfb55e0bc052f4a
diff --git a/src/cr/cube/crunch_cube.py b/src/cr/cube/crunch_cube.py index <HASH>..<HASH> 100644 --- a/src/cr/cube/crunch_cube.py +++ b/src/cr/cube/crunch_cube.py @@ -201,6 +201,9 @@ class CrunchCube(object): return res def _mr_prune(self, res): + if len(res.shape) > 2: + # Only perform pruning for 1-D MR cubes. + return res margin = self.margin(axis=0) ind_prune = margin == 0 return res[~ind_prune]
Only prune 1-D MR cubes.
Crunch-io_crunch-cube
train
py
6e18b52c0e4b524dd146740a77f352ced37830fe
diff --git a/conversejs/utils.py b/conversejs/utils.py index <HASH>..<HASH> 100644 --- a/conversejs/utils.py +++ b/conversejs/utils.py @@ -8,8 +8,11 @@ from .register import register_account def get_conversejs_context(context, xmpp_login=False): + + context['CONVERSEJS_ENABLED'] = conf.CONVERSEJS_ENABLED + if not conf.CONVERSEJS_ENABLED: - return {'CONVERSEJS_ENABLED': conf.CONVERSEJS_ENABLED} + return context context.update(conf.get_conversejs_settings())
Fixing bug on CONVERSEJS_ENABLED
TracyWebTech_django-conversejs
train
py
2557f7367dfdef7005e01bec95da3e618c382674
diff --git a/Kwc/Articles/Detail/Component.php b/Kwc/Articles/Detail/Component.php index <HASH>..<HASH> 100644 --- a/Kwc/Articles/Detail/Component.php +++ b/Kwc/Articles/Detail/Component.php @@ -16,7 +16,14 @@ class Kwc_Articles_Detail_Component extends Kwc_Directories_Item_Detail_Componen 'name' => trlKwf('Feedback') ); + $ret['flags']['processInput'] = true; + $ret['editComponents'] = array('content', 'questionsAnswers', 'feedback'); return $ret; } + + public function processInput($input) + { + $this->getData()->row->markRead(); + } }
added processInput for ArticlesDetailComponent to track views from user
koala-framework_koala-framework
train
php
2fbbb576e055268711b12f3612a0013091407cdf
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -56,8 +56,15 @@ setup(name='polyaxon-deploy', install_requires=[ "polyaxon-schemas==0.5.4", ], + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*', classifiers=[ 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'Operating System :: OS Independent', 'Intended Audience :: Developers', 'Intended Audience :: Science/Research',
Add python_requires and Trove classifiers `python_requires` helps pip ensure the correct version of this package is installed for the user's running Python version. `classifiers` help make it clear on <URL>
polyaxon_polyaxon
train
py
3139e0f6451600f3c0a6a9d68f9e277440fd7f66
diff --git a/test/test_mockdata.rb b/test/test_mockdata.rb index <HASH>..<HASH> 100644 --- a/test/test_mockdata.rb +++ b/test/test_mockdata.rb @@ -22,6 +22,12 @@ VCR.configure do |config| # Allow other test suites to send real HTTP requests config.allow_http_connections_when_no_cassette = true + + # + config.before_record { |cassette| cassette.response.body.force_encoding('UTF-8') } + config.filter_sensitive_data('<API_KEY>') { ENV['API_KEY'] } + config.filter_sensitive_data('<API_PWD>') { ENV['API_PWD'] } + config.filter_sensitive_data('<SHOP_NAME>') { ENV['SHOP_NAME'] } end @@ -105,8 +111,6 @@ class TestShopifyDashboardPlus < MiniTest::Test # Will reuse cassette for tests run the same day (in which the URL paramater created_at_min=YYYY-MM-DD will be identical) # Will append a new entry on a new day VCR.use_cassette(:orders_no_paramaters, :record => :new_episodes, :match_requests_on => [:path]) do - - #byebug r = get url assert_equal last_request.fullpath, '/'
Hide API Key and Password from saved test data. Force casettes to store response in plain text, not binary
at1as_Shopify_Dashboard_Plus
train
rb
dec65c07acad0b14a8341c9b039b229ba223289b
diff --git a/src/client/client.js b/src/client/client.js index <HASH>..<HASH> 100644 --- a/src/client/client.js +++ b/src/client/client.js @@ -410,7 +410,8 @@ define([ var i; for (i in state.users) { if (state.users.hasOwnProperty(i)) { - if (typeof state.users[i].UI.reLaunch === 'function') { + if (state.users[i].UI && typeof state.users[i].UI === 'object' && + typeof state.users[i].UI.reLaunch === 'function') { state.users[i].UI.reLaunch(); } } @@ -576,8 +577,7 @@ define([ for (i = 0; i < userIds.length; i++) { if (state.users[userIds[i]]) { events = [{eid: null, etype: 'complete'}]; - for (j in state.users[userIds[i]].PATHS - ) { + for (j in state.users[userIds[i]].PATHS) { events.push({etype: 'unload', eid: j}); } state.users[userIds[i]].PATTERNS = {};
Fixes #<I> make sure UI is not null before accessing relaunch
webgme_webgme-engine
train
js
f47aea5d72b56f788248cd475875c1b89ea065cb
diff --git a/Vps/Component/Generator/Table.php b/Vps/Component/Generator/Table.php index <HASH>..<HASH> 100644 --- a/Vps/Component/Generator/Table.php +++ b/Vps/Component/Generator/Table.php @@ -111,9 +111,6 @@ class Vps_Component_Generator_Table extends Vps_Component_Generator_Abstract $currentPds = $currentPd; } foreach ($currentPds as $currentPd) { - if ($currentPd->componentClass != $this->_class) { - throw new Vps_Exception("_getParentDataByRow returned a component with a wrong componentClass '{$currentPd->componentClass}' instead of '$this->_class'"); - } $data = $this->_createData($currentPd, $row, $s); if ($data) { $ret[] = $data;
remove this safety check, it is valid to get a different componentClass when using alternativeComponentClass
koala-framework_koala-framework
train
php
b621ce7defea9d68e3896b7a56dd11df4a4da16e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ setup( data_files=[( (BASE_DIR, ['data/nssm_original.exe']) )], - install_requires=['indy-plenum-dev==1.6.568', + install_requires=['indy-plenum-dev==1.6.569', 'indy-anoncreds-dev==1.0.32', 'python-dateutil', 'timeout-decorator==0.4.0'],
INDY-<I>: Updated indy-plenum dependency
hyperledger_indy-node
train
py
c306aa1e51a51cd60422f8230a57c9c9c30fa876
diff --git a/fedmsg/meta/base.py b/fedmsg/meta/base.py index <HASH>..<HASH> 100644 --- a/fedmsg/meta/base.py +++ b/fedmsg/meta/base.py @@ -25,6 +25,16 @@ class BaseProcessor(object): """ Base Processor. Without being extended, this doesn't actually handle any messages. + Processors require that an ``internationalization_callable`` be passed to + them at instantiation. Internationalization is often done at import time, + but we handle it at runtime so that a single process may translate fedmsg + messages into multiple languages. Think: an IRC bot that runs + #fedora-fedmsg, #fedora-fedmsg-es, #fedora-fedmsg-it. Or: a twitter bot + that posts to multiple language-specific accounts. + + That feature is currently unused, but fedmsg.meta supports future + internationalization (there may be bugs to work out). + """ # These six properties must be overridden by child-classes.
Add note to fedmsg.meta.base about the internationalization callable.
fedora-infra_fedmsg
train
py
2a3aba9720dd5c2afa717ec30b479402c1058c59
diff --git a/sonar-home/src/main/java/org/sonar/home/cache/FileCache.java b/sonar-home/src/main/java/org/sonar/home/cache/FileCache.java index <HASH>..<HASH> 100644 --- a/sonar-home/src/main/java/org/sonar/home/cache/FileCache.java +++ b/sonar-home/src/main/java/org/sonar/home/cache/FileCache.java @@ -189,7 +189,10 @@ public class FileCache { File tempDir = createTempDir(); ZipUtils.unzip(cachedFile, tempDir, new LibFilter()); try { - FileUtils.moveDirectory(tempDir, destDir); + // Recheck in case of concurrent processes + if (!destDir.exists()) { + FileUtils.moveDirectory(tempDir, destDir); + } } catch (FileExistsException e) { // Ignore as is certainly means a concurrent process has unziped the same file }
SONAR-<I> Improve stability of tests
SonarSource_sonarqube
train
java
07e8ce10c0ade302b6d33defa97de0883aee2f49
diff --git a/lib/share_notify/version.rb b/lib/share_notify/version.rb index <HASH>..<HASH> 100644 --- a/lib/share_notify/version.rb +++ b/lib/share_notify/version.rb @@ -1,4 +1,4 @@ # frozen_string_literal: true module ShareNotify - VERSION = '0.1.0'.freeze + VERSION = '0.1.1'.freeze end
Preparing for <I> release
samvera-labs_share_notify
train
rb
4f6fe7ca5b7790a869d3bd7d6179e04e87daff60
diff --git a/lib/review/latexutils.rb b/lib/review/latexutils.rb index <HASH>..<HASH> 100644 --- a/lib/review/latexutils.rb +++ b/lib/review/latexutils.rb @@ -14,19 +14,19 @@ module ReVIEW module LaTeXUtils MATACHARS = { - '#' => '\symbol{"23}', - "$" => '\symbol{"24}', + '#' => '\#', + "$" => '\textdollar{}', '%' => '\%', '&' => '\&', '{' => '\{', '}' => '\}', - '_' => '\symbol{"5F}', + '_' => '\textunderscore{}', '^' => '\textasciicircum{}', '~' => '\textasciitilde{}', '|' => '\textbar{}', - '<' => '\symbol{"3C}', - '>' => '\symbol{"3E}', - "\\" => '\symbol{"5C}' + '<' => '\textless{}', + '>' => '\textgreater{}', + "\\" => '\textbackslash{}' } METACHARS_RE = /[#{Regexp.escape(MATACHARS.keys.join(''))}]/
change to make escape notatino more readable
kmuto_review
train
rb
d4d66be51af351dab6c4dec093fefb5a18d8cb35
diff --git a/modules/cmsadmin/src/models/Block.php b/modules/cmsadmin/src/models/Block.php index <HASH>..<HASH> 100644 --- a/modules/cmsadmin/src/models/Block.php +++ b/modules/cmsadmin/src/models/Block.php @@ -61,6 +61,11 @@ class Block extends \admin\ngrest\base\Model 'restupdate' => ['class', 'group_id'], ]; } + + public function ngRestGroupByField() + { + return 'group_id'; + } /** * Save id before deleting for clean up in afterDelete()
use group field in blocks model ngrest config.
luyadev_luya
train
php
250613e03ce217de0468418dcef6e579a2a5dafc
diff --git a/lib/tetra/kit.rb b/lib/tetra/kit.rb index <HASH>..<HASH> 100644 --- a/lib/tetra/kit.rb +++ b/lib/tetra/kit.rb @@ -14,7 +14,7 @@ module Tetra def find_executable(name) @project.from_directory do Find.find("kit") do |path| - next unless path =~ %r{(.*bin)/#{name}$} + next unless path =~ %r{(.*bin)/#{name}$} && File.executable?(path) result = Regexp.last_match[1] log.debug("found #{name} executable in #{result}")
Bugfix: ensure executables have correct permissions
moio_tetra
train
rb
d396d2ccbd2967e64989c076763ce15655ff2ed3
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -66,7 +66,7 @@ TextLayout.prototype.update = function(opt) { //the metrics for this text layout this._width = maxLineWidth this._height = height - this._descender = font.common.lineHeight - baseline + this._descender = lineHeight - baseline this._baseline = baseline this._xHeight = getXHeight(font) this._capHeight = getCapHeight(font)
fix for custom lineHeight overrides
Jam3_layout-bmfont-text
train
js
2b7788f2e8d2cf33aca06438915443c5cf9a3fb6
diff --git a/docs/service.go b/docs/service.go index <HASH>..<HASH> 100644 --- a/docs/service.go +++ b/docs/service.go @@ -197,22 +197,6 @@ func (s *Service) LookupEndpoints(repoName string) (endpoints []APIEndpoint, err TrimHostname: true, TLSConfig: tlsConfig, }) - // v1 mirrors - // TODO(tiborvass): shouldn't we remove v1 mirrors from here, since v1 mirrors are kinda special? - for _, mirror := range s.Config.Mirrors { - mirrorTlsConfig, err := s.tlsConfigForMirror(mirror) - if err != nil { - return nil, err - } - endpoints = append(endpoints, APIEndpoint{ - URL: mirror, - // guess mirrors are v1 - Version: APIVersion1, - Mirror: true, - TrimHostname: true, - TLSConfig: mirrorTlsConfig, - }) - } // v1 registry endpoints = append(endpoints, APIEndpoint{ URL: DEFAULT_V1_REGISTRY,
Remove v1 registry mirror configuration from LookupEndpoints. V1 mirrors do not mirror the index and those endpoints should only be indexes.
docker_distribution
train
go
014c304fc95ae4cdaf1c01d598b63a3bf9b8d127
diff --git a/test/helpers/setup.js b/test/helpers/setup.js index <HASH>..<HASH> 100644 --- a/test/helpers/setup.js +++ b/test/helpers/setup.js @@ -46,7 +46,7 @@ function createWebpackConfig(testAppDir, outputDirName = '', command, argv = {}) argv.context = testAppDir; const runtimeConfig = parseRuntime( argv, - __dirname + testAppDir ); const config = new WebpackConfig(runtimeConfig);
Fixing very old bug in tests, where the "cwd" passed to parseRuntime() was wrong This was discovered because the .babelrc file was not being seen, because the cwd was incorrect
symfony_webpack-encore
train
js
3982f8e1a613d45b8aa91ce4c41c48249a6c02d5
diff --git a/lib/bootstrap_forms/form_builder.rb b/lib/bootstrap_forms/form_builder.rb index <HASH>..<HASH> 100644 --- a/lib/bootstrap_forms/form_builder.rb +++ b/lib/bootstrap_forms/form_builder.rb @@ -142,7 +142,7 @@ module BootstrapForms def label_field(&block) required = object.class.validators_on(@name).any? { |v| v.kind_of? ActiveModel::Validations::PresenceValidator } - label(@name, block_given? ? block : @options[:label], :class => 'control-label' + (' required' if required)) + label(@name, block_given? ? block : @options[:label], :class => 'control-label' + (required ? ' required' : '')) end %w(help_inline error success warning help_block append prepend).each do |method_name| @@ -163,4 +163,4 @@ module BootstrapForms super.except(:label, :help_inline, :error, :success, :warning, :help_block, :prepend, :append) end end -end \ No newline at end of file +end
Don't explode for not-required fields. Fixes #8
sethvargo_bootstrap_forms
train
rb
2be0d3897428a79e6e1ff87d9913b7d795f2cc9a
diff --git a/sfmf4j-tests/src/main/java/com/github/sworisbreathing/sfmf4j/test/AbstractSFMF4JTest.java b/sfmf4j-tests/src/main/java/com/github/sworisbreathing/sfmf4j/test/AbstractSFMF4JTest.java index <HASH>..<HASH> 100644 --- a/sfmf4j-tests/src/main/java/com/github/sworisbreathing/sfmf4j/test/AbstractSFMF4JTest.java +++ b/sfmf4j-tests/src/main/java/com/github/sworisbreathing/sfmf4j/test/AbstractSFMF4JTest.java @@ -137,6 +137,18 @@ public abstract class AbstractSFMF4JTest { */ fileMonitor.unregisterDirectoryListener(folder, listener); assertFalse(fileMonitor.isMonitoringDirectory(folder)); + + /* + * Some implementations may have fired multiple events for the same + * operation (i.e. a file change and a file delete), so our lists + * are not guaranteed to be empty at this point. + * + * Now that the listener has been unregistered, we empty the lists + * and then verify that we are no longer receiving events. + */ + createdFiles.clear(); + modifiedFiles.clear(); + deletedFiles.clear(); File createdAfterUnregister = tempFolder.newFile(); assertNull(createdFiles.poll(eventTimeoutDuration(), eventTimeoutTimeUnit())); appendBytesToFile(createdAfterUnregister);
Flushing out the file lists between unregistering the listeners and verifying that we are not receiving events Fixes #1
sworisbreathing_sfmf4j
train
java
5519095e3c4e39964314785af6221bf065a30d78
diff --git a/ErrorHandler.php b/ErrorHandler.php index <HASH>..<HASH> 100644 --- a/ErrorHandler.php +++ b/ErrorHandler.php @@ -230,6 +230,11 @@ class ErrorHandler */ public function handleError($errNo, $errStr, $errFile, $errLine, $errContext = array(), Metadata $metadata = null) { + if (0 === error_reporting()) + { + return $this; + } + $error = new ErrorException($errStr, $errNo, $errFile, $errLine, $errContext); $metadata = $this->getMetadata($metadata, $error); $categories = $metadata->getCategories();
don't do anything when error_reporting === 0
prgTW_error-handler
train
php
d2c12cc274df9d2b2fc99398051134d825158841
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -300,6 +300,13 @@ module.exports = { popSearchPlace: popSearchPlace, popSearchTitle: popSearchTitle, + popSearch: { + person : popSearchPerson, + organization : popSearchOrganization, + place : popSearchPlace, + title : popSearchTitle + } + } /*
feat(api): add popSearch method required by CWRC-WriterBase popSearch is simply a property on the module referring to an object that in turn references the four entity search functions of the API. The CWRC-WriterBase uses this object to lookup the methods by entity type.
cwrc_CWRC-PublicEntityDialogs
train
js
cd52c7e73b8741e0f288b3172187d7e23c0d66d8
diff --git a/closure/goog/a11y/aria/roles.js b/closure/goog/a11y/aria/roles.js index <HASH>..<HASH> 100644 --- a/closure/goog/a11y/aria/roles.js +++ b/closure/goog/a11y/aria/roles.js @@ -196,6 +196,9 @@ goog.a11y.aria.Role = { // ARIA role for a textbox element. TEXTBOX: 'textbox', + // ARIA role for a textinfo element. + TEXTINFO: 'textinfo', + // ARIA role for an element displaying elapsed time or time remaining. TIMER: 'timer',
Fixes various errors in the JsDoc type declarations caught by the compiler ------------- Created by MOE: <URL>
google_closure-library
train
js
2345ddeee41003907c84be52719eeff85cc5e4f8
diff --git a/src/Action/RegisterAction.php b/src/Action/RegisterAction.php index <HASH>..<HASH> 100644 --- a/src/Action/RegisterAction.php +++ b/src/Action/RegisterAction.php @@ -27,6 +27,7 @@ class RegisterAction extends BaseAction 'view' => null, 'viewVar' => null, 'entityKey' => 'entity', + 'redirectUrl' => null, 'api' => [ 'methods' => ['put', 'post'], 'success' => [ @@ -103,7 +104,12 @@ class RegisterAction extends BaseAction $this->_trigger('afterRegister', $subject); $this->setFlash('success', $subject); - return $this->_redirect($subject, '/'); + $redirectUrl = $this->config('redirectUrl'); + if ($redirectUrl === null && $this->_controller()->components()->has('Auth')) { + $redirectUrl = $this->_controller()->Auth->config('loginAction'); + } + + return $this->_redirect($subject, $redirectUrl); } /**
Redirect to login action by default and allow config.
FriendsOfCake_crud-users
train
php
77d624fbb4238288159b004700c17943646c81e4
diff --git a/library/CM/Action/Abstract.php b/library/CM/Action/Abstract.php index <HASH>..<HASH> 100644 --- a/library/CM/Action/Abstract.php +++ b/library/CM/Action/Abstract.php @@ -356,6 +356,21 @@ abstract class CM_Action_Abstract extends CM_Class_Abstract implements CM_ArrayC return $this->getName() . ' ' . $this->getVerbName(); } + protected function _track() { + CM_KissTracking::getInstance()->trackUser($this->getLabel(), $this->getActor(), null, $this->_trackingProperties); + } + + /** + * @param array $properties + */ + protected function _setTrackingProperties(array $properties) { + $this->_trackingProperties = $properties; + } + + protected function _disableTracking() { + $this->_trackingEnabled = false; + } + /** * @param int $type * @param string|null $className
Add tracking feature to CM_Action_Abstract
cargomedia_cm
train
php
08c383012f013ebc8585d24593d5c859f0980a1e
diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index <HASH>..<HASH> 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -78,10 +78,15 @@ func init() { } } - // Check for a clean release build. - exp := regexp.MustCompile(`^v\d+\.\d+\.\d+(-beta[\d\.]+)?$`) + // Check for a clean release build. A release is something like "v0.1.2", + // with an optional suffix of letters and dot separated numbers like + // "-beta3.47". If there's more stuff, like a plus sign and a commit hash + // and so on, then it's not a release. If there's a dash anywhere in + // there, it's some kind of beta or prerelease version. + + exp := regexp.MustCompile(`^v\d+\.\d+\.\d+(-[a-z]+[\d\.]+)?$`) IsRelease = exp.MatchString(Version) - IsBeta = strings.Contains(Version, "beta") + IsBeta = strings.Contains(Version, "-") stamp, _ := strconv.Atoi(BuildStamp) BuildDate = time.Unix(int64(stamp), 0)
Loosen the requirements on what can be upgraded to what
syncthing_syncthing
train
go
bd7cb04afab8a7b2c8f7c712eefaf8cf12b7e30b
diff --git a/lib/adhearsion/initializer.rb b/lib/adhearsion/initializer.rb index <HASH>..<HASH> 100644 --- a/lib/adhearsion/initializer.rb +++ b/lib/adhearsion/initializer.rb @@ -67,20 +67,20 @@ module Adhearsion def update_rails_env_var env = ENV['AHN_ENV'] if env && Adhearsion.config.valid_environment?(env.to_sym) - if ENV['RAILS_ENV'] != env + if ENV['RAILS_ENV'] == env + logger.info "Using the configured value for RAILS_ENV : <#{env}>" + else logger.warn "Updating AHN_RAILS variable to <#{env}>" ENV['RAILS_ENV'] = env - else - logger.info "Using the configured value for RAILS_ENV : <#{env}>" end else env = ENV['RAILS_ENV'] - unless env + if env + logger.info "Using the configured value for RAILS_ENV : <#{env}>" + else env = Adhearsion.config.platform.environment.to_s logger.info "Defining AHN_RAILS variable to <#{env}>" ENV['RAILS_ENV'] = env - else - logger.info "Using the configured value for RAILS_ENV : <#{env}>" end end env
[CS] Double-negatives are evil
adhearsion_adhearsion
train
rb