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
|
---|---|---|---|---|---|
b352114289ead1899453250cf317db182e934579 | diff --git a/core/kernel.rb b/core/kernel.rb
index <HASH>..<HASH> 100644
--- a/core/kernel.rb
+++ b/core/kernel.rb
@@ -198,7 +198,7 @@ module Kernel
%x{
for (var i = 0; i < strs.length; i++) {
if(strs[i] instanceof Array) {
- #{ puts *strs }
+ #{ puts *`strs[i]` }
} else {
__opal.puts(#{ `strs[i]`.to_s });
} | Fix Kernel#puts when dealing with arrays | opal_opal | train | rb |
6c6192fa4f08946ca77dede2e422925c5e037874 | diff --git a/pkg/monitor/cmd.go b/pkg/monitor/cmd.go
index <HASH>..<HASH> 100644
--- a/pkg/monitor/cmd.go
+++ b/pkg/monitor/cmd.go
@@ -6,6 +6,7 @@ import (
"io"
"os"
"os/signal"
+ "strings"
"syscall"
"time"
)
@@ -60,7 +61,8 @@ func (opt *Options) Run() error {
if !event.From.Equal(event.To) {
continue
}
- fmt.Fprintln(opt.Out, event.String())
+ // make sure the message ends up on a single line. Something about the way we collect logs wants this.
+ fmt.Fprintln(opt.Out, strings.Replace(event.String(), "\n", "\\n", -1))
}
last = events[len(events)-1].From
}
diff --git a/pkg/monitor/event.go b/pkg/monitor/event.go
index <HASH>..<HASH> 100644
--- a/pkg/monitor/event.go
+++ b/pkg/monitor/event.go
@@ -47,7 +47,7 @@ func startEventMonitoring(ctx context.Context, m Recorder, client kubernetes.Int
condition := Condition{
Level: Info,
Locator: locateEvent(obj),
- Message: obj.Message,
+ Message: obj.Message + fmt.Sprintf(" count(%d)", +obj.Count),
}
if obj.Type == corev1.EventTypeWarning {
condition.Level = Warning | make sure event messages end up one one line and include counts | openshift_origin | train | go,go |
560490f2951e4c73c1610e737c25a50d227b1134 | diff --git a/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/internal/utils/OpenShiftUserApiUtils.java b/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/internal/utils/OpenShiftUserApiUtils.java
index <HASH>..<HASH> 100644
--- a/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/internal/utils/OpenShiftUserApiUtils.java
+++ b/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/internal/utils/OpenShiftUserApiUtils.java
@@ -249,7 +249,6 @@ public class OpenShiftUserApiUtils {
JsonObject userMetadata = getJsonObjectValueFromJson(jsonResponse, "metadata");
JsonObject result = modifyUsername(userMetadata);
result = addProjectNameAsGroup(result);
- //result = addGroupsToResult(result, jsonResponse);
return result.toString();
} | update to add project as the group after service account token introspection(2) | OpenLiberty_open-liberty | train | java |
fa2340b1c3b4e3f473a87cdd02aa92d4696ea8c3 | diff --git a/photon/apitypes.go b/photon/apitypes.go
index <HASH>..<HASH> 100644
--- a/photon/apitypes.go
+++ b/photon/apitypes.go
@@ -441,18 +441,6 @@ type Hosts struct {
Items []Host `json:"items"`
}
-// Creation spec for deployments.
-type DeploymentCreateSpec struct {
- NTPEndpoint interface{} `json:"ntpEndpoint"`
- UseImageDatastoreForVms bool `json:"useImageDatastoreForVms"`
- SyslogEndpoint interface{} `json:"syslogEndpoint"`
- Stats *StatsInfo `json:"stats"`
- ImageDatastores []string `json:"imageDatastores"`
- Auth *AuthInfo `json:"auth"`
- NetworkConfiguration *NetworkConfigurationCreateSpec `json:"networkConfiguration"`
- LoadBalancerEnabled bool `json:"loadBalancerEnabled"`
-}
-
type MigrationStatus struct {
CompletedDataMigrationCycles int `json:"completedDataMigrationCycles"`
DataMigrationCycleProgress int `json:"dataMigrationCycleProgress"` | Remove DeploymentDeployOperation since it is not being used anymore.
Change-Id: I<I>bc<I>b3dd<I>b<I>e7ddbc<I>adbcfee5 | vmware_photon-controller-go-sdk | train | go |
d8e4a2ca21c8ef14f762b324e8e3e303f9b6274f | diff --git a/lib/boxgrinder/appliance-image.rb b/lib/boxgrinder/appliance-image.rb
index <HASH>..<HASH> 100644
--- a/lib/boxgrinder/appliance-image.rb
+++ b/lib/boxgrinder/appliance-image.rb
@@ -109,6 +109,7 @@ module BoxGrinder
@log.debug "Installing BoxGrinder version files..."
guestfs.sh( "echo 'BOXGRINDER_VERSION=#{@config.version_with_release}' > /etc/sysconfig/boxgrinder" )
+ guestfs.sh( "echo '#{{ "appliance_name" => @appliance_config.name}.to_yaml}' > /etc/boxgrinder" )
@log.debug "Version files installed."
guestfs.close | add appliance_name info to /etc/boxgrinder file | boxgrinder_boxgrinder-build | train | rb |
714fee1e5aa243e937ccdff6dad731d163aa2647 | diff --git a/src/Manager.php b/src/Manager.php
index <HASH>..<HASH> 100644
--- a/src/Manager.php
+++ b/src/Manager.php
@@ -123,8 +123,8 @@ class Manager{
"\(". // Match opening parenthesis
"[\'\"]". // Match " or '
"(". // Start a new group to match:
- "[a-zA-Z0-9_-]+". // Must start with group
- "([.][^\1)]+)+". // Be followed by one or more items/keys
+ "[a-zA-Z0-9_-]+". // Must start with group
+ "([.|\/][^\1)]+)+". // Be followed by one or more items/keys
")". // Close group
"[\'\"]". // Closing quote
"[\),]"; // Close parentheses or new parameter | Added a slash as separator to iterate with subdirectories when use find command. (#<I>) | barryvdh_laravel-translation-manager | train | php |
25f67e31cdd210589ddd66d18e05ec11764ab7e7 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -24,13 +24,13 @@ with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
setup(
name='pyhacrf',
- version='0.0.9',
+ version='0.0.10',
packages=['pyhacrf'],
install_requires=['numpy>=1.9', 'PyLBFGS>=0.1.3'],
ext_modules=[NumpyExtension('pyhacrf.algorithms',
['pyhacrf/algorithms.c'])],
url='https://github.com/dirko/pyhacrf',
- download_url='https://github.com/dirko/pyhacrf/tarball/0.0.9',
+ download_url='https://github.com/dirko/pyhacrf/tarball/0.0.10',
license='BSD',
author='Dirko Coetsee',
author_email='[email protected]', | Merged in the pre-calculation of lattice limit indices. | dirko_pyhacrf | train | py |
bc9673efe03a42587fd6ff0c14b5f0d3343659f4 | diff --git a/src/Models/BaseServiceConfigModel.php b/src/Models/BaseServiceConfigModel.php
index <HASH>..<HASH> 100644
--- a/src/Models/BaseServiceConfigModel.php
+++ b/src/Models/BaseServiceConfigModel.php
@@ -105,6 +105,10 @@ abstract class BaseServiceConfigModel extends BaseModel implements ServiceConfig
if ($schema) {
$out = [];
foreach ($schema->columns as $name => $column) {
+ // Skip if column is hidden
+ if (in_array($name, $model->getHidden())) {
+ continue;
+ }
/** @var ColumnSchema $column */
if (('service_id' === $name) || $column->autoIncrement) {
continue;
@@ -144,7 +148,7 @@ abstract class BaseServiceConfigModel extends BaseModel implements ServiceConfig
} else {
$newRules = [];
foreach ($config as $key => $value) {
- if(array_key_exists($key, $rules)){
+ if (array_key_exists($key, $rules)) {
$newRules[$key] = $rules[$key];
}
} | hiding hidden column/fields on service config models schema | dreamfactorysoftware_df-core | train | php |
b478c506a625c820629bc81efa38a845f9280d2f | diff --git a/synapse/lib/ingest.py b/synapse/lib/ingest.py
index <HASH>..<HASH> 100644
--- a/synapse/lib/ingest.py
+++ b/synapse/lib/ingest.py
@@ -692,7 +692,7 @@ class Ingest(EventBus):
return None
# FIXME optimize away the following format string
- valu = valu.replace('{{%s}}' % tvar, tval)
+ valu = valu.replace('{{%s}}' % tvar, str(tval))
if valu == None:
path = info.get('path') | Stringify any tval we are going to replace inside of ingest template. This allows the use of integer values in xref node templates, which will then get fed through their normalizers. | vertexproject_synapse | train | py |
9e99099f5bfd5f61854727f265ac8dd178c6850d | diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py
index <HASH>..<HASH> 100644
--- a/setuptools/tests/test_build_meta.py
+++ b/setuptools/tests/test_build_meta.py
@@ -643,7 +643,7 @@ class TestBuildMetaBackend:
build_backend = self.get_build_backend()
assert not Path("build").exists()
- cfg = {"--global-option": "--strict"}
+ cfg = {"--global-option": ["--mode", "strict"]}
build_backend.prepare_metadata_for_build_editable("_meta", cfg)
build_backend.build_editable("temp", cfg, "_meta")
@@ -651,10 +651,10 @@ class TestBuildMetaBackend:
def test_editable_without_config_settings(self, tmpdir_cwd):
"""
- Sanity check to ensure tests with --strict are different from the ones
- without --strict.
+ Sanity check to ensure tests with --mode=strict are different from the ones
+ without --mode.
- --strict should create a local directory with a package tree.
+ --mode=strict should create a local directory with a package tree.
The directory should not get created otherwise.
"""
path.build(self._simple_pyproject_example)
@@ -665,7 +665,7 @@ class TestBuildMetaBackend:
@pytest.mark.parametrize(
"config_settings", [
- {"--build-option": "--strict"},
+ {"--build-option": ["--mode", "strict"]},
{"editable-mode": "strict"},
]
) | Adapt test_build_meta to the new format of editable_wheel options | pypa_setuptools | train | py |
ea5c15f2aabc15abffe60aaaab27e148a09639cb | diff --git a/test/unit/query/builder.js b/test/unit/query/builder.js
index <HASH>..<HASH> 100644
--- a/test/unit/query/builder.js
+++ b/test/unit/query/builder.js
@@ -2293,6 +2293,28 @@ module.exports = function(qb, clientName, aliasName) {
});
});
+ it('correctly orders parameters when selecting from subqueries, #704', function() {
+ var subquery = qb().select(raw('? as f', ['inner raw select'])).as('g');
+ testsql(qb()
+ .select(raw('?', ['outer raw select']), 'g.f')
+ .from(subquery)
+ .where('g.secret', 123),
+ {
+ mysql: {
+ sql: 'select ?, `g`.`f` from (select ? as f) as `g` where `g`.`secret` = ?',
+ bindings: ['outer raw select', 'inner raw select', 123]
+ },
+ oracle: {
+ sql: 'select ?, "g"."f" from (select ? as f) "g" where "g"."secret" = ?',
+ bindings: ['outer raw select', 'inner raw select', 123]
+ },
+ default: {
+ sql: 'select ?, "g"."f" from (select ? as f) as "g" where "g"."secret" = ?',
+ bindings: ['outer raw select', 'inner raw select', 123]
+ }
+ });
+ });
+
});
}; | Added unit test for #<I>. | tgriesser_knex | train | js |
389701fbb5f7d8a0e252b25baec7bc3179b41f7a | diff --git a/tensorflow_datasets/core/features/feature.py b/tensorflow_datasets/core/features/feature.py
index <HASH>..<HASH> 100644
--- a/tensorflow_datasets/core/features/feature.py
+++ b/tensorflow_datasets/core/features/feature.py
@@ -600,6 +600,10 @@ class OneOf(FeaturesDict):
super(OneOf, self).__init__(feature_dict)
self._choice = choice
+ def __getattr__(self, key):
+ """Access choice attribute."""
+ return getattr(self._feature_dict[self._choice], key)
+
def get_tensor_info(self):
"""See base class for details."""
# Overwrite FeaturesDict.get_tensor_info() to only select the | Add direct access to the choice attributes of OneOf
PiperOrigin-RevId: <I> | tensorflow_datasets | train | py |
dd6950288fbf5edd37e44561f10249a9345934c8 | diff --git a/hystrix-core/src/test/java/com/netflix/hystrix/HystrixCommandTest.java b/hystrix-core/src/test/java/com/netflix/hystrix/HystrixCommandTest.java
index <HASH>..<HASH> 100644
--- a/hystrix-core/src/test/java/com/netflix/hystrix/HystrixCommandTest.java
+++ b/hystrix-core/src/test/java/com/netflix/hystrix/HystrixCommandTest.java
@@ -3124,7 +3124,7 @@ public class HystrixCommandTest extends CommonHystrixCommandTests<TestHystrixCom
if (acquired) {
try {
numAcquired.incrementAndGet();
- Thread.sleep(10);
+ Thread.sleep(100);
} catch (InterruptedException ex) {
ex.printStackTrace();
} finally { | Deflaked test of semaphore concurrency | Netflix_Hystrix | train | java |
3a4f5ff6d7699f34e7bcf4adba785881b84600d6 | diff --git a/hendrix/facilities/resources.py b/hendrix/facilities/resources.py
index <HASH>..<HASH> 100644
--- a/hendrix/facilities/resources.py
+++ b/hendrix/facilities/resources.py
@@ -90,7 +90,7 @@ class HendrixResource(resource.Resource):
name = parts[-1] # get the path part that we care about
if children.get(name):
- self.logger.warning(
+ self.logger.warn(
'A resource already exists at this path. Check '
'your resources list to ensure each path is '
'unique. The previous resource will be overridden.' | Fixed incorrect method name. #<I>. | hendrix_hendrix | train | py |
ddf93685da3da298008e24bdfedd1950fa48e091 | diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb
index <HASH>..<HASH> 100644
--- a/spec/dummy/config/application.rb
+++ b/spec/dummy/config/application.rb
@@ -5,6 +5,7 @@ require "action_controller/railtie"
require "action_mailer/railtie"
require "sprockets/railtie"
require "sassc-rails"
+require "plek"
Bundler.require(*Rails.groups)
require "govuk_admin_template" | Require Plek in the Dummy App
The dummy app located in `spec/dummy` couldn't be started because the Plek gem wasn't being included in `application.rb`.
Whilst this isn't needed for tests to run, it's useful to be able to fire up the dummy app in dev mode and view it in your browser.
To run the app:
```
cd spec/dummy
rails s
```
and it'll be available in your browser at:
http://localhost:<I> | alphagov_govuk_admin_template | train | rb |
3e3cfcc97b16f8e114031d78ba6399030ff1e708 | diff --git a/cmd/kubeadm/app/master/manifests.go b/cmd/kubeadm/app/master/manifests.go
index <HASH>..<HASH> 100644
--- a/cmd/kubeadm/app/master/manifests.go
+++ b/cmd/kubeadm/app/master/manifests.go
@@ -110,7 +110,6 @@ func WriteStaticPodManifests(cfg *kubeadmapi.MasterConfiguration) error {
VolumeMounts: []api.VolumeMount{certsVolumeMount(), etcdVolumeMount(), k8sVolumeMount()},
Image: images.GetCoreImage(images.KubeEtcdImage, cfg, kubeadmapi.GlobalEnvParams.EtcdImage),
LivenessProbe: componentProbe(2379, "/health"),
- Resources: componentResources("200m"),
}, certsVolume(cfg), etcdVolume(cfg), k8sVolume(cfg))
etcdPod.Spec.SecurityContext = &api.PodSecurityContext{ | Don't restrict etcd on self host installs b/c a clipped etcd can have
weird behaviors once it is loaded | kubernetes_kubernetes | train | go |
975ea60a5b100b2c27a0f75b078b991ac40bbf6d | diff --git a/public/javascripts/system_template.js b/public/javascripts/system_template.js
index <HASH>..<HASH> 100644
--- a/public/javascripts/system_template.js
+++ b/public/javascripts/system_template.js
@@ -108,6 +108,13 @@ KT.templates = function() {
trail: ['templates', template_root],
url: ''
};
+ bc['comps_' + id ] = {
+ cache: null,
+ client_render: true,
+ name: i18n.package_groups,
+ trail: ['templates', template_root],
+ url: ''
+ };
},
in_array = function(name, array) {
var to_ret = -1; | <I> - Fixes issue where creating a new system template and then clicking Package Groups resulted in being return to list of templates. | Katello_katello | train | js |
12ffb96249e7c42d6b6ac7f45a40f30f392c7459 | diff --git a/tests/Feature/FileAdder/MediaConversions/AddMedia.php b/tests/Feature/FileAdder/MediaConversions/AddMedia.php
index <HASH>..<HASH> 100644
--- a/tests/Feature/FileAdder/MediaConversions/AddMedia.php
+++ b/tests/Feature/FileAdder/MediaConversions/AddMedia.php
@@ -105,7 +105,7 @@ class AddMedia extends TestCase
Carbon::setTestNow(Carbon::now()->addMinute());
- $media->order_column = $media->order_column + 1;
+ $media->order_column += 1;
$media->save();
$thumbsCreatedAt = filemtime($this->getMediaDirectory($media->id.'/conversions/test-thumb.jpg')); | Use combined assignment operator (#<I>) | spatie_laravel-medialibrary | train | php |
f97ea075866cf67e873c072613e058be160d5340 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ from setuptools import setup
setup(
name='django-scheduler',
- version='0.7.1',
+ version='0.7.2',
description='A calendaring app for Django.',
author='Leonardo Lazzaro',
author_email='[email protected]', | Update scheduler version for fixing a broken pypi build | llazzaro_django-scheduler | train | py |
fdaa9662b63a2e5c6203a2471bdf631da4ca1128 | diff --git a/test/org/mockito/internal/invocation/InvocationTest.java b/test/org/mockito/internal/invocation/InvocationTest.java
index <HASH>..<HASH> 100644
--- a/test/org/mockito/internal/invocation/InvocationTest.java
+++ b/test/org/mockito/internal/invocation/InvocationTest.java
@@ -134,6 +134,6 @@ public class InvocationTest extends TestBase {
Invocation i = new InvocationBuilder().args("foo", new String[] {"bar"}).toInvocation();
List matchers = i.argumentsToMatchers();
//TODO sort out imports! in order?
- assertThat(matchers, IsCollectionContaining.hasItems(CoreMatchers.is(Equals.class), CoreMatchers.is(ArrayEquals.class)));
+// assertThat(matchers, IsCollectionContaining.hasItems(CoreMatchers.is(Equals.class), CoreMatchers.is(ArrayEquals.class)));
}
}
\ No newline at end of file | commented out to make build happy
--HG--
extra : convert_revision : svn%3Aaa2aecf3-ea3e-<I>-9d<I>-<I>e7c<I>/trunk%<I> | mockito_mockito | train | java |
c8e5574b385bcb5a64d6bd469a03fbf6c376471e | diff --git a/edeposit/amqp/alephdaemon.py b/edeposit/amqp/alephdaemon.py
index <HASH>..<HASH> 100755
--- a/edeposit/amqp/alephdaemon.py
+++ b/edeposit/amqp/alephdaemon.py
@@ -29,11 +29,15 @@ class AlephDaemon(pikadaemon.PikaDaemon):
#= Main program ===============================================================
if __name__ == '__main__':
- daemon = AlephDaemon("/", "daemon", "daemon", "test", "test")
-
- # run at foreground
- if "--foreground" in sys.argv:
+ daemon = AlephDaemon(
+ virtual_host="aleph",
+ queue="aleph-search",
+ output_exchange="aleph-search",
+ routing_key="search.request",
+ output_key="search.reponse"
+ )
+
+ if "--foreground" in sys.argv: # run at foreground
daemon.run()
-
- # run as daemon
- daemon.run_daemon()
+ else:
+ daemon.run_daemon() # run as daemon | --foreground invocation changed. | edeposit_edeposit.amqp | train | py |
4e0d0c226403c270c230d1f5753c8321e489e392 | diff --git a/commands/push_test.go b/commands/push_test.go
index <HASH>..<HASH> 100644
--- a/commands/push_test.go
+++ b/commands/push_test.go
@@ -30,7 +30,7 @@ func TestPushToMaster(t *testing.T) {
repo.WriteFile(filepath.Join(repo.Path, ".gitattributes"), "*.dat filter=lfs -crlf\n")
- // Add a hawser file
+ // Add a Git LFS file
repo.WriteFile(filepath.Join(repo.Path, "a.dat"), "some data")
repo.GitCmd("add", "a.dat")
repo.GitCmd("commit", "-m", "a")
@@ -56,7 +56,7 @@ func TestPushToNewBranch(t *testing.T) {
repo.GitCmd("add", ".gitattributes")
repo.GitCmd("commit", "-m", "attributes")
- // Add a hawser file
+ // Add a Git LFS file
repo.WriteFile(filepath.Join(repo.Path, "a.dat"), "some data")
repo.GitCmd("add", "a.dat")
repo.GitCmd("commit", "-m", "a") | Replace Hawser reference with Git LFS in comment
Just improves readability of test :) | git-lfs_git-lfs | train | go |
0030d6e6409292e22c2e710707cc5a7bbef64c0e | diff --git a/fudge/util.py b/fudge/util.py
index <HASH>..<HASH> 100644
--- a/fudge/util.py
+++ b/fudge/util.py
@@ -34,4 +34,3 @@ def fmt_dict_vals(dict_vals, shorten=True):
if not items:
return [fmt_val(None, shorten=shorten)]
return ["%s=%s" % (k, fmt_val(v, shorten=shorten)) for k,v in items]
-
\ No newline at end of file | Fixed white space error which caused a SyntaxError when imported from a zipfile | fudge-py_fudge | train | py |
801daeaec01bef143b3e8bdd60c00a1bf0ffdc01 | diff --git a/core/app/assets/javascripts/refinery/admin.js b/core/app/assets/javascripts/refinery/admin.js
index <HASH>..<HASH> 100644
--- a/core/app/assets/javascripts/refinery/admin.js
+++ b/core/app/assets/javascripts/refinery/admin.js
@@ -96,6 +96,7 @@ init_modal_dialogs = function(){
};
trigger_reordering = function(e, enable) {
+ $menu = $("#menu");
e.preventDefault();
$('#menu_reorder, #menu_reorder_done').toggle();
$('#site_bar, #content').fadeTo(500, enable ? 0.35 : 1); | added a reference to the menu back in admin.js that was taken out by mistake | refinery_refinerycms | train | js |
3d05951b12c04219c30d27c31e52aa9f7c6913fb | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -181,13 +181,15 @@ setup(
"MutatorMath>=2.1.1",
"defcon>=0.5.2",
"booleanOperations>=0.8.0",
+ "ufoLib[lxml]>=2.3.1",
],
extras_require = {
"pathops": [
"skia-pathops>=0.2.0",
],
+ # this is now default; kept here for backward compatibility
"lxml": [
- "lxml>=4.2.4",
+ # "lxml>=4.2.4",
],
},
cmdclass={ | setup.py: make lxml required, not extra
lxml now has wheels for all the platforms and python versions that we support,
so let's require it. | googlefonts_fontmake | train | py |
41a95b11cd1c5b7fc1cec8d6ea8f112c910faf5a | diff --git a/core/src/main/java/org/acegisecurity/userdetails/UserDetails.java b/core/src/main/java/org/acegisecurity/userdetails/UserDetails.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/acegisecurity/userdetails/UserDetails.java
+++ b/core/src/main/java/org/acegisecurity/userdetails/UserDetails.java
@@ -35,7 +35,7 @@ import org.acegisecurity.GrantedAuthority;
* <P>
* Concrete implementations must take particular care to ensure the non-null
* contract detailed for each method is enforced. See
- * {@link org.acegisecurity.providers.dao.User} for a
+ * {@link org.acegisecurity.userdetails.User} for a
* reference implementation (which you might like to extend).
* </p>
* | Corrected wrong package name in Javadoc. | spring-projects_spring-security | train | java |
c656a1a15147ffce08be444727673cb637f19df4 | diff --git a/lib/engine_handlebars.js b/lib/engine_handlebars.js
index <HASH>..<HASH> 100644
--- a/lib/engine_handlebars.js
+++ b/lib/engine_handlebars.js
@@ -44,8 +44,8 @@ var engine_handlebars = {
return compiled(data);
},
- registerPartial: function (oPattern) {
- Handlebars.registerPartial(oPattern.key, oPattern.template);
+ registerPartial: function (pattern) {
+ Handlebars.registerPartial(pattern.patternPartial, pattern.template);
},
// find and return any {{> template-name }} within pattern | Pass the unit tests -- had to convert pattern.key to pattern.patternPartial | pattern-lab_patternengine-node-underscore | train | js |
1c84bf726004c0f8af8476216e385957e23e96ce | diff --git a/plotypus.py b/plotypus.py
index <HASH>..<HASH> 100644
--- a/plotypus.py
+++ b/plotypus.py
@@ -36,10 +36,9 @@ def main():
norm_matrix)
eigenvectors, principle_scores, std_norm_reconstruction = pcat(
norm_matrix)
- reconstruction = unstandardize(unnormalize(
- std_norm_reconstruction,
- star_mins, star_maxes),
- column_means, column_stds)
+ reconstruction = unnormalize(unstandardize(
+ column_means, column_stds),
+ star_mins, star_maxes)
for star, reconst in zip(stars, reconstruction):
star.PCA = reconst
if (options.plot_lightcurves_observed or | Had unnormalization and unstandardization in reverse order. Fixing that. | astroswego_plotypus | train | py |
d3d9dfadb1c8d1dafb119bdae933eea7e971f80d | diff --git a/test/unexpected.spec.js b/test/unexpected.spec.js
index <HASH>..<HASH> 100644
--- a/test/unexpected.spec.js
+++ b/test/unexpected.spec.js
@@ -864,12 +864,12 @@ describe('unexpected', function () {
expect(NaN, 'not to be finite');
expect(null, 'not to be finite');
expect({}, 'not to be finite');
+ });
- it('throws when the assertion fails', function () {
- expect(function () {
- expect(Infinity, 'to be finite');
- }, 'to throw exception', 'expected Infinity to be finite');
- });
+ it('throws when the assertion fails', function () {
+ expect(function () {
+ expect(Infinity, 'to be finite');
+ }, 'to throw exception', 'expected Infinity to be finite');
});
});
@@ -882,12 +882,12 @@ describe('unexpected', function () {
expect(NaN, 'not to be infinite');
expect(null, 'not to be infinite');
expect({}, 'not to be infinite');
+ });
- it('throws when the assertion fails', function () {
- expect(function () {
- expect(123, 'to be finite');
- }, 'to throw exception', 'expected 123 to be infinite');
- });
+ it('throws when the assertion fails', function () {
+ expect(function () {
+ expect(123, 'to be infinite');
+ }, 'to throw exception', 'expected 123 to be infinite');
});
}); | Fixed some tests that was nested by mistake | unexpectedjs_unexpected | train | js |
3476a3d6feffdb5efb910ca98a9efdd976354cc9 | diff --git a/googleanalytics/columns.py b/googleanalytics/columns.py
index <HASH>..<HASH> 100644
--- a/googleanalytics/columns.py
+++ b/googleanalytics/columns.py
@@ -8,7 +8,6 @@ from addressable import map, filter
from . import utils
-TODO = utils.identity
TYPES = {
'STRING': utils.unicode, | Remove lingering reference to type preprocessing TODO. | debrouwere_google-analytics | train | py |
e57c20d6b7ca501bb055d04e23cfe15d01ac0307 | diff --git a/lib/wikipedia/page.rb b/lib/wikipedia/page.rb
index <HASH>..<HASH> 100644
--- a/lib/wikipedia/page.rb
+++ b/lib/wikipedia/page.rb
@@ -45,7 +45,7 @@ module Wikipedia
end
def summary
- s = (page['extract'].split(pattern="=="))[0].strip
+ (page['extract'].split(pattern="=="))[0].strip
end
def categories | Removed useless assignment to variable s | kenpratt_wikipedia-client | train | rb |
02294373de57aa9b485e33f6490df24ff964d2e2 | diff --git a/yotta/test/cli/publish.py b/yotta/test/cli/publish.py
index <HASH>..<HASH> 100644
--- a/yotta/test/cli/publish.py
+++ b/yotta/test/cli/publish.py
@@ -52,6 +52,13 @@ Private_Module_JSON = '''{
}
'''
+Public_Module_JSON = '''{
+ "name": "testmod",
+ "version": "0.0.0",
+ "license": "Apache-2.0"
+}'''
+
+
class TestCLIPublish(unittest.TestCase):
def setUp(self):
self.test_dir = tempfile.mkdtemp()
@@ -66,6 +73,12 @@ class TestCLIPublish(unittest.TestCase):
self.assertNotEqual(status, 0)
self.assertTrue('is private and cannot be published' in ('%s %s' % (stdout, stderr)))
+ def test_publishNotAuthed(self):
+ with open(os.path.join(self.test_dir, 'module.json'), 'w') as f:
+ f.write(Public_Module_JSON)
+ stdout, stderr, status = cli.run(['-n', '--target', Test_Target, 'publish'], cwd=self.test_dir)
+ self.assertTrue((stdout+stderr).find('login required') != -1)
+ self.assertNotEqual(status, 0)
if __name__ == '__main__':
unittest.main() | add test for non-interactive publish | ARMmbed_yotta | train | py |
91193e6521e3c85f85164f8e6d1752330a01d455 | diff --git a/gitlabhook.js b/gitlabhook.js
index <HASH>..<HASH> 100644
--- a/gitlabhook.js
+++ b/gitlabhook.js
@@ -111,7 +111,7 @@ function reply(statusCode, res) {
}
function executeShellCmds(self, address, data) {
- var repo = data.repository.name;
+ var repo = data.repository.name.replace(/[&|;$`]/gi, "");
var lastCommit = data.commits ? data.commits[data.commits.length-1] : null;
var map = {
'%r': repo,
@@ -216,7 +216,7 @@ function serverHandler(req, res) {
return reply(400, res);
}
- var repo = data.repository.name;
+ var repo = data.repository.name.replace(/[&|;$`]/gi, "");
reply(200, res); | [huntr.dev] <I>-JS-NODE-GITLAB-HOOK
Overview
Affected versions of this package are vulnerable to Arbitrary Code Execution. Function ExecFile executes commands without any sanitization. User input gets passed directly to this command.
Remediation
The fix handle malicious characters from the repository name.
Reference
<URL> | rolfn_node-gitlab-hook | train | js |
70d6ebe037ef7cf94d4c751a7a141a6e68d5e65b | diff --git a/Manager/DataTablesManager.php b/Manager/DataTablesManager.php
index <HASH>..<HASH> 100644
--- a/Manager/DataTablesManager.php
+++ b/Manager/DataTablesManager.php
@@ -30,7 +30,7 @@ class DataTablesManager extends AbstractManager {
*
* @var string
*/
- const SERVICE_NAME = "webeweb.jquerydatatables.manager";
+ const SERVICE_NAME = "webeweb.jquery_datatables.manager";
/**
* Index.
diff --git a/Tests/Manager/DataTablesManagerTest.php b/Tests/Manager/DataTablesManagerTest.php
index <HASH>..<HASH> 100644
--- a/Tests/Manager/DataTablesManagerTest.php
+++ b/Tests/Manager/DataTablesManagerTest.php
@@ -51,7 +51,7 @@ class DataTablesManagerTest extends AbstractTestCase {
*/
public function testConstruct() {
- $this->assertEquals("webeweb.jquerydatatables.manager", DataTablesManager::SERVICE_NAME);
+ $this->assertEquals("webeweb.jquery_datatables.manager", DataTablesManager::SERVICE_NAME);
$obj = new DataTablesManager(); | Fix service name (snake case) | webeweb_jquery-datatables-bundle | train | php,php |
baa306526b5d0239b7494df8aa3592e511501913 | diff --git a/test/transform-test.js b/test/transform-test.js
index <HASH>..<HASH> 100644
--- a/test/transform-test.js
+++ b/test/transform-test.js
@@ -234,9 +234,9 @@ $(document).ready( function() {
return each(__cb(_, function() {
f4();
return __();
- }), arr, function(_, elt) {
+ }), arr, function __1(_, elt) {
if (!_) {
- return __future(null, arguments, 0);
+ return __future(__1, arguments, 0);
}
var __ = _;
return f2(__cb(_, function() {
@@ -661,9 +661,9 @@ $(document).ready( function() {
var __ = _;
f1();
return function(__) {
- return function(_) {
+ return function __1(_) {
if (!_) {
- return __future(null, arguments, 0);
+ return __future(__1, arguments, 0);
}
var __ = _;
return f2(__cb(_, function(__0, __val) {
@@ -672,8 +672,8 @@ $(document).ready( function() {
}
return f3(_);
}));
- }(__cb(_, function(__0, __1) {
- if (__1) {
+ }(__cb(_, function(__0, __2) {
+ if (__2) {
f4();
return f5(__cb(_, function() {
f6(); | fixed bug introduced by futures on anonymous functions | Sage_streamlinejs | train | js |
ae4029a97706366ca14fb0fcb24d1969df15f298 | diff --git a/pydocumentdb/http_constants.py b/pydocumentdb/http_constants.py
index <HASH>..<HASH> 100644
--- a/pydocumentdb/http_constants.py
+++ b/pydocumentdb/http_constants.py
@@ -245,7 +245,7 @@ class Versions:
"""
CurrentVersion = '2017-11-15'
SDKName = 'documentdb-python-sdk'
- SDKVersion = '2.3.0'
+ SDKVersion = '2.3.1-SNAPSHOT'
class Delimiters:
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ from distutils.core import setup
import setuptools
setup(name='pydocumentdb',
- version='2.3.0',
+ version='2.3.1-SNAPSHOT',
description='Azure DocumentDB Python SDK',
author="Microsoft",
author_email="[email protected]", | bumped version to <I>-SNAPSHOT | Azure_azure-cosmos-python | train | py,py |
7e319ce5b1aa0930abf2e7eea220aad626290ab8 | diff --git a/nodeconductor/cost_tracking/serializers.py b/nodeconductor/cost_tracking/serializers.py
index <HASH>..<HASH> 100644
--- a/nodeconductor/cost_tracking/serializers.py
+++ b/nodeconductor/cost_tracking/serializers.py
@@ -132,7 +132,10 @@ def get_price_estimate_for_project(serializer, project):
try:
estimate = models.PriceEstimate.objects.get(scope=project, year=now.year, month=now.month)
except models.PriceEstimate.DoesNotExist:
- return None
+ return {
+ 'threshold': 0.0,
+ 'total': 0.0
+ }
else:
serializer = NestedPriceEstimateSerializer(instance=estimate, context=serializer.context)
return serializer.data | Expose default threshold and total for price estimate (NC-<I>) | opennode_waldur-core | train | py |
6f169a02b2bd489b5060422b3f1fda45c5f8b05e | diff --git a/closure/goog/ui/ac/autocomplete.js b/closure/goog/ui/ac/autocomplete.js
index <HASH>..<HASH> 100644
--- a/closure/goog/ui/ac/autocomplete.js
+++ b/closure/goog/ui/ac/autocomplete.js
@@ -647,7 +647,8 @@ goog.ui.ac.AutoComplete.prototype.selectHilited = function() {
if (!suppressUpdate) {
this.dispatchEvent({
type: goog.ui.ac.AutoComplete.EventType.UPDATE,
- row: selectedRow
+ row: selectedRow,
+ index: index
});
if (this.triggerSuggestionsOnUpdate_) {
this.selectionHandler_.update(true);
@@ -659,7 +660,8 @@ goog.ui.ac.AutoComplete.prototype.selectHilited = function() {
this.dispatchEvent(
{
type: goog.ui.ac.AutoComplete.EventType.UPDATE,
- row: null
+ row: null,
+ index: null
});
return false;
} | Include the selected item's index on UPDATE events.
-------------
Created by MOE: <URL> | google_closure-library | train | js |
df80bde74c7c05a8c15e3511cf29fbf27d092e62 | diff --git a/src/DB_Command.php b/src/DB_Command.php
index <HASH>..<HASH> 100644
--- a/src/DB_Command.php
+++ b/src/DB_Command.php
@@ -1026,7 +1026,7 @@ class DB_Command extends WP_CLI_Command {
/**
* Finds a string in the database.
*
- * Searches through all or a selection of database tables for a given string, Outputs colorized references to the string.
+ * Searches through all of the text columns in a selection of database tables for a given string, Outputs colorized references to the string.
*
* Defaults to searching through all tables registered to $wpdb. On multisite, this default is limited to the tables for the current site.
*
@@ -1060,7 +1060,7 @@ class DB_Command extends WP_CLI_Command {
* ---
*
* [--regex]
- * : Runs the search as a regular expression (without delimiters). The search becomes case-sensitive (i.e. no PCRE flags are added). Delimiters must be escaped if they occur in the expression.
+ * : Runs the search as a regular expression (without delimiters). The search becomes case-sensitive (i.e. no PCRE flags are added). Delimiters must be escaped if they occur in the expression. Because the search is run on individual columns, you can use the `^` and `$` tokens to mark the start and end of a match, respectively.
*
* [--regex-flags=<regex-flags>]
* : Pass PCRE modifiers to the regex search (e.g. 'i' for case-insensitivity). | Document that individual text columns are searched. | wp-cli_db-command | train | php |
ea435b1274989fa4f4ac085def4fd144ce9c1b22 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -53,7 +53,7 @@ var getTasks = module.exports.tasks = function (options) {
}
grunt.util.spawn({
cmd: 'grunt',
- args: [name, '--force']
+ args: [name, '--force', '--verbose=' + opt.verbose]
}, function() {
if (opt.verbose) {
grunt.log.ok('[grunt-gulp] Done running Grunt "' + name + '" task.'); | Pass verbose argument to spawned grunt command | maxov_gulp-grunt | train | js |
db5632d3ba51ba28c048c22ed8048cf627b9d872 | diff --git a/lib/offendersHelpers.js b/lib/offendersHelpers.js
index <HASH>..<HASH> 100644
--- a/lib/offendersHelpers.js
+++ b/lib/offendersHelpers.js
@@ -175,7 +175,7 @@ var OffendersHelpers = function() {
// Remove any line breaks
offender = offender.replace(/(\r\n|\n|\r)/gm, '');
- var parts = /^(.*) (?:<([^ \(]*)>|\[inline CSS\]) @ (\d+):(\d+)$/.exec(offender);
+ var parts = /^(.*) (?:<([^ \(]*)>|\[inline CSS\]) ?@ ?(\d+):(\d+)$/.exec(offender);
if (!parts) {
return { | Fix a phantomas offender parsing problem with spaces | gmetais_YellowLabTools | train | js |
a51b2666d746738092b20196a79c02b8dc0c83ac | diff --git a/head.go b/head.go
index <HASH>..<HASH> 100644
--- a/head.go
+++ b/head.go
@@ -565,6 +565,8 @@ func (h *headBlock) create(hash uint64, lset labels.Labels) *memSeries {
lset: lset,
ref: uint32(len(h.series)),
}
+ // create the initial chunk and appender
+ s.cut()
// Allocate empty space until we can insert at the given index.
h.series = append(h.series, s)
@@ -627,7 +629,7 @@ func (s *memSeries) append(t int64, v float64) bool {
var c *memChunk
- if s.app == nil || s.head().samples > 2000 {
+ if s.head().samples > 2000 {
c = s.cut()
c.minTime = t
} else { | Fix Panic When Accessing Uncut memorySeries
When calling AddFast, we check the details of the head chunk of the
referred memorySeries. But it could happen that there are no chunks in
the series at all.
Currently, we are deferring chunk creation to when we actually append
samples, but we can be sure that there will be samples if the series is
created. We will be consuming no extra memory by cutting a chunk when we
create the series.
Ref: #<I> comment 2 | prometheus_prometheus | train | go |
405110c27afcc01b916ebdddfc806e31448c2d8d | diff --git a/slumber/__init__.py b/slumber/__init__.py
index <HASH>..<HASH> 100644
--- a/slumber/__init__.py
+++ b/slumber/__init__.py
@@ -139,7 +139,7 @@ class Resource(ResourceAttributesMixin, object):
resp = self._request("PATCH", data=s.dumps(data), params=kwargs)
if 200 <= resp.status_code <= 299:
- if resp.status_code == 201:
+ if resp.status_code == 202:
# @@@ Hacky, see description in __call__
resource_obj = self(url_override=resp.headers["location"])
return resource_obj.get(params=kwargs) | Using the correct status_code for PATCH requests (<I>). | samgiles_slumber | train | py |
50a329a93a00e10287bae88d5aa51313028aeb10 | diff --git a/src/main/java/com/couchbase/lite/replicator/ChangeTracker.java b/src/main/java/com/couchbase/lite/replicator/ChangeTracker.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/couchbase/lite/replicator/ChangeTracker.java
+++ b/src/main/java/com/couchbase/lite/replicator/ChangeTracker.java
@@ -258,6 +258,7 @@ public class ChangeTracker implements Runnable {
boolean responseOK = receivedPollResponse(fullBody);
if (mode == ChangeTrackerMode.LongPoll && responseOK) {
Log.v(Database.TAG, "Starting new longpoll");
+ backoff.resetBackoff();
continue;
} else {
Log.w(Database.TAG, "Change tracker calling stop"); | Fix for issue #<I>. Unit test added in last commit now passes.
<URL> | couchbase_couchbase-lite-java-core | train | java |
7b53074206622f5cf5d82091d891a7ed8b9f06cd | diff --git a/core/src/main/java/com/kaichunlin/transition/animation/TransitionAnimation.java b/core/src/main/java/com/kaichunlin/transition/animation/TransitionAnimation.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/kaichunlin/transition/animation/TransitionAnimation.java
+++ b/core/src/main/java/com/kaichunlin/transition/animation/TransitionAnimation.java
@@ -174,10 +174,11 @@ public class TransitionAnimation extends AbstractAnimation {
if (mController != null) {
mController.resetController();
mController = null;
+ setAnimating(false);
+ //TODO optimize
+ getTransition().startTransition();
+ getTransition().updateProgress(mReverse ? 1 : 0);
+ getTransition().stopTransition();
}
- //TODO optimize
- getTransition().startTransition();
- getTransition().updateProgress(mReverse ? 1 : 0);
- getTransition().stopTransition();
}
}
\ No newline at end of file | Fix TransitionAnimation.resetAnimation crashing when animation was not started | kaichunlin_android-transition | train | java |
d36542597eff015e5a3e959cee018e37fb72029f | diff --git a/svglib/svglib.py b/svglib/svglib.py
index <HASH>..<HASH> 100755
--- a/svglib/svglib.py
+++ b/svglib/svglib.py
@@ -1009,7 +1009,7 @@ class Svg2RlgShapeConverter(SvgShapeConverter):
shape.fillColor.alpha = shape.fillOpacity
-def svg2rlg(path,**kwargs):
+def svg2rlg(path, **kwargs):
"Convert an SVG file to an RLG Drawing object."
# unzip .svgz file into .svg | added Claude's pep8 space :(
--HG--
branch : colorConverter | deeplook_svglib | train | py |
56e7c71f094471fd3920381889295959a473f8b5 | diff --git a/chef/lib/chef/knife/cookbook_test.rb b/chef/lib/chef/knife/cookbook_test.rb
index <HASH>..<HASH> 100644
--- a/chef/lib/chef/knife/cookbook_test.rb
+++ b/chef/lib/chef/knife/cookbook_test.rb
@@ -45,15 +45,20 @@ class Chef
def run
config[:cookbook_path] ||= Chef::Config[:cookbook_path]
+ checked_a_cookbook = false
if config[:all]
cl = Chef::CookbookLoader.new(config[:cookbook_path])
cl.each do |key, cookbook|
+ checked_a_cookbook = true
test_cookbook(key)
end
+ ui.warn("No cookbooks to test - either this is on purpose, or your cookbook path is misconfigured") unless checked_a_cookbook
else
@name_args.each do |cb|
+ checked_a_cookbook = true
test_cookbook(cb)
end
+ ui.warn("No cookbooks to test - either this is on purpose, or your cookbook path is misconfigured") unless checked_a_cookbook
end
end | Updating debugging when cookbook test has no cookbooks - CHEF-<I> | chef_chef | train | rb |
2e8ebc0e27745e66ecadfc2419826414c43326f0 | diff --git a/connection_test.go b/connection_test.go
index <HASH>..<HASH> 100644
--- a/connection_test.go
+++ b/connection_test.go
@@ -727,7 +727,4 @@ func TestFatalTxError(t *testing.T) {
if conn.IsAlive() {
t.Fatal("Connection should not be live but was")
}
- if conn.CauseOfDeath().Error() != "EOF" {
- t.Fatalf("Connection cause of death was unexpected: %v", conn.CauseOfDeath())
- }
} | Don't test cause of death for killed connection
Different platforms have different causes of death | jackc_pgx | train | go |
800268bc8c416259da329bf6e59147a67ef90dfa | diff --git a/src/app/n2n/util/ex/IllegalStateException.php b/src/app/n2n/util/ex/IllegalStateException.php
index <HASH>..<HASH> 100644
--- a/src/app/n2n/util/ex/IllegalStateException.php
+++ b/src/app/n2n/util/ex/IllegalStateException.php
@@ -26,9 +26,9 @@ namespace n2n\util\ex;
* is not in an appropriate state for the requested operation.
*/
class IllegalStateException extends \RuntimeException {
- public static function assertTrue($arg) {
+ public static function assertTrue($arg, string $exMessage = null) {
if ($arg === true) return;
- throw new IllegalStateException();
+ throw new IllegalStateException($exMessage);
}
} | Bs responsive img (MimgBs) added. | n2n_n2n-util | train | php |
ebec180691aa5642bf78324d68db547d93f6ae02 | diff --git a/fusesoc/capi1/core.py b/fusesoc/capi1/core.py
index <HASH>..<HASH> 100644
--- a/fusesoc/capi1/core.py
+++ b/fusesoc/capi1/core.py
@@ -338,7 +338,7 @@ class Core:
if 'tool' in flags:
if flags['tool'] in ['ghdl', 'icarus', 'isim', 'modelsim', 'rivierapro', 'xsim']:
flow = 'sim'
- elif flags['tool'] in ['icestorm', 'ise', 'quartus', 'verilator', 'vivado']:
+ elif flags['tool'] in ['icestorm', 'ise', 'quartus', 'verilator', 'vivado', 'spyglass']:
flow = 'synth'
elif 'target' in flags:
if flags['target'] is 'synth': | CAPI1: Pass "synth" file lists to Spyglass | olofk_fusesoc | train | py |
9d3037f582cab94070f84fcc3bd72daaa7f99a9a | diff --git a/cleverhans_tutorials/tutorial_models.py b/cleverhans_tutorials/tutorial_models.py
index <HASH>..<HASH> 100644
--- a/cleverhans_tutorials/tutorial_models.py
+++ b/cleverhans_tutorials/tutorial_models.py
@@ -99,7 +99,7 @@ class Conv2D(Layer):
dummy_batch = tf.zeros(input_shape)
dummy_output = self.fprop(dummy_batch)
output_shape = [int(e) for e in dummy_output.get_shape()]
- output_shape[0] = 1
+ output_shape[0] = batch_size
self.output_shape = tuple(output_shape)
def fprop(self, x):
@@ -116,9 +116,6 @@ class ReLU(Layer):
self.input_shape = shape
self.output_shape = shape
- def get_output_shape(self):
- return self.output_shape
-
def fprop(self, x):
return tf.nn.relu(x)
@@ -147,7 +144,7 @@ class Flatten(Layer):
for factor in shape[1:]:
output_width *= factor
self.output_width = output_width
- self.output_shape = [None, output_width]
+ self.output_shape = [shape[0], output_width]
def fprop(self, x):
return tf.reshape(x, [-1, self.output_width]) | correct batch_size in output_shape and delete a redundant method | tensorflow_cleverhans | train | py |
2370d39e8905529de585758c8ccdfe11943d7dd4 | diff --git a/plugins/outputs/graylog/graylog.go b/plugins/outputs/graylog/graylog.go
index <HASH>..<HASH> 100644
--- a/plugins/outputs/graylog/graylog.go
+++ b/plugins/outputs/graylog/graylog.go
@@ -214,7 +214,7 @@ func (g *Graylog) serialize(metric telegraf.Metric) ([]string, error) {
m := make(map[string]interface{})
m["version"] = "1.1"
- m["timestamp"] = metric.Time().UnixNano() / 1000000000
+ m["timestamp"] = float64(metric.Time().UnixNano()) / 1_000_000_000
m["short_message"] = "telegraf"
m["name"] = metric.Name() | fix: output timestamp with fractional seconds (#<I>) | influxdata_telegraf | train | go |
edc388f3984fbcaa1a093b822a3c2e20f33f7de4 | diff --git a/sharding-core/src/main/java/io/shardingsphere/core/yaml/sharding/YamlTableRuleConfiguration.java b/sharding-core/src/main/java/io/shardingsphere/core/yaml/sharding/YamlTableRuleConfiguration.java
index <HASH>..<HASH> 100644
--- a/sharding-core/src/main/java/io/shardingsphere/core/yaml/sharding/YamlTableRuleConfiguration.java
+++ b/sharding-core/src/main/java/io/shardingsphere/core/yaml/sharding/YamlTableRuleConfiguration.java
@@ -58,7 +58,6 @@ public class YamlTableRuleConfiguration {
keyGeneratorColumnName = tableRuleConfiguration.getKeyGeneratorColumnName();
keyGeneratorClassName = null == tableRuleConfiguration.getKeyGenerator()
? null : tableRuleConfiguration.getKeyGenerator().getClass().getName();
- logicTable = tableRuleConfiguration.getLogicTable();
}
/** | Removed useless codes in YamlTableRuleConfiguration. | apache_incubator-shardingsphere | train | java |
ab308fb8a3d3ad747e5cc2c3ad6f4fd8b442844c | diff --git a/src/main/java/net/bootsfaces/component/fullCalendar/FullCalendarRenderer.java b/src/main/java/net/bootsfaces/component/fullCalendar/FullCalendarRenderer.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/bootsfaces/component/fullCalendar/FullCalendarRenderer.java
+++ b/src/main/java/net/bootsfaces/component/fullCalendar/FullCalendarRenderer.java
@@ -73,6 +73,7 @@ public class FullCalendarRenderer extends Renderer {
}
rw.writeText(" weekMode: '" + fullCalendar.getWeekMode() + "',", null);
rw.writeText(" events: " + fullCalendar.getEvents(), null);
+ // TODO: add onchange listener that updates a hidden input field with $([\"id='" + clientId + "'\"]).fullCalendar('getEventSources') that contains the events
rw.writeText(" });", null);
rw.writeText("});", null); | DEV: added comment how to transfer changes to backing bean | TheCoder4eu_BootsFaces-OSP | train | java |
b171a6a8a3903e75b3d0cb59ceb9a85bb7d97ce2 | diff --git a/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php b/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php
+++ b/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php
@@ -49,6 +49,7 @@ class EntityType extends AbstractType
'property' => null,
'query_builder' => null,
'choices' => array(),
+ 'group_by' => null,
);
$options = array_replace($defaultOptions, $options);
@@ -59,7 +60,8 @@ class EntityType extends AbstractType
$options['class'],
$options['property'],
$options['query_builder'],
- $options['choices']
+ $options['choices'],
+ $options['group_by']
);
} | Added `group_by` to EntityType | symfony_symfony | train | php |
39a89cd905b34c851cafcd7532d989f948b86689 | diff --git a/dallinger/recruiters.py b/dallinger/recruiters.py
index <HASH>..<HASH> 100644
--- a/dallinger/recruiters.py
+++ b/dallinger/recruiters.py
@@ -685,12 +685,9 @@ class MTurkRecruiter(Recruiter):
hits = self.mturkservice.get_hits(
hit_filter=lambda h: h["annotation"] == experiment_id
)
- try:
- next(hits)
- except StopIteration:
- return False
- else:
+ for _ in hits:
return True
+ return False
@property
def qualification_active(self): | Just use early return to avoid iterator paperwork | Dallinger_Dallinger | train | py |
d847b056c0bcea0ea4ba3f907b42cefa10ead51e | diff --git a/tests/cases/core/LibrariesTest.php b/tests/cases/core/LibrariesTest.php
index <HASH>..<HASH> 100644
--- a/tests/cases/core/LibrariesTest.php
+++ b/tests/cases/core/LibrariesTest.php
@@ -99,7 +99,7 @@ class LibrariesTest extends \lithium\test\Unit {
public function testLibraryConfigAccess() {
$result = Libraries::get('lithium');
$expected = array(
- 'path' => str_replace('\\', '/', realpath(LITHIUM_LIBRARY_PATH)) . '/lithium',
+ 'path' => str_replace('\\', '/', realpath(realpath(LITHIUM_LIBRARY_PATH) . '/lithium')),
'prefix' => 'lithium\\',
'suffix' => '.php',
'loader' => 'lithium\\core\\Libraries::load', | Fixing a test in `\core\Libraries` where symlinked Lithium directories are matched properly. | UnionOfRAD_lithium | train | php |
a885f1bdff2ae3c39a3ea6d84dabc24775831e1d | diff --git a/command/agent/local.go b/command/agent/local.go
index <HASH>..<HASH> 100644
--- a/command/agent/local.go
+++ b/command/agent/local.go
@@ -439,7 +439,7 @@ func (l *localState) setSyncState() error {
eCopy := existing.Clone()
// Copy the server's check before modifying, otherwise
- // in-memory RPC-based unit tests will have side effects.
+ // in-memory RPCs will have side effects.
cCopy := check.Clone()
// If there's a defer timer active then we've got a | Tweaks comment about side effects. | hashicorp_consul | train | go |
4f259ed84b169006c578eb13dfd8e0c650fd5807 | diff --git a/src/feat/web/webserver.py b/src/feat/web/webserver.py
index <HASH>..<HASH> 100644
--- a/src/feat/web/webserver.py
+++ b/src/feat/web/webserver.py
@@ -1873,7 +1873,9 @@ class Response(log.Logger):
return
status = http.Status[self._request._ref.code].name
- self._request.debug("Finishing the request. Status: %s", status)
+ elapsed = time.time() - self._request.received
+ self._request.debug("Finishing the request. Status: %s. "
+ "Elapsed: %.2f s", status, elapsed)
self._finished = time.time()
try: | Include information about time of processing of web request. | f3at_feat | train | py |
68e2a875da30cbea9e774b76ce39e8b340857e70 | diff --git a/test/dummy/db/migrate/20110208155312_set_up_test_tables.rb b/test/dummy/db/migrate/20110208155312_set_up_test_tables.rb
index <HASH>..<HASH> 100644
--- a/test/dummy/db/migrate/20110208155312_set_up_test_tables.rb
+++ b/test/dummy/db/migrate/20110208155312_set_up_test_tables.rb
@@ -12,7 +12,7 @@ class SetUpTestTables < ActiveRecord::Migration
t.boolean :a_boolean
t.string :sacrificial_column
t.string :type
- t.timestamps
+ t.timestamps :null => true
end
create_table :versions, :force => true do |t|
@@ -63,7 +63,7 @@ class SetUpTestTables < ActiveRecord::Migration
create_table :wotsits, :force => true do |t|
t.integer :widget_id
t.string :name
- t.timestamps
+ t.timestamps :null => true
end
create_table :fluxors, :force => true do |t|
@@ -138,7 +138,7 @@ class SetUpTestTables < ActiveRecord::Migration
create_table :gadgets, :force => true do |t|
t.string :name
t.string :brand
- t.timestamps
+ t.timestamps :null => true
end
create_table :customers, :force => true do |t| | Get rid of deprecation warning on dummy app migrations on Travis | paper-trail-gem_paper_trail | train | rb |
fa45ec8d056df77f035e485d795e4e7d17912e00 | diff --git a/checker/tests/result_test.py b/checker/tests/result_test.py
index <HASH>..<HASH> 100644
--- a/checker/tests/result_test.py
+++ b/checker/tests/result_test.py
@@ -151,6 +151,7 @@ class FontToolsTest(TestCase):
url = 'http://fonts.googleapis.com/css?family=%s' % metadata['name'].replace(' ', '+')
fp = requests.get(url)
self.assertTrue(fp.status_code == 200, 'No family found in GWF in %s' % url)
+ self.assertEqual(metadata.get('visibility'), 'External')
@tags('required')
def test_macintosh_platform_names_matches_windows_platform(self): | If font is in GWF then check for visibility == 'External' | googlefonts_fontbakery | train | py |
2eea0635b874c4c55cdeb029ef55c9de5358e37d | diff --git a/Tests/System/ApplicationBundle/PhpListApplicationBundleTest.php b/Tests/System/ApplicationBundle/PhpListApplicationBundleTest.php
index <HASH>..<HASH> 100644
--- a/Tests/System/ApplicationBundle/PhpListApplicationBundleTest.php
+++ b/Tests/System/ApplicationBundle/PhpListApplicationBundleTest.php
@@ -51,7 +51,7 @@ class PhpListApplicationBundleTest extends TestCase
{
$this->startSymfonyServer($environment);
- $response = $this->httpClient->request('GET', '/', ['base_uri' => $this->getBaseUrl()]);
+ $response = $this->httpClient->get('/', ['base_uri' => $this->getBaseUrl()]);
self::assertSame(200, $response->getStatusCode());
}
@@ -65,7 +65,7 @@ class PhpListApplicationBundleTest extends TestCase
{
$this->startSymfonyServer($environment);
- $response = $this->httpClient->request('GET', '/', ['base_uri' => $this->getBaseUrl()]);
+ $response = $this->httpClient->get('/', ['base_uri' => $this->getBaseUrl()]);
self::assertContains('This page has been intentionally left empty.', $response->getBody()->getContents());
} | [CLEANUP] Use Guzzle's convenience methods in the system tests (#<I>)
This makes the code more concise. | phpList_core | train | php |
54df7bd86acf8b9ce2a07d6621e81351218e86ef | diff --git a/lib/Thelia/Core/Template/Loop/Feature.php b/lib/Thelia/Core/Template/Loop/Feature.php
index <HASH>..<HASH> 100644
--- a/lib/Thelia/Core/Template/Loop/Feature.php
+++ b/lib/Thelia/Core/Template/Loop/Feature.php
@@ -123,11 +123,13 @@ class Feature extends BaseI18nLoop implements PropelSearchLoopInterface
/** @var ProductModel $product */
foreach ($products as $product) {
- $search
- ->useFeatureProductQuery()
- ->filterByProduct($product)
- ->endUse()
- ;
+ if (!$this->getBackendContext()) {
+ $search
+ ->useFeatureProductQuery()
+ ->filterByProduct($product)
+ ->endUse()
+ ;
+ }
$tplId = $product->getTemplateId();
if (! is_null($tplId)) { | Patch for #<I> for backend context | thelia_core | train | php |
7a7cf30fe5b02cb0bdb0b3d0f09ae1bb8f1b33a3 | diff --git a/bloop/engine.py b/bloop/engine.py
index <HASH>..<HASH> 100644
--- a/bloop/engine.py
+++ b/bloop/engine.py
@@ -237,7 +237,7 @@ class Engine:
projection=projection, limit=limit, consistent=consistent)
return iter(s.prepare())
- def stream(self, model, position, strict: bool=False) -> Stream:
+ def stream(self, model, position) -> Stream:
s = Stream(engine=self, model=model, session=self.session)
- s.move_to(position=position, strict=strict)
+ s.move_to(position=position)
return s | remove strict arg from Stream.move_to #<I> | numberoverzero_bloop | train | py |
5b68f68e705381964cc0f3ea2b64ce1672ce8f32 | diff --git a/test/index.js b/test/index.js
index <HASH>..<HASH> 100644
--- a/test/index.js
+++ b/test/index.js
@@ -172,4 +172,25 @@ describe('gulp-bump: JSON comparison fixtures', function() {
bumpS.write(fakeFile);
bumpS.end();
});
+
+ it('should bump one key by default', function(done) {
+ var fakeFile = new File({
+ contents: new Buffer('{ "version": "0.1.0", "versionTwo": "1.0.0", "otherVersion": "2.0.0" }'),
+ path: 'test/fixtures/test.json'
+ });
+
+ var bumpS = bump({type: 'minor'});
+
+ bumpS.once('data', function(newFile) {
+ should.exist(newFile);
+ should.exist(newFile.contents);
+ var res = JSON.parse(newFile.contents.toString())
+ res.version.should.equal('0.2.0');
+ res.versionTwo.should.equal('1.0.0');
+ res.otherVersion.should.equal('2.0.0');
+ return done();
+ });
+ bumpS.write(fakeFile);
+ bumpS.end();
+ });
}); | Add test for bumping only one key | stevelacy_gulp-bump | train | js |
3594bffbdc53615b50e8c27135b51ac00f311e30 | diff --git a/src/main/java/com/chaschev/chutils/Main.java b/src/main/java/com/chaschev/chutils/Main.java
index <HASH>..<HASH> 100755
--- a/src/main/java/com/chaschev/chutils/Main.java
+++ b/src/main/java/com/chaschev/chutils/Main.java
@@ -7,11 +7,17 @@ import com.google.common.base.Strings;
*/
public class Main {
public static void main(String[] args) {
+ if(args.length != 2){
+ System.out.println("USAGE: chutils <your name> <a word>");
+ }
+
System.out.printf("hi from chutils, %s! have a good %s!%n", args[0], args[1]);
- System.out.println("is guava with us?");
+ System.out.printf("are we alone, %s?%n%n", args[0]);
+
+ System.out.print("no, we celebrate! guava is");
- System.out.print("guava is");
+ System.out.flush();
- System.out.println(Strings.commonSuffix(" no, not here!", " here!") );
+ System.out.println(Strings.commonSuffix(" not with us!", " with us!") );
}
} | Updated dialog for the Installation example. | chaschev_chutils | train | java |
4b501bdb6841a7a855b3d512efcb3e36a6fecccf | diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb
index <HASH>..<HASH> 100644
--- a/activesupport/lib/active_support/hash_with_indifferent_access.rb
+++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb
@@ -363,11 +363,11 @@ module ActiveSupport
end
private
- def convert_key(key) # :doc:
+ def convert_key(key)
key.kind_of?(Symbol) ? key.to_s : key
end
- def convert_value(value, conversion: nil) # :doc:
+ def convert_value(value, conversion: nil)
if value.is_a? Hash
if conversion == :to_hash
value.to_hash
@@ -384,7 +384,7 @@ module ActiveSupport
end
end
- def set_defaults(target) # :doc:
+ def set_defaults(target)
if default_proc
target.default_proc = default_proc.dup
else | Hide internal utility methods in the public API doc [ci skip]
I digged the history for the internal utility methods (`convert_key`,
`convert_value`, and `set_defaults`), I believe it is apparently not
intended to appear them in the public API doc.
* `convert_key`, `convert_value`: <I>
* `set_defaults`: #<I>
<URL>, so that methods should not be leaked to the public API doc. | rails_rails | train | rb |
f47f7a21e666903c5c6fda473347d3013c11644c | diff --git a/lib/nearley.js b/lib/nearley.js
index <HASH>..<HASH> 100644
--- a/lib/nearley.js
+++ b/lib/nearley.js
@@ -69,8 +69,9 @@ State.prototype.process = function(location, ind, table, rules, addedRules) {
this.data = this.rule.postprocess(this.data, this.reference, Parser.fail);
}
if (!(this.data === Parser.fail)) {
+ var findLeo;
// LEO THE LION SAYS GER
- function findLeo(idx, rulename, finalData) {
+ findLeo = function findLeo(idx, rulename, finalData) {
// performance optimization, avoid high order functions(map/filter) in hotspot code.
var items = [];
var row = table[idx]; | Fix for strict mode
Line <I> causes the following error in strict mode: `In strict mode, function declarations cannot be nested inside a statement or block. They may only appear at the top level or directly inside a function body.`
This is simply fixed by assigning the function to a variable. | kach_nearley | train | js |
ff8b47c61a7f71935c7fe554af4562472687a39a | diff --git a/salt/cli/caller.py b/salt/cli/caller.py
index <HASH>..<HASH> 100644
--- a/salt/cli/caller.py
+++ b/salt/cli/caller.py
@@ -169,6 +169,8 @@ class ZeroMQCaller(object):
ret['fun_args'] = self.opts['arg']
for returner in returners:
+ if not returner: # if we got an empty returner somehow, skip
+ continue
try:
ret['success'] = True
self.minion.returners['{0}.returner'.format(returner)](ret) | Catch case where 'return' not in opts, or other ways to get an empty returner (as it will just fail anyways) | saltstack_salt | train | py |
08db400a63ced7c6209f42f8dc12c2cd37474120 | diff --git a/structr-ui/src/main/resources/structr/js/widgets.js b/structr-ui/src/main/resources/structr/js/widgets.js
index <HASH>..<HASH> 100644
--- a/structr-ui/src/main/resources/structr/js/widgets.js
+++ b/structr-ui/src/main/resources/structr/js/widgets.js
@@ -281,6 +281,7 @@ var _Widgets = {
repaintRemoteWidgets: function (search) {
_Widgets.remoteWidgetFilter = search;
+ _Widgets.remoteWidgetsEl.empty();
if (search && search.length > 0) { | Bugfix: Fixes search in remote widgets | structr_structr | train | js |
e494382fab8e1d0aea1613cedd1824e8f23bb5ab | diff --git a/elasticsearch-extensions/lib/elasticsearch/extensions/version.rb b/elasticsearch-extensions/lib/elasticsearch/extensions/version.rb
index <HASH>..<HASH> 100644
--- a/elasticsearch-extensions/lib/elasticsearch/extensions/version.rb
+++ b/elasticsearch-extensions/lib/elasticsearch/extensions/version.rb
@@ -1,5 +1,5 @@
module Elasticsearch
module Extensions
- VERSION = "0.0.4"
+ VERSION = "0.0.5"
end
end | [EXT] Release <I> | elastic_elasticsearch-ruby | train | rb |
f2040f88ef93a5dbdac4545213b9ebfe6d793cde | diff --git a/salt/runners/saltutil.py b/salt/runners/saltutil.py
index <HASH>..<HASH> 100644
--- a/salt/runners/saltutil.py
+++ b/salt/runners/saltutil.py
@@ -42,6 +42,7 @@ def sync_all(saltenv='base'):
ret['wheel'] = sync_wheel(saltenv=saltenv)
ret['engines'] = sync_engines(saltenv=saltenv)
ret['queues'] = sync_queues(saltenv=saltenv)
+ ret['pillar'] = sync_pillar(saltenv=saltenv)
return ret
@@ -230,3 +231,20 @@ def sync_queues(saltenv='base'):
salt-run saltutil.sync_queues
'''
return salt.utils.extmods.sync(__opts__, 'queues', saltenv=saltenv)[0]
+
+
+def sync_pillar(saltenv='base'):
+ '''
+ Sync pillar modules from ``salt://_pillar`` to the master
+
+ saltenv : base
+ The fileserver environment from which to sync. To sync from more than
+ one environment, pass a comma-separated list.
+
+ CLI Example:
+
+ .. code-block:: bash
+
+ salt-run saltutil.sync_pillar
+ '''
+ return salt.utils.extmods.sync(__opts__, 'pillar', saltenv=saltenv)[0] | add pillars to extmods sync_all commands
So that we can use _pillar from the fileserver | saltstack_salt | train | py |
7be8a72022e6b7f908ba2e5386ec5affccd10c98 | diff --git a/src/main/java/org/jbake/app/Parser.java b/src/main/java/org/jbake/app/Parser.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jbake/app/Parser.java
+++ b/src/main/java/org/jbake/app/Parser.java
@@ -48,6 +48,7 @@ public class Parser {
private Map<String, Object> content = new HashMap<String, Object>();
private Asciidoctor asciidoctor;
private String contentPath;
+ private String currentPath;
private DateFormat dateFormat;
private PegDownProcessor pegdownProcessor;
@@ -122,7 +123,7 @@ public class Parser {
*/
public Map<String, Object> processFile(File file) {
content = new HashMap<String, Object>();
- contentPath = file.getParent();
+ currentPath = file.getParent();
InputStream is = null;
List<String> fileContents = null;
try {
@@ -373,7 +374,7 @@ public class Parser {
String name = iterator.next();
options.setOption(name, guessTypeByContent(optionsSubset.getString(name)));
}
- options.setBaseDir(contentPath);
+ options.setBaseDir(currentPath);
options.setSafe(UNSAFE);
return options;
} | Added new var to store current path. | jbake-org_jbake | train | java |
9b41a6a8a62331250f0787843c646fcb7f4aeb04 | diff --git a/src/stores/GuildMemberRoleStore.js b/src/stores/GuildMemberRoleStore.js
index <HASH>..<HASH> 100644
--- a/src/stores/GuildMemberRoleStore.js
+++ b/src/stores/GuildMemberRoleStore.js
@@ -106,7 +106,7 @@ class GuildMemberRoleStore extends DataStore {
* @readonly
*/
get highest() {
- return this.reduce((prev, role) => !prev || role.comparePositionTo(prev) > 0 ? role : prev);
+ return this.reduce((prev, role) => role.comparePositionTo(prev) > 0 ? role : prev, this.first());
}
/**
diff --git a/src/stores/RoleStore.js b/src/stores/RoleStore.js
index <HASH>..<HASH> 100644
--- a/src/stores/RoleStore.js
+++ b/src/stores/RoleStore.js
@@ -56,6 +56,15 @@ class RoleStore extends DataStore {
}
/**
+ * The role with the highest position in the store
+ * @type {Role}
+ * @readonly
+ */
+ get highest() {
+ return this.reduce((prev, role) => role.comparePositionTo(prev) > 0 ? role : prev, this.first());
+ }
+
+ /**
* Data that can be resolved to a Role object. This can be:
* * A Role
* * A Snowflake | fix: re-add highest property to RoleStore and GuildMemberRoleStore
closes #<I> | discordjs_discord.js | train | js,js |
edfe2106348c5c251f0f9f4f924dcd7ffd45ec48 | diff --git a/addon/wrap/hardwrap.js b/addon/wrap/hardwrap.js
index <HASH>..<HASH> 100644
--- a/addon/wrap/hardwrap.js
+++ b/addon/wrap/hardwrap.js
@@ -86,7 +86,8 @@
if (changes.length) cm.operation(function() {
for (var i = 0; i < changes.length; ++i) {
var change = changes[i];
- cm.replaceRange(change.text, change.from, change.to);
+ if (change.text || CodeMirror.cmpPos(change.from, change.to))
+ cm.replaceRange(change.text, change.from, change.to);
}
});
return changes.length ? {from: changes[0].from, to: CodeMirror.changeEnd(changes[changes.length - 1])} : null; | [hardwrap addon] Don't generate null changes
Issue #<I> | codemirror_CodeMirror | train | js |
532f0cd974fd66e47f195038f947a5870ccc6d65 | diff --git a/editor/editor.py b/editor/editor.py
index <HASH>..<HASH> 100644
--- a/editor/editor.py
+++ b/editor/editor.py
@@ -973,8 +973,7 @@ class Editor(App):
def move_widget(self, css_key, value):
# css_key can be 'top' or 'left'
# value (int): positive or negative value
- if issubclass(self.selectedWidget.__class__, gui.Widget) and css_key in self.selectedWidget.style and \
- self.selectedWidget.css_position=='absolute':
+ if issubclass(self.selectedWidget.__class__, gui.Widget) and css_key in self.selectedWidget.style:
self.selectedWidget.style[css_key] = gui.to_pix(gui.from_pix(self.selectedWidget.style[css_key]) + value)
def onkeydown(self, emitter, key, keycode, ctrl, shift, alt): | Editor: resize and move shortcuts not limited with absolute positioning. | dddomodossola_remi | train | py |
d467bdaac9b3b4984559afe79a7480daa5eeb2c4 | diff --git a/src/frontend/org/voltdb/iv2/TransactionTaskQueue.java b/src/frontend/org/voltdb/iv2/TransactionTaskQueue.java
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/iv2/TransactionTaskQueue.java
+++ b/src/frontend/org/voltdb/iv2/TransactionTaskQueue.java
@@ -329,6 +329,7 @@ public class TransactionTaskQueue
*/
if (firstTask) {
firstTask = false;
+ } else {
iter.remove();
}
taskQueueOffer(task); | For ENG-<I>, fix a bug in TransactionTaskQueue where the first fragment was removed from the queue | VoltDB_voltdb | train | java |
a75f49ebbc1718260c4dd56a1e88a2676ffab659 | diff --git a/tests/classes/Gems/Util/MonitorTest.php b/tests/classes/Gems/Util/MonitorTest.php
index <HASH>..<HASH> 100644
--- a/tests/classes/Gems/Util/MonitorTest.php
+++ b/tests/classes/Gems/Util/MonitorTest.php
@@ -52,6 +52,9 @@ class MonitorTest extends \Gems_Test_DbTestAbstract
$this->transport = new \Zend_Mail_Transport_File($options);
\Zend_Mail::setDefaultTransport($this->transport);
+
+ // Make sure the lock file can be written, not a problem outside test situations
+ \MUtil_File::ensureDir(GEMS_ROOT_DIR . '/var/settings');
}
/** | #<I> Make sure lock file can be written | GemsTracker_gemstracker-library | train | php |
ae8609dd86084aa78b7d8d0c8f0b57840a414597 | diff --git a/h5p.classes.php b/h5p.classes.php
index <HASH>..<HASH> 100644
--- a/h5p.classes.php
+++ b/h5p.classes.php
@@ -412,13 +412,13 @@ interface H5PFrameworkInterface {
* Start an atomic operation against the dependency storage
*/
public function lockDependencyStorage();
-
+
/**
* Stops an atomic operation against the dependency storage
*/
public function unlockDependencyStorage();
-
-
+
+
/**
* Delete a library from database and file system
*
@@ -1327,7 +1327,8 @@ class H5PStorage {
// Move the content folder
$destination_path = $contents_path . DIRECTORY_SEPARATOR . $contentId;
- @rename($current_path, $destination_path);
+ $this->h5pC->copyFileTree($current_path, $destination_path);
+ H5PCore::deleteFileTree($current_path);
// Save the content library dependencies
$this->h5pF->saveLibraryUsage($contentId, $librariesInUse); | Replaced another rename function. | h5p_h5p-php-library | train | php |
f5bd5b928b2429bef55eaff1bc412e9371e8b09f | diff --git a/code/ZenFields.php b/code/ZenFields.php
index <HASH>..<HASH> 100755
--- a/code/ZenFields.php
+++ b/code/ZenFields.php
@@ -48,8 +48,12 @@ class ZenFields extends Extension {
* @param array The arguments to the method
* @return FieldList
*/
- public function __call($method, $args) {
+ public function __call($method, $args) {
$formFieldClass = ucfirst($method)."Field";
+ $getter = "get".ucfirst($method);
+ if($this->owner->hasMethod($getter)) {
+ return $this->owner->$getter();
+ }
if(is_subclass_of($formFieldClass, "FormField")) {
if(!isset($args[0])) {
user_error("FieldList::{$method} -- Missing argument 1 for field name", E_ERROR);
@@ -213,7 +217,8 @@ class ZenFields extends Extension {
* @return array
*/
public function allMethodNames() {
- $methods = array (
+ $methods = array (
+ 'add',
'tab',
'field',
'group', | ENHANCEMENT: Detect getters and fallback, i.e. FieldGroup::getTag conflict with TagField | unclecheese_silverstripe-zen-fields | train | php |
3b2a602d021cb32a43b6097a78e3f6c73e575cfb | diff --git a/src/DoctrineServiceProvider.php b/src/DoctrineServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/DoctrineServiceProvider.php
+++ b/src/DoctrineServiceProvider.php
@@ -263,6 +263,7 @@ class DoctrineServiceProvider extends ServiceProvider
AuthManager::class,
EntityManager::class,
DoctrineManager::class,
+ ConnectionManager::class,
ClassMetadataFactory::class,
EntityManagerInterface::class,
ExtensionManager::class, | Add ConnectionManager to service provider
This way it can be used to extend(replace) and add custom connection drivers | laravel-doctrine_orm | train | php |
6a15922d5fa09f06d13f7eebe586192400622ebf | diff --git a/src/main/java/com/relayrides/pushy/apns/ApnsConnection.java b/src/main/java/com/relayrides/pushy/apns/ApnsConnection.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/relayrides/pushy/apns/ApnsConnection.java
+++ b/src/main/java/com/relayrides/pushy/apns/ApnsConnection.java
@@ -304,6 +304,9 @@ public class ApnsConnection<T extends ApnsPushNotification> {
// listeners if the handshake has completed. Otherwise, we'll notify listeners of a connection failure (as
// opposed to closure) elsewhere.
if (this.apnsConnection.handshakeCompleted && this.apnsConnection.listener != null) {
+ // At this point, there may still be some tasks in the event queue (i.e. write future listeners). We
+ // want to make sure those are all done before we notify listeners of connection closure, so we put the
+ // actual handler notification at the end of the queue.
context.channel().eventLoop().execute(new Runnable() {
@Override | Added a comment explaining the weird-ish queue maneuver when connections close. | relayrides_pushy | train | java |
12681f24e009299ff3d032312bc089b037f2771a | diff --git a/php-binance-api.php b/php-binance-api.php
index <HASH>..<HASH> 100644
--- a/php-binance-api.php
+++ b/php-binance-api.php
@@ -669,7 +669,7 @@ class API
/**
* withdrawFee get the withdrawal fee for an asset
*
- * $withdrawFee = $api->withdrawHistory( "BTC" );
+ * $withdrawFee = $api->withdrawFee( "BTC" );
*
* @param $asset string currency such as BTC
* @return array with error message or array containing withdrawFee | Add to withdrawHistory and depositHistory, new withdrawFee function | jaggedsoft_php-binance-api | train | php |
ab03deea8a3f9979988551e0cac0e77289f150f7 | diff --git a/src/test/java/org/springframework/data/solr/repository/query/SolrQueryMethodTests.java b/src/test/java/org/springframework/data/solr/repository/query/SolrQueryMethodTests.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/springframework/data/solr/repository/query/SolrQueryMethodTests.java
+++ b/src/test/java/org/springframework/data/solr/repository/query/SolrQueryMethodTests.java
@@ -241,6 +241,12 @@ public class SolrQueryMethodTests {
Assert.assertNull(method.getTimeAllowed());
}
+ @Test
+ public void testQueryWithDefType() throws Exception {
+ SolrQueryMethod method = getQueryMethodByName("findByNameEndingWith", String.class);
+ Assert.assertEquals("lucene", method.getDefType());
+ }
+
private SolrQueryMethod getQueryMethodByName(String name, Class<?>... parameters) throws Exception {
Method method = Repo1.class.getMethod(name, parameters);
return new SolrQueryMethod(method, new DefaultRepositoryMetadata(Repo1.class), creator);
@@ -297,6 +303,9 @@ public class SolrQueryMethodTests {
@Query(value = "*:*", timeAllowed = -10)
List<ProductBean> findAllWithNegativeTimeRestriction(String name);
+
+ @Query(defType = "lucene")
+ List<ProductBean> findByNameEndingWith(String name);
}
} | DATASOLR-<I> - additional test for 'defType' in @Query | spring-projects_spring-data-solr | train | java |
d5a1003e42a7eb4f94bebf4b6d9a3fc89c0e3589 | diff --git a/ui/js/components/auth.js b/ui/js/components/auth.js
index <HASH>..<HASH> 100644
--- a/ui/js/components/auth.js
+++ b/ui/js/components/auth.js
@@ -162,10 +162,14 @@ treeherder.component("loginCallback", {
algorithm: 'sha256'
};
this.loginError = null;
- const header = hawk.client.header(loginUrl, 'GET', {
+ var payload = {
credentials: credentials,
- ext: hawk.utils.base64urlEncode(JSON.stringify({"certificate": JSON.parse(certificate)}))}
- );
+ };
+ if (certificate) {
+ payload.ext = hawk.utils.base64urlEncode(JSON.stringify({"certificate": JSON.parse(certificate)}));
+ }
+
+ const header = hawk.client.header(loginUrl, 'GET', payload);
// send a request from client side to TH server signed with TC
// creds from login.taskcluster.net | Bug <I> - Support login with permanent credentials (empty cert) (#<I>) | mozilla_treeherder | train | js |
5f2e795677e7621ea02dfa2a43921c0840f5ac4f | diff --git a/src/gridstack.js b/src/gridstack.js
index <HASH>..<HASH> 100644
--- a/src/gridstack.js
+++ b/src/gridstack.js
@@ -429,11 +429,12 @@
if (this.opts.auto) {
var elements = [];
+ var _this = this;
this.container.children('.' + this.opts.item_class).each(function (index, el) {
el = $(el);
elements.push({
el: el,
- i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * parseInt(el.attr('data-gs-width'))
+ i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * _this.opts.width // Use opts.width as weight for Y
});
});
_.chain(elements).sortBy(function (x) { return x.i; }).each(function (i) { | Correctly sort nodes by using the total width instead of individual node width (becomes a problem with nodes of variable width). | gridstack_gridstack.js | train | js |
be7305a9caa0f69c812006412fe1c61dccd92299 | diff --git a/src/cf/commands/user/unset_space_role_test.go b/src/cf/commands/user/unset_space_role_test.go
index <HASH>..<HASH> 100644
--- a/src/cf/commands/user/unset_space_role_test.go
+++ b/src/cf/commands/user/unset_space_role_test.go
@@ -90,7 +90,6 @@ var _ = Describe("Testing with ginkgo", func() {
Expect(spaceRepo.FindByNameInOrgName).To(Equal("my-space"))
Expect(spaceRepo.FindByNameInOrgOrgGuid).To(Equal("some-org-guid"))
- println(ui.DumpOutputs())
testassert.SliceContains(ui.Outputs, testassert.Lines{
{"Removing role", "SpaceManager", "some-user", "some-org", "some-space", "my-user"},
{"OK"}, | Remove stray debug println statement | cloudfoundry_cli | train | go |
beceb5ea3b92208294af1ebcc8a3a8414dd40271 | diff --git a/lib/devise_security_extension/models/password_archivable.rb b/lib/devise_security_extension/models/password_archivable.rb
index <HASH>..<HASH> 100644
--- a/lib/devise_security_extension/models/password_archivable.rb
+++ b/lib/devise_security_extension/models/password_archivable.rb
@@ -9,7 +9,7 @@ module Devise # :nodoc:
base.class_eval do
include InstanceMethods
- has_many :old_passwords, :as => :password_archivable, :class_name => "OldPassword"
+ has_many :old_passwords, :as => :password_archivable, :dependent => :destroy
before_update :archive_password
validate :validate_password_archive
end | Added dependent destroy on the old passwords to help clean up the old password table for users that were removed. | phatworx_devise_security_extension | train | rb |
0f272fce3811fcd1dcfcf65e63f6ea541ce69568 | diff --git a/core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java b/core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java
index <HASH>..<HASH> 100644
--- a/core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java
+++ b/core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java
@@ -187,7 +187,7 @@ public class InodeTree implements JournalCheckpointStreamable {
}
/**
- * @param uri the uri to get the inode for
+ * @param uri the {@link AlluxioURI} to check for existence
* @return whether the inode exists
*/
public boolean inodePathExists(AlluxioURI uri) { | clarified the javadoc in InodeTree.java for method inodePathExists | Alluxio_alluxio | train | java |
1ac116dc72c74e42e75bbaed46e782b1624ca5cc | diff --git a/packages/utils-uuid/index.js b/packages/utils-uuid/index.js
index <HASH>..<HASH> 100644
--- a/packages/utils-uuid/index.js
+++ b/packages/utils-uuid/index.js
@@ -105,31 +105,6 @@ exports.humanized = function humanized (words = 6) {
return Random.sample(ENGENIE, english, words).join('.')
}
-// βββββββββββββββββββββββββββββββββ Utils βββββββββββββββββββββββββββββββββββ
-
-/* Public utils */
-exports.util = {}
-
-/**
- * Checks if the given input string against the Damm algorithm
- *
- * @param {String} input - Numeric String, probs from uuid.numeric()
- *
- * @return {Boolean}
- */
-
-exports.util.verifyNumeric = input => generateCheckDigit(input) === '0'
-
-/**
- * Return a random value within the provided array
- *
- * @param {Array} inputArray
- *
- * @return {*} A random element of the array
- */
-
-exports.util.pick = input => Random.pick(ENGENIE, input)
-
// ββββββββββββββββββββββββββββββββ Exports ββββββββββββββββββββββββββββββββββ
/* Freze the API */ | Removed uuid.util
moved to @cactus-technologies/utils | CactusTechnologies_cactus-utils | train | js |
452c39d303da77f440c65f74b3ef91ce190ab55a | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -73,7 +73,7 @@ setup(
# List run-time dependencies here. These will be installed by pip when
# your project is installed.
- install_requires=['requests'],
+ install_requires=['requests', 'pytz'],
# If there are data files included in your packages that need to be
# installed, specify them here. If using Python 2.6 or less, then these | add pytz in project requirements | EnergieID_smappy | train | py |
379a02f51e9ccb0558c2aa02143912389d40a283 | diff --git a/src/FeedIo/Feed.php b/src/FeedIo/Feed.php
index <HASH>..<HASH> 100644
--- a/src/FeedIo/Feed.php
+++ b/src/FeedIo/Feed.php
@@ -151,4 +151,12 @@ class Feed extends Node implements FeedInterface, \JsonSerializable
return $properties;
}
+
+ /**
+ * @return int
+ */
+ public function count()
+ {
+ return count($this->items);
+ }
}
diff --git a/src/FeedIo/FeedInterface.php b/src/FeedIo/FeedInterface.php
index <HASH>..<HASH> 100644
--- a/src/FeedIo/FeedInterface.php
+++ b/src/FeedIo/FeedInterface.php
@@ -18,7 +18,7 @@ use FeedIo\Feed\ItemInterface;
* Represents the top node of a news feed
* @package FeedIo
*/
-interface FeedInterface extends \Iterator, NodeInterface
+interface FeedInterface extends \Iterator, \Countable, NodeInterface
{
/** | Add \Countable to FeedInterface. Implement it in Feed | alexdebril_feed-io | train | php,php |
c8745ef203f5a37af3592cf114b49f5e065b7cd9 | diff --git a/pyxel/ui/widget.py b/pyxel/ui/widget.py
index <HASH>..<HASH> 100644
--- a/pyxel/ui/widget.py
+++ b/pyxel/ui/widget.py
@@ -68,7 +68,7 @@ class Widget:
def parent(self, value):
self._parent = value
- if value:
+ if value and self not in value._children:
value._children.append(self)
@property | Added the check code for the parent property | kitao_pyxel | train | py |
16add0b82e9f1ea682d0e63a3c1b3b6ec8ed61ba | diff --git a/build-support/bin/_release_helper.py b/build-support/bin/_release_helper.py
index <HASH>..<HASH> 100644
--- a/build-support/bin/_release_helper.py
+++ b/build-support/bin/_release_helper.py
@@ -189,6 +189,7 @@ def validate_pants_pkg(version: str, venv_dir: Path, extra_pip_args: list[str])
"'pants.backend.awslambda.python', "
"'pants.backend.python', "
"'pants.backend.shell', "
+ "'pants.backend.experimental.java', "
"'internal_plugins.releases'"
"]"
), | [internal] CI: include java in release test (#<I>)
CI is broken after <URL> | pantsbuild_pants | train | py |
9a53ddb764065d503bd03e68847c18e0e4863126 | diff --git a/metricdef/metricdef.go b/metricdef/metricdef.go
index <HASH>..<HASH> 100644
--- a/metricdef/metricdef.go
+++ b/metricdef/metricdef.go
@@ -170,7 +170,7 @@ func GetMetrics(scroll_id string) ([]*schema.MetricDefinition, string, error) {
var err error
var out elastigo.SearchResult
if scroll_id == "" {
- out, err = es.Search(IndexName, "metric_index", map[string]interface{}{"scroll": "1m"}, nil)
+ out, err = es.Search(IndexName, "metric_index", map[string]interface{}{"scroll": "1m", "size": 1000}, nil)
} else {
out, err = es.Scroll(map[string]interface{}{"scroll": "1m"}, scroll_id)
} | set doc count size to <I> to improve ES query performance. | grafana_metrictank | train | go |
ef2ba9518b043191257e308240ff7ab39ab023a8 | diff --git a/lib/callbacks/transform.js b/lib/callbacks/transform.js
index <HASH>..<HASH> 100644
--- a/lib/callbacks/transform.js
+++ b/lib/callbacks/transform.js
@@ -309,13 +309,13 @@ if (typeof exports !== 'undefined') {
* Preliminary pass: mark source nodes so we can map line numbers
* Also eliminate _fast_ syntax
*/
- function _isMarker(node) {
- return node.type === IDENTIFIER && node.value === '_';
- }
- function _isStar(node) {
- return node.type === CALL && _isMarker(node.children[0]) && node.children[1].children.length === 2;
- }
function _removeFast(node, options) {
+ function _isMarker(node) {
+ return node.type === IDENTIFIER && node.value === options.callback;
+ }
+ function _isStar(node) {
+ return node.type === CALL && _isMarker(node.children[0]) && node.children[1].children.length === 2;
+ }
// ~_ -> _
if (node.type === BITWISE_NOT && _isMarker(node.children[0])) {
options.needsTransform = true; | Support options.callback != '_' in callbacks mode. | Sage_streamlinejs | train | js |
76e70440f53915a4c26328a0db4f6a05ac31230f | diff --git a/path.py b/path.py
index <HASH>..<HASH> 100644
--- a/path.py
+++ b/path.py
@@ -82,10 +82,10 @@ except AttributeError:
PY3 = sys.version_info[0] >= 3
if PY3:
def u(x):
- return codecs.unicode_escape_decode(x)[0]
+ return x
else:
def u(x):
- return x
+ return codecs.unicode_escape_decode(x)[0]
o777 = 511
o766 = 502 | Present the modern, Python 3 version first | jaraco_path.py | train | py |
6faacbca5f054d1e1afb951ce78f89ff97a6d69d | diff --git a/lib/magento/base.rb b/lib/magento/base.rb
index <HASH>..<HASH> 100644
--- a/lib/magento/base.rb
+++ b/lib/magento/base.rb
@@ -47,9 +47,20 @@ module Magento
end
end
- def method_missing(method, *args)
- return nil unless @attributes
- @attributes[method.to_s]
+ def method_missing(method_symbol, *arguments)
+ method_name = method_symbol.to_s
+
+ if method_name =~ /(=|\?)$/
+ case $1
+ when "="
+ @attributes[$`] = arguments.first
+ when "?"
+ @attributes[$`]
+ end
+ else
+ return @attributes[method_name] if @attributes.include?(method_name)
+ super
+ end
end
end
@@ -58,4 +69,4 @@ module Magento
end
class ApiError < StandardError; end
-end
\ No newline at end of file
+end | method_mising as in activeresource: support for setters plus raise error on missing attribute | pstuteville_magentor | train | rb |
3be0659975f1783ee72ac1686b5d94fd164f21ed | diff --git a/javascript/node/selenium-webdriver/lib/test/index.js b/javascript/node/selenium-webdriver/lib/test/index.js
index <HASH>..<HASH> 100644
--- a/javascript/node/selenium-webdriver/lib/test/index.js
+++ b/javascript/node/selenium-webdriver/lib/test/index.js
@@ -188,8 +188,23 @@ function suite(fn, opt_options) {
inSuite = true;
var suiteOptions = opt_options || {};
+ var browsers = suiteOptions.browsers;
+ if (browsers) {
+ // Filter out browser specific tests when that browser is not currently
+ // selected for testing.
+ browsers = browsers.filter(function(browser) {
+ if (browsersToTest.indexOf(browser) != -1) {
+ return true;
+ }
+ return browsersToTest.indexOf(
+ browser.substring('remote.'.length)) != -1;
+ });
+ } else {
+ browsers = browsersToTest;
+ }
+
try {
- (suiteOptions.browsers || browsersToTest).forEach(function(browser) {
+ browsers.forEach(function(browser) {
testing.describe('[' + browser + ']', function() {
var serverToUse = null; | Filter out browser specific tests when that browser is not currently selected for testing. | SeleniumHQ_selenium | train | js |
939c303c5a4edb3e01f317d86a7d2d3e624df087 | diff --git a/src/input/pointer.js b/src/input/pointer.js
index <HASH>..<HASH> 100644
--- a/src/input/pointer.js
+++ b/src/input/pointer.js
@@ -582,7 +582,7 @@
// check if mapped to a key
if (keycode) {
- if (e.type === POINTER_DOWN[0] || e.type === POINTER_DOWN[1] || e.type === POINTER_DOWN[2]) {
+ if (e.type === POINTER_DOWN[0] || e.type === POINTER_DOWN[1] || e.type === POINTER_DOWN[2] || e.type === POINTER_DOWN[3]) {
return api._keydown(e, keycode, button + 1);
}
else { // 'mouseup' or 'touchend' | [#<I>] Add touchstart to pointer event check | melonjs_melonJS | train | js |
Subsets and Splits