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 |
|---|---|---|---|---|---|
df0c8b013da0e3970526fb7d7c7dc9322d811da4 | diff --git a/tests/pygobject/test_signals.py b/tests/pygobject/test_signals.py
index <HASH>..<HASH> 100644
--- a/tests/pygobject/test_signals.py
+++ b/tests/pygobject/test_signals.py
@@ -11,6 +11,8 @@ import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
+from tests import FIXME
+
class SignalTest(unittest.TestCase):
@@ -65,6 +67,7 @@ class SignalTest(unittest.TestCase):
class SignalReturnTest(unittest.TestCase):
+ @FIXME("some rare random fails..")
def test_bool(self):
window = Gtk.OffscreenWindow()
area = Gtk.DrawingArea() | disable an unreliable test for now | pygobject_pgi | train | py |
e85ac8f117c61a14d9724fe883cda786dd2b0065 | diff --git a/src/class-cache.php b/src/class-cache.php
index <HASH>..<HASH> 100644
--- a/src/class-cache.php
+++ b/src/class-cache.php
@@ -57,7 +57,7 @@ class Cache extends Abstract_Cache {
$this->group = ! isset( $group ) ? $prefix : $group;
$this->incrementor_key = "{$prefix}cache_incrementor";
- $this->incrementor = \wp_cache_get( $this->incrementor_key, $this->group );
+ $this->incrementor = (int) \wp_cache_get( $this->incrementor_key, $this->group );
parent::__construct( $prefix );
} | Always treat wp_cache_get() result as integer.
false and 0 are interchangeable for our purposes. | mundschenk-at_wp-data-storage | train | php |
96c001021e6dd06b43686de7040f78c484869344 | diff --git a/ceph_deploy/mon.py b/ceph_deploy/mon.py
index <HASH>..<HASH> 100644
--- a/ceph_deploy/mon.py
+++ b/ceph_deploy/mon.py
@@ -32,7 +32,7 @@ def create_mon(cluster, monitor_keyring, init):
)
if not os.path.exists(path):
- os.mkdir(path)
+ os.makedirs(path)
if not os.path.exists(done_path):
keyring = '/var/lib/ceph/tmp/{cluster}-{hostname}.mon.keyring'.format( | mon: use makedirs instead of mkdir for mon path
This is a bit more robust if /var/lib/ceph/mon is not present for some
reason.
Fixes: #<I> | ceph_ceph-deploy | train | py |
f7c36e1bd5c41de9cad7bc2ea36c158cee642a01 | diff --git a/lib/bud/executor/join.rb b/lib/bud/executor/join.rb
index <HASH>..<HASH> 100644
--- a/lib/bud/executor/join.rb
+++ b/lib/bud/executor/join.rb
@@ -588,7 +588,8 @@ module Bud
key = get_key(item, offset)
(@hash_tables[offset][key] ||= Set.new).add item
if @rhs_rcvd and offset == 0
- push_lhs(key, item)
+ rhs_values = @hash_tables[1][key]
+ process_match(item, rhs_values)
end
end
@@ -599,16 +600,12 @@ module Bud
unless @rhs_rcvd
@rhs_rcvd = true
@hash_tables[0].each do |key,values|
- values.each {|item| push_lhs(key, item)}
+ rhs_values = @hash_tables[1][key]
+ values.each {|item| process_match(item, rhs_values)}
end
end
end
- def push_lhs(key, lhs_item)
- rhs_values = @hash_tables[1][key]
- process_match(lhs_item, rhs_values)
- end
-
def process_match(lhs_item, rhs_values)
if rhs_values.nil?
# no corresponding rhs. Include in output | Optimization for notin evaluation.
Hoist a hash table lookup outside of a loop. | bloom-lang_bud | train | rb |
7fed8364cc5033a598e9c6cc7ea121334580646f | diff --git a/spec/features/record_not_found_spec.rb b/spec/features/record_not_found_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/features/record_not_found_spec.rb
+++ b/spec/features/record_not_found_spec.rb
@@ -9,12 +9,6 @@ feature 'Dashboard resource finder exception' do
@faalis = Faalis::Engine.routes.url_helpers
end
- scenario 'User try to find a resource which does not exists.' do
- visit faalis.dashboard_auth_user_url({ id: 3242 })
- expect(page).to have_text('404')
- expect(page).to have_text('Oops!')
- end
-
scenario 'User try to find a resource which does not exists via js format.' do
visit @faalis.dashboard_auth_user_path({ id: 3242, format: :js})
expect(page).to have_text('error_message(') | Unnecessary spec removed | Yellowen_Faalis | train | rb |
f9efc69137700f3427cec4204754bea25eaa1f93 | diff --git a/lib/link.js b/lib/link.js
index <HASH>..<HASH> 100644
--- a/lib/link.js
+++ b/lib/link.js
@@ -21,6 +21,7 @@ export default class Link extends Component {
replace: PropTypes.bool,
shallow: PropTypes.bool,
passHref: PropTypes.bool,
+ scroll: PropTypes.bool,
children: PropTypes.oneOfType([
PropTypes.element,
(props, propName) => { | Added <Link scroll> PropType (#<I>)
This should avoid the angry console warnings when trying to override the default scroll behavior using `<Link scroll={false}>` | zeit_next.js | train | js |
50c9f877b6129a03a485fc1399eb6ca7b3eb801c | diff --git a/services/has-many-getter.js b/services/has-many-getter.js
index <HASH>..<HASH> 100644
--- a/services/has-many-getter.js
+++ b/services/has-many-getter.js
@@ -34,7 +34,6 @@ function HasManyGetter(model, association, opts, params) {
return model.findById(params.recordId)
.then(function (record) {
- console.log('get' + _.upperFirst(params.associationName));
return record['get' +
_.upperFirst(params.associationName)](queryOptions);
}); | [-] Code Style - Clean a remaining log | ForestAdmin_forest-express-sequelize | train | js |
b207917b85a53173d85b77cd56bcc324ad2fe967 | diff --git a/prow/plugins/trigger/pr.go b/prow/plugins/trigger/pr.go
index <HASH>..<HASH> 100644
--- a/prow/plugins/trigger/pr.go
+++ b/prow/plugins/trigger/pr.go
@@ -86,7 +86,7 @@ I understand the commands that are listed [here](https://github.com/kubernetes/t
%s
</details>
`
- comment := fmt.Sprintf(commentTemplate, pr.User.Login, trustedOrg, trustedOrg, plugins.AboutThisBot)
+ comment := fmt.Sprintf(commentTemplate, pr.User.Login, trustedOrg, trustedOrg, plugins.AboutThisBotWithoutCommands)
owner := pr.Base.Repo.Owner.Login
name := pr.Base.Repo.Name | Avoid repetition of the command message.
'I understand the commands that are listed here.' was printed both outside and inside details. | kubernetes_test-infra | train | go |
100c3bce5a2fbfce77e48e8a38a9997d446b7c02 | diff --git a/salt/master.py b/salt/master.py
index <HASH>..<HASH> 100644
--- a/salt/master.py
+++ b/salt/master.py
@@ -8,6 +8,7 @@ from __future__ import absolute_import
# Import python libs
import ctypes
+from pprint import pformat
import os
import re
import time
@@ -531,7 +532,23 @@ class Publisher(multiprocessing.Process):
try:
package = pull_sock.recv()
unpacked_package = salt.payload.unpackage(package)
- payload = unpacked_package['payload']
+ try:
+ payload = unpacked_package['payload']
+ except (KeyError,) as exc:
+ # somehow not packaged !?
+ if 'enc' in payload and 'load' in payload:
+ payload = package
+ else:
+ try:
+ log.error(
+ "Invalid payload: {0}".format(
+ pformat(unpacked_package), exc_info=True))
+ except Exception:
+ # dont fail on a format error here !
+ # but log something as it is hard to track down
+ log.error("Received invalid payload", exc_info=True)
+ raise exc
+
if self.opts['zmq_filtering']:
# if you have a specific topic list, use that
if 'topic_lst' in unpacked_package: | Smart test the payload form on rcv
This is a Workaround/Fix for #<I> | saltstack_salt | train | py |
116d9afa05db72d6e4ee61089e576ca4489ffc74 | diff --git a/src/Macros/Seventh.php b/src/Macros/Seventh.php
index <HASH>..<HASH> 100644
--- a/src/Macros/Seventh.php
+++ b/src/Macros/Seventh.php
@@ -7,7 +7,7 @@ class Seventh
public function __invoke()
{
return function () {
- return $this->get(6);
+ return $this->skip(6)->first();
};
}
} | Update Seventh.php (#<I>) | spatie_laravel-collection-macros | train | php |
5c1b7e03611a5fafa80cc8304ee2e34ced3e3658 | diff --git a/zeroneed.php b/zeroneed.php
index <HASH>..<HASH> 100755
--- a/zeroneed.php
+++ b/zeroneed.php
@@ -30,4 +30,4 @@ require __DIR__ . '/vendor/autoload.php';
|
*/
-ZN\ZN::run('EIP', '5.7.7.4', 'Vecihi Hürkuş');
+ZN\ZN::run('EIP', '5.7.8', 'Vecihi Hürkuş'); | <I>: Updated version. | znframework_znframework | train | php |
e9359d4e5bcd7e9bd8ff4706f6fd773814c80bbf | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -8,7 +8,7 @@ import {
} from './lazy'
const prefix = '_async_computed$'
-const DidNotUpdate = Symbol('did-not-update')
+const DidNotUpdate = typeof Symbol === 'function' ? Symbol('did-not-update') : {}
const AsyncComputed = {
install (Vue, pluginOptions) { | Add fallback for if Symbol is not defined | foxbenjaminfox_vue-async-computed | train | js |
b3c86b1736bc5ed174d133f1cfa4c6c666ca22e1 | diff --git a/source/core/mailvalidator.php b/source/core/mailvalidator.php
index <HASH>..<HASH> 100644
--- a/source/core/mailvalidator.php
+++ b/source/core/mailvalidator.php
@@ -70,7 +70,7 @@ class MailValidator
{
$blValid = true;
if ( $sEmail != 'admin' ) {
- $sEmailRule = $this->_sMailValidationRule;
+ $sEmailRule = $this->getMailValidationRule();
$blValid = ( getStr()->preg_match( $sEmailRule, $sEmail ) != 0 );
} | setter and getter add to change email rule | OXID-eSales_oxideshop_ce | train | php |
2ed2d71514e3900687dc84fb10ddf22c318c6367 | diff --git a/app/controllers/admin/contacts_controller.rb b/app/controllers/admin/contacts_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/admin/contacts_controller.rb
+++ b/app/controllers/admin/contacts_controller.rb
@@ -1,6 +1,6 @@
class Admin::ContactsController < Admin::BaseController
def index
- @contacts = Contacts.all
+ @contacts = Contact.all
end
def show | Typo: Contacts => Contact | organicweb_spree-easy-contact | train | rb |
71a94bce5148b9441ac0c4d98492377df3a7d5ed | diff --git a/Console/Migrations/FreshCommand.php b/Console/Migrations/FreshCommand.php
index <HASH>..<HASH> 100644
--- a/Console/Migrations/FreshCommand.php
+++ b/Console/Migrations/FreshCommand.php
@@ -44,7 +44,7 @@ class FreshCommand extends Command
$this->call('migrate', [
'--database' => $database,
'--path' => $this->input->getOption('path'),
- '--force' => $this->input->getOption('force'),
+ '--force' => true,
]);
if ($this->needsSeeding()) { | Fix asking for confirmation two times when running migrate:fresh on production (#<I>) | illuminate_database | train | php |
ce5da27ad7515b22ef82d4ab67001e17858e054a | diff --git a/cobra/examples/01_create_model.py b/cobra/examples/01_create_model.py
index <HASH>..<HASH> 100644
--- a/cobra/examples/01_create_model.py
+++ b/cobra/examples/01_create_model.py
@@ -15,7 +15,6 @@ reaction.name = '3 oxoacyl acyl carrier protein synthase n C140 '
reaction.subsystem = 'Cell Envelope Biosynthesis'
reaction.lower_bound = 0. # This is the default
reaction.upper_bound = 1000. # This is the default
-reaction.reversibility = 0 # This is the default
reaction.objective_coefficient = 0. # this is the default
# Create the metabolites
diff --git a/cobra/examples/05_add_reactions.py b/cobra/examples/05_add_reactions.py
index <HASH>..<HASH> 100644
--- a/cobra/examples/05_add_reactions.py
+++ b/cobra/examples/05_add_reactions.py
@@ -19,7 +19,6 @@ reaction.name = '3 oxoacyl acyl carrier protein synthase n C140'
reaction.subsystem = 'Cell Envelope Biosynthesis'
reaction.lower_bound = 0. # This is the default
reaction.upper_bound = 1000. # This is the default
-reaction.reversibility = 0 # This is the default
reaction.objective_coefficient = 0. # This is the default
# Adding metabolites to a reaction requires using a dictionary of the | examples set reversibility
reversibility should not be set, but is calculated from upper and lower
bounds | opencobra_cobrapy | train | py,py |
c00e859cd87903f56c5e6e66399cb6403955c283 | diff --git a/PelTiff.php b/PelTiff.php
index <HASH>..<HASH> 100644
--- a/PelTiff.php
+++ b/PelTiff.php
@@ -80,6 +80,8 @@ class PelTiff {
/**
* The first Image File Directory, if any.
*
+ * If set, then the type of the IFD must be {@link PelIfd::IFD0}.
+ *
* @var PelIfd
*/
private $ifd = null;
@@ -143,7 +145,7 @@ class PelTiff {
if ($offset > 0) {
/* Parse the first IFD, this will automatically parse the
* following IFDs and any sub IFDs. */
- $this->ifd = new PelIfd();
+ $this->ifd = new PelIfd(PelIfd::IFD0);
$this->ifd->load($d, $offset);
}
}
@@ -162,9 +164,14 @@ class PelTiff {
/**
* Set the first IFD.
*
- * @param PelIfd the new first IFD.
+ * @param PelIfd the new first IFD, which must be of type {@link
+ * PelIfd::IFD0}.
*/
function setIfd(PelIfd $ifd) {
+ if ($ifd->getType() != PelIfd::IFD0)
+ throw new PelInvalidDataException('Invalid type of IFD: %d, expected %d.',
+ $ifd->getType(), PelIfd::IFD0);
+
$this->ifd = $ifd;
} | Enforce IFD0 as first IFD in TIFF files. | pel_pel | train | php |
07199bdc471d257822a56fb7c75bc1d4c7ccc36f | diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index <HASH>..<HASH> 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -37,6 +37,7 @@ import plistlib
import email.parser
import tempfile
import textwrap
+import itertools
from pkgutil import get_importer
try:
@@ -53,6 +54,7 @@ if PY3:
if PY2:
from urlparse import urlparse, urlunparse
+ filter = itertools.ifilter
if PY3:
string_types = str, | Always use Python 3 filter in pkg_resources | pypa_setuptools | train | py |
5f8ea3b8b626c5bb816ec3b71b3f476f377914f0 | diff --git a/src/main/java/de/btobastian/javacord/utils/handler/channel/ChannelDeleteHandler.java b/src/main/java/de/btobastian/javacord/utils/handler/channel/ChannelDeleteHandler.java
index <HASH>..<HASH> 100644
--- a/src/main/java/de/btobastian/javacord/utils/handler/channel/ChannelDeleteHandler.java
+++ b/src/main/java/de/btobastian/javacord/utils/handler/channel/ChannelDeleteHandler.java
@@ -69,6 +69,9 @@ public class ChannelDeleteHandler extends PacketHandler {
*/
private void handleServerTextChannel(JSONObject packet, Server server) {
final Channel channel = server.getChannelById(packet.getString("id"));
+ if (channel == null) {
+ return;
+ }
((ImplServer) server).removeChannel(channel);
listenerExecutorService.submit(new Runnable() {
@Override
@@ -95,6 +98,9 @@ public class ChannelDeleteHandler extends PacketHandler {
*/
private void handleServerVoiceChannel(JSONObject packet, Server server) {
final VoiceChannel channel = server.getVoiceChannelById(packet.getString("id"));
+ if (channel == null) {
+ return;
+ }
((ImplServer) server).removeVoiceChannel(channel);
listenerExecutorService.submit(new Runnable() {
@Override | Fixed Channel#delete() causing a NPE (issue #<I>) | Javacord_Javacord | train | java |
77f51fe5ff51125c13d3d93597a65179ab674e4e | diff --git a/tensorflow_datasets/__init__.py b/tensorflow_datasets/__init__.py
index <HASH>..<HASH> 100644
--- a/tensorflow_datasets/__init__.py
+++ b/tensorflow_datasets/__init__.py
@@ -17,3 +17,7 @@
# pylint: disable=g-multiple-import
from tensorflow_datasets.core.dataset_builder import Split
from tensorflow_datasets.core.registered import builder, registered, load
+
+# Imports for registration
+import tensorflow_datasets.image.cifar
+import tensorflow_datasets.image.mnist
diff --git a/tensorflow_datasets/image/cifar.py b/tensorflow_datasets/image/cifar.py
index <HASH>..<HASH> 100644
--- a/tensorflow_datasets/image/cifar.py
+++ b/tensorflow_datasets/image/cifar.py
@@ -20,12 +20,12 @@ from __future__ import division
from __future__ import print_function
import collections
-import cPickle
import os
import random
import numpy as np
import six
+from six.moves import cPickle
import tensorflow as tf
from tensorflow_datasets.core import dataset_builder
from tensorflow_datasets.core import file_format_adapter | Import builder modules at top-level for registration
PiperOrigin-RevId: <I> | tensorflow_datasets | train | py,py |
0c6f3d33cd15a4558e437b70b0507f221f00e3eb | diff --git a/command/build_ext.py b/command/build_ext.py
index <HASH>..<HASH> 100644
--- a/command/build_ext.py
+++ b/command/build_ext.py
@@ -166,6 +166,7 @@ class build_ext(Command):
self.include_dirs.append(plat_py_include)
self.ensure_string_list('libraries')
+ self.ensure_string_list('link_objects')
# Life is easier if we're not forever checking for None, so
# simplify these options to empty lists if unset
diff --git a/tests/test_build_ext.py b/tests/test_build_ext.py
index <HASH>..<HASH> 100644
--- a/tests/test_build_ext.py
+++ b/tests/test_build_ext.py
@@ -195,6 +195,13 @@ class BuildExtTestCase(TempdirManager,
cmd.finalize_options()
self.assertEqual(cmd.rpath, ['one', 'two'])
+ # make sure cmd.link_objects is turned into a list
+ # if it's a string
+ cmd = build_ext(dist)
+ cmd.link_objects = 'one two,three'
+ cmd.finalize_options()
+ self.assertEqual(cmd.link_objects, ['one', 'two', 'three'])
+
# XXX more tests to perform for win32
# make sure define is turned into 2-tuples | build_ext: correctly parse the link_objects user option (closes #<I>)
Patch by Valerie Lambert. | pypa_setuptools | train | py,py |
eb7698901d512b4e8faab72819b7a4b5bf750fc9 | diff --git a/charge.go b/charge.go
index <HASH>..<HASH> 100644
--- a/charge.go
+++ b/charge.go
@@ -132,6 +132,7 @@ type ChargeListParams struct {
Created *int64 `form:"created"`
CreatedRange *RangeQueryParams `form:"created"`
Customer *string `form:"customer"`
+ PaymentIntent *string `form:"payment_intent"`
TransferGroup *string `form:"transfer_group"`
} | Allow listing charges by PaymentIntent id | stripe_stripe-go | train | go |
1923d1602990c48686b1047864c668ff1073c2db | diff --git a/salt/states/boto_vpc.py b/salt/states/boto_vpc.py
index <HASH>..<HASH> 100644
--- a/salt/states/boto_vpc.py
+++ b/salt/states/boto_vpc.py
@@ -1480,7 +1480,7 @@ def accept_vpc_peering_connection(name=None, conn_id=None, conn_name=None,
log.debug('Called state to accept VPC peering connection')
pending = __salt__['boto_vpc.is_peering_connection_pending'](
conn_id=conn_id,
- name=conn_name,
+ conn_name=conn_name,
region=region,
key=key,
keyid=keyid, | Fixed arguments to VPC peering function (#<I>)
The `is_peering_connection_pending` function as defined in
`modules/boto_vpc` is expecting a kwarg of `conn_name` but in the state
function `accept_vpc_peering_connection` on line <I> it is called with an argument
of `name`. Updated the state function to use the proper kwarg. | saltstack_salt | train | py |
b6c674c387cd7f0d9e98f33a072f2799013765b7 | diff --git a/tutorials/mnist_tutorial_tf.py b/tutorials/mnist_tutorial_tf.py
index <HASH>..<HASH> 100644
--- a/tutorials/mnist_tutorial_tf.py
+++ b/tutorials/mnist_tutorial_tf.py
@@ -263,8 +263,7 @@ def mnist_tutorial(train_start=0, train_end=60000, test_start=0,
# Initialize the Fast Gradient Sign Method (FGSM) attack object and graph
wrap = KerasModelWrapper(model)
fgsm = FastGradientMethod(wrap, sess=sess)
- fgsm_params = {'eps': 0.3,
- 'y': Y_test}
+ fgsm_params = {'eps': 0.3}
adv_x = fgsm.generate(x, **fgsm_params)
preds_adv = model.get_probs(adv_x) | Fix mnist_tutorial_tf generate feed issue | tensorflow_cleverhans | train | py |
4b665e76acc5e896047c95876ab4a7c31e5845aa | diff --git a/packages/dvan/lib/index.js b/packages/dvan/lib/index.js
index <HASH>..<HASH> 100644
--- a/packages/dvan/lib/index.js
+++ b/packages/dvan/lib/index.js
@@ -63,7 +63,7 @@ class Dvan {
* Set process.env
*/
process.env.NODE_ENV = this.mode
- process.env.DVAN_ENV = this.hasDependency('vue') ? 'vue' : 'react'
+ process.env.DVAN_APP = this.hasDependency('vue') ? 'vue' : 'react'
this.applyPlugins() | Change `DVAN_ENV` to `DVAN_APP` | evillt_dvan | train | js |
c576f4adbaccf8e1690eb0e5c3c1507ff477b98a | diff --git a/Malmo/samples/Java_examples/JavaExamples_run_mission.java b/Malmo/samples/Java_examples/JavaExamples_run_mission.java
index <HASH>..<HASH> 100755
--- a/Malmo/samples/Java_examples/JavaExamples_run_mission.java
+++ b/Malmo/samples/Java_examples/JavaExamples_run_mission.java
@@ -44,7 +44,7 @@ public class JavaExamples_run_mission
}
catch( Exception e )
{
- System.out.println( "ERROR: " + e );
+ System.out.println( "ERROR: " + e.getMessage() );
System.out.println( agent_host.getUsage() );
System.exit(1);
}
@@ -69,7 +69,7 @@ public class JavaExamples_run_mission
agent_host.startMission( my_mission, my_mission_record );
}
catch (Exception e) {
- System.out.println( "Error starting mission: " + e );
+ System.out.println( "Error starting mission: " + e.getMessage() );
System.exit(1);
} | Minor: tweaked Java sample error printing. | Microsoft_malmo | train | java |
84b93a31c3aee8c935da987538f355a69d10cc25 | diff --git a/indra/biopax/processor.py b/indra/biopax/processor.py
index <HASH>..<HASH> 100644
--- a/indra/biopax/processor.py
+++ b/indra/biopax/processor.py
@@ -424,7 +424,7 @@ class BiopaxProcessor(object):
members_in = self._get_complex_members(input_pe)
members_out = self._get_complex_members(output_pe)
- if not (members_in or members_out):
+ if not (members_in and members_out):
continue
# Make sure the outgoing complex has exactly 2 members
# TODO: by finding matching proteins on either side, in principle
@@ -474,7 +474,7 @@ class BiopaxProcessor(object):
members_in = self._get_complex_members(input_pe)
members_out = self._get_complex_members(output_pe)
- if not (members_in or members_out):
+ if not (members_in and members_out):
continue
# Make sure the outgoing complex has exactly 2 members
# TODO: by finding matching proteins on either side, in principle | Fix consistency test in Gap/Gef extraction | sorgerlab_indra | train | py |
1c0dfe8c15b9f1950f31fa4476682da7438f1ead | diff --git a/test/integration/test_topological_manipulations.py b/test/integration/test_topological_manipulations.py
index <HASH>..<HASH> 100644
--- a/test/integration/test_topological_manipulations.py
+++ b/test/integration/test_topological_manipulations.py
@@ -1,5 +1,5 @@
import OpenPNM
-import pytest
+from os.path import join
import scipy as sp
from OpenPNM.Utilities import topology
ctrl = OpenPNM.Base.Controller()
@@ -15,7 +15,7 @@ def test_subdivide():
pn.subdivide(pores=nano_pores, shape=[4, 4, 4], labels='nano')
assert pn.Np == (125+4*64-4)
assert pn.Nt == (300+(4*144)-16+15*16+16)
- ctrl.export(network=pn, filename='nano')
+ ctrl.export(network=pn, filename=join(TEMP_DIR, 'nano'))
def test_clone_and_trim(): | Save vtp file in temp dir | PMEAL_OpenPNM | train | py |
25a374d698c42bd15e7f26c157b36994a2015558 | diff --git a/src/ol/geom/Polygon.js b/src/ol/geom/Polygon.js
index <HASH>..<HASH> 100644
--- a/src/ol/geom/Polygon.js
+++ b/src/ol/geom/Polygon.js
@@ -413,7 +413,7 @@ export default Polygon;
* Create an approximation of a circle on the surface of a sphere.
* @param {import("../coordinate.js").Coordinate} center Center (`[lon, lat]` in degrees).
* @param {number} radius The great-circle distance from the center to
- * the polygon vertices.
+ * the polygon vertices in meters.
* @param {number=} opt_n Optional number of vertices for the resulting
* polygon. Default is `32`.
* @param {number=} opt_sphereRadius Optional radius for the sphere (defaults to | Mention unit of radius for Polygon.circular()
Radius was using an unknown unit. This makes it clear that it will be interpreted as meters. | openlayers_openlayers | train | js |
6603af558a16eb2dc1be3f02a9ec2149eac03fa4 | diff --git a/src/Modl/SQL.php b/src/Modl/SQL.php
index <HASH>..<HASH> 100644
--- a/src/Modl/SQL.php
+++ b/src/Modl/SQL.php
@@ -66,8 +66,10 @@ class SQL extends Modl {
if(isset($caract->mandatory)
&& $caract->mandatory == true
- && !isset($value))
+ && !isset($value) && !empty($value)) {
array_push($this->_warnings, $key.' is not set');
+ return;
+ }
switch($caract->type) {
case 'string' : | - Be more restrictive when a column is mandatory | movim_modl | train | php |
dd94bd33650271c65d20a566466d9e122612410e | diff --git a/lib/polyfill/patchedmediakeys_apple.js b/lib/polyfill/patchedmediakeys_apple.js
index <HASH>..<HASH> 100644
--- a/lib/polyfill/patchedmediakeys_apple.js
+++ b/lib/polyfill/patchedmediakeys_apple.js
@@ -15,7 +15,6 @@ goog.require('shaka.util.EventManager');
goog.require('shaka.util.FakeEvent');
goog.require('shaka.util.FakeEventTarget');
goog.require('shaka.util.MediaReadyState');
-goog.require('shaka.util.Platform');
goog.require('shaka.util.PublicPromise');
goog.require('shaka.util.StringUtils');
@@ -34,6 +33,9 @@ shaka.polyfill.PatchedMediaKeysApple = class {
return;
}
+ /* Unprefixed EME disabled. See:
+ https://github.com/google/shaka-player/pull/3021#issuecomment-766999811
+
// Only tested in Safari 14.
const safariVersion = shaka.util.Platform.safariVersion();
if (navigator.requestMediaKeySystemAccess &&
@@ -43,6 +45,7 @@ shaka.polyfill.PatchedMediaKeysApple = class {
// Unprefixed EME is preferable.
return;
}
+ */
shaka.log.info('Using Apple-prefixed EME'); | fix: Disable unprefixed EME on Safari
@avelad reported that PR #<I> caused a regression. Rather than
revert the entire thing, we are disabling one part of that change to
make it easier to re-enable once the issue is fixed. We will also
reopen issue #<I> until this is resolved.
Change-Id: I<I>d<I>da<I>d<I>bb<I>e<I>eb<I>e8bb5c4 | google_shaka-player | train | js |
e301e62eb2c68525f8fde776718723e2ece636a4 | diff --git a/src/Snackbar/Snackbar.js b/src/Snackbar/Snackbar.js
index <HASH>..<HASH> 100644
--- a/src/Snackbar/Snackbar.js
+++ b/src/Snackbar/Snackbar.js
@@ -25,6 +25,7 @@ const styles = theme => ({
lineHeight: 1.15,
color: theme.snackbar.colors.text,
fontSize: theme.snackbar.fontSize,
+ fontWeight: theme.snackbar.fontWeight,
opacity: 0,
transitionDuration: theme.snackbar.animationDuration,
transitionProperty: 'top, bottom, opacity',
diff --git a/src/theme/create-theme.js b/src/theme/create-theme.js
index <HASH>..<HASH> 100644
--- a/src/theme/create-theme.js
+++ b/src/theme/create-theme.js
@@ -1057,6 +1057,7 @@ export default function createTheme(config) {
}
},
fontSize: 13,
+ fontWeight: 400,
animationDuration: 200
},
spinner: { | feat: added font weight for snackbar | rambler-digital-solutions_rambler-ui | train | js,js |
88234e2a83438f7b28bc41df9f4cff226a648243 | diff --git a/rapidoid-inmem/src/main/java/org/rapidoid/inmem/InMem.java b/rapidoid-inmem/src/main/java/org/rapidoid/inmem/InMem.java
index <HASH>..<HASH> 100644
--- a/rapidoid-inmem/src/main/java/org/rapidoid/inmem/InMem.java
+++ b/rapidoid-inmem/src/main/java/org/rapidoid/inmem/InMem.java
@@ -93,6 +93,8 @@ public class InMem implements Serializable {
private static final long serialVersionUID = -200957806998151795L;
+ private static final String SUPERADMIN = "SUPERADMIN";
+
private static final String ID = "id";
private static final String VERSION = "version";
@@ -169,6 +171,9 @@ public class InMem implements Serializable {
}
protected String username() {
+ if (sudo) {
+ return SUPERADMIN;
+ }
return asUsername != null ? asUsername : Secure.username();
} | Fixed username to SUPERADMIN for SUDO access in InMem DB. | rapidoid_rapidoid | train | java |
1cc550b36eea78a5fb831f279cd2ca56d7aeba53 | diff --git a/src/Behat/Mink/Driver/BrowserKitDriver.php b/src/Behat/Mink/Driver/BrowserKitDriver.php
index <HASH>..<HASH> 100644
--- a/src/Behat/Mink/Driver/BrowserKitDriver.php
+++ b/src/Behat/Mink/Driver/BrowserKitDriver.php
@@ -732,8 +732,7 @@ class BrowserKitDriver extends CoreDriver
// find form button
if (null === $buttonNode = $this->findFormButton($formNode)) {
- $message = 'form submit button for field with xpath "' . $xpath . '"';
- throw new ElementNotFoundException($this->session, $message);
+ throw new ElementNotFoundException($this->session, 'form submit button for field', 'xpath', $xpath);
}
$this->forms[$formId] = new Form($buttonNode, $this->getCurrentUrl()); | Improved the usage of the ElementNotFoundException | minkphp_MinkBrowserKitDriver | train | php |
770872f13eea9a8dd29ea8a6103600ce669f4816 | diff --git a/contao/dca/tl_metamodel_attribute.php b/contao/dca/tl_metamodel_attribute.php
index <HASH>..<HASH> 100644
--- a/contao/dca/tl_metamodel_attribute.php
+++ b/contao/dca/tl_metamodel_attribute.php
@@ -77,7 +77,7 @@ $GLOBALS['TL_DCA']['tl_metamodel_attribute']['fields']['check_listviewicon'] = a
'fieldType' => 'radio',
'files' => true,
'filesOnly' => true,
- 'extensions' => 'jpg,jpeg,gif,png,tif,tiff',
+ 'extensions' => 'jpg,jpeg,gif,png,tif,tiff,svg',
'tl_class' => 'clr'
)
);
@@ -92,7 +92,7 @@ $GLOBALS['TL_DCA']['tl_metamodel_attribute']['fields']['check_listviewicondisabl
'fieldType' => 'radio',
'files' => true,
'filesOnly' => true,
- 'extensions' => 'jpg,jpeg,gif,png,tif,tiff',
+ 'extensions' => 'jpg,jpeg,gif,png,tif,tiff,svg',
'tl_class' => 'clr'
)
); | Add svg to the list of allowed icon extensions | MetaModels_attribute_checkbox | train | php |
9d614cb8ffc20eebc1a9a0cc5f7be976ba3348e3 | diff --git a/server/src/main/java/org/uiautomation/ios/application/IPAShellApplication.java b/server/src/main/java/org/uiautomation/ios/application/IPAShellApplication.java
index <HASH>..<HASH> 100644
--- a/server/src/main/java/org/uiautomation/ios/application/IPAShellApplication.java
+++ b/server/src/main/java/org/uiautomation/ios/application/IPAShellApplication.java
@@ -100,8 +100,8 @@ public class IPAShellApplication extends IPAApplication {
@Override
public File getApplicationPath() {
- APPIOSApplication app = MobileSafariLocator.locateSafari((String)info.getProperty("DTPlatformVersion"));
- return app.getApplicationPath();
+ // getting the safari app for real device isn't relevant without insturments.
+ return new File("");
} | removing the need for safari to be installed in the simulator when running on real device | ios-driver_ios-driver | train | java |
d28567bb313d5b925306d72417523985af41deb6 | diff --git a/thefuck/shells/bash.py b/thefuck/shells/bash.py
index <HASH>..<HASH> 100644
--- a/thefuck/shells/bash.py
+++ b/thefuck/shells/bash.py
@@ -41,7 +41,7 @@ class Bash(Generic):
if os.path.join(os.path.expanduser('~'), '.bashrc'):
config = '~/.bashrc'
elif os.path.join(os.path.expanduser('~'), '.bash_profile'):
- config = '~/.bashrc'
+ config = '~/.bash_profile'
else:
config = 'bash config' | #<I>: Fix suggestion of `.bash_profile` | nvbn_thefuck | train | py |
c67d657f7b45788d93d70457db3f44fee365bd57 | diff --git a/test/unit/transport/test_session.py b/test/unit/transport/test_session.py
index <HASH>..<HASH> 100644
--- a/test/unit/transport/test_session.py
+++ b/test/unit/transport/test_session.py
@@ -286,16 +286,14 @@ class TestSession(unittest.TestCase):
listener.callback(parse_root(notification), notification)
notif = q.get_nowait()
self.assertEquals(notif.notification_xml, notification)
- with self.assertRaises(Empty):
- q.get_nowait()
+ self.assertRaises(Empty, q.get_nowait)
def test_notification_handler_non_notification(self):
q = Queue()
listener = NotificationHandler(q)
# This handler should ignore things that aren't notifications
listener.callback(parse_root(rpc_reply), rpc_reply)
- with self.assertRaises(Empty):
- q.get_nowait()
+ self.assertRaises(Empty, q.get_nowait)
def test_take_notification(self):
cap = [':candidate'] | Fix unit test for notifications to be compatible with Python <I> | ncclient_ncclient | train | py |
c089edf336f6934f0aa55e116013c8c502420134 | diff --git a/telluric/vectors.py b/telluric/vectors.py
index <HASH>..<HASH> 100644
--- a/telluric/vectors.py
+++ b/telluric/vectors.py
@@ -222,17 +222,14 @@ class _GeoVectorDelegator:
relationship = getattr(
self_.get_shape(self_.crs), item
)(other.get_shape(self_.crs))
- if item not in ['intersects']:
+ # workaround to overcome issue of impossible transformation
+ if relationship:
return relationship
else:
- # workaround to overcome issue of impossible transformation
- if relationship:
- return relationship
- else:
- relationship = getattr(
- self_.get_shape(other.crs), item
- )(other.get_shape(other.crs))
- return relationship
+ relationship = getattr(
+ self_.get_shape(other.crs), item
+ )(other.get_shape(other.crs))
+ return relationship
delegated_predicate.__doc__ = getattr(self._shape, item).__doc__ | Don't check name of predicates | satellogic_telluric | train | py |
deacc51fc1b45591663ae07255d8e8a2b8a09ec6 | diff --git a/ella/core/templatetags/pagination.py b/ella/core/templatetags/pagination.py
index <HASH>..<HASH> 100644
--- a/ella/core/templatetags/pagination.py
+++ b/ella/core/templatetags/pagination.py
@@ -12,7 +12,7 @@ def _do_paginator(context, adjacent_pages, template_name):
template_name = ('inclusion_tags/paginator.html', 'inc/paginator.html')
else:
template_name = ('inclusion_tags/paginator_%s.html' % template_name,
- 'inc/paginator.html' % template_name)
+ 'inc/paginator_%s.html' % template_name)
if not 'page' in context:
# improper use of paginator tag, bail out | missing formatting char
not sure if this is the way how it supposed to be | ella_ella | train | py |
877348896a1a666691990b2a1c9b4d3b0715c4fd | diff --git a/src/Analyser/NodeScopeResolver.php b/src/Analyser/NodeScopeResolver.php
index <HASH>..<HASH> 100644
--- a/src/Analyser/NodeScopeResolver.php
+++ b/src/Analyser/NodeScopeResolver.php
@@ -682,7 +682,7 @@ class NodeScopeResolver
}
if ($intersectedScope === null) {
- $intersectedScope = $branchScope;
+ $intersectedScope = $initialScope->addVariables($branchScope);
} elseif ($mergeWithPrevious) {
if ($previousBranchScope !== null) {
$intersectedScope = $branchScope->addVariables($previousBranchScope);
diff --git a/src/Analyser/Scope.php b/src/Analyser/Scope.php
index <HASH>..<HASH> 100644
--- a/src/Analyser/Scope.php
+++ b/src/Analyser/Scope.php
@@ -1043,6 +1043,9 @@ class Scope
{
$variableTypes = $this->getVariableTypes();
foreach ($otherScope->getVariableTypes() as $name => $variableType) {
+ if ($this->hasVariableType($name)) {
+ $variableType = $this->getVariableType($name)->combineWith($variableType);
+ }
$variableTypes[$name] = $variableType;
} | Fixed weird issue with defineVariablesWithoutDefaultBranch set to true | phpstan_phpstan | train | php,php |
4f299d6b1f110fe62b1afe1f38a40144f084662e | diff --git a/lib/caze/version.rb b/lib/caze/version.rb
index <HASH>..<HASH> 100644
--- a/lib/caze/version.rb
+++ b/lib/caze/version.rb
@@ -1,3 +1,3 @@
module Caze
- VERSION = "0.0.3"
+ VERSION = "0.0.4"
end | Bump up version to <I> | magnetis_caze | train | rb |
4027e2b92d7ad8312eb2bd04c2e642e7223a26c7 | diff --git a/holoviews/core/element.py b/holoviews/core/element.py
index <HASH>..<HASH> 100644
--- a/holoviews/core/element.py
+++ b/holoviews/core/element.py
@@ -438,12 +438,10 @@ class HoloMap(UniformNdMapping):
on the HoloMap. Homogenous Elements may be collapsed by
supplying a function, inhomogenous elements are merged.
"""
- if self.ndims > 1:
+ if self.ndims > 1 and len(dimensions) != self.ndims:
groups = self.groupby([dim for dim in self._cached_index_names
if dim not in dimensions])
else:
- if len(dimensions) > 1:
- raise ValueError("HoloMap only has one dimensions to collapse.")
dims = [self.get_dimension(dim) for dim in dimensions]
groups = HoloMap([(0, self)])
collapsed = groups.clone(shared_data=False) | Allowed collapsing any HoloMap into a single Element | pyviz_holoviews | train | py |
bae9bdaac9e7d9bbbde08f292538e674df53b6d6 | diff --git a/src/compatibility.js b/src/compatibility.js
index <HASH>..<HASH> 100644
--- a/src/compatibility.js
+++ b/src/compatibility.js
@@ -32,12 +32,13 @@ if (undefined === Array.prototype.indexOf) {
if (undefined !== fromIndex) {
idx = fromIndex;
} else {
- fromIndex = 0;
+ idx = 0;
}
while (idx < len) {
if (this[idx] === searchElement) {
return idx;
}
+ ++idx;
}
return -1;
};
@@ -51,7 +52,8 @@ if (undefined === Function.prototype.bind) {
var thisFn = this,
prependArgs = _gpfArraySlice.apply(arguments, [1]);
return function() {
- thisFn.apply(thisArg, prependArgs.concat(arguments));
+ var args = _gpfArraySlice.apply(arguments, [0]);
+ thisFn.apply(thisArg, prependArgs.concat(args));
};
}; | BUG fixes on cscript integration | ArnaudBuchholz_gpf-js | train | js |
6414ebfe1ac06c0ee78d0504f0ab4cce52c013cf | diff --git a/src/plugins/acl.js b/src/plugins/acl.js
index <HASH>..<HASH> 100644
--- a/src/plugins/acl.js
+++ b/src/plugins/acl.js
@@ -105,6 +105,11 @@ export class Acl {
aclUser.roles.push(...aclRoles);
await aclUser.save();
+
+ this.uw.publish('acl:allow', {
+ userID: aclUser.id,
+ roles: aclRoles.map(role => role.id),
+ });
}
async disallow(user, roleNames) {
@@ -113,6 +118,11 @@ export class Acl {
aclUser.roles = aclUser.roles.filter(role =>
aclRoles.every(remove => remove.id !== getRoleName(role)));
await aclUser.save();
+
+ this.uw.publish('acl:disallow', {
+ userID: aclUser.id,
+ roles: aclRoles.map(role => role.id),
+ });
}
async getAllPermissions(user) { | acl: Publish role changes. (#<I>) | u-wave_core | train | js |
aacf21470cbe68327c60a10ed9843082f5e67c11 | diff --git a/elasticapm/transport/http.py b/elasticapm/transport/http.py
index <HASH>..<HASH> 100644
--- a/elasticapm/transport/http.py
+++ b/elasticapm/transport/http.py
@@ -194,7 +194,7 @@ class Transport(HTTPTransportBase):
body = response.data
data = json_encoder.loads(body.decode("utf8"))
version = data["version"]
- logger.info("Fetched APM Server version %s", version)
+ logger.debug("Fetched APM Server version %s", version)
self.client.server_version = version_string_to_tuple(version)
except (urllib3.exceptions.RequestError, urllib3.exceptions.HTTPError) as e:
logger.warning("HTTP error while fetching server information: %s", str(e)) | Move the APM server fetch log to `debug` (#<I>) | elastic_apm-agent-python | train | py |
73275a0b1166d6feb4dae646775b08964e97793a | diff --git a/plenum/common/ledger_manager.py b/plenum/common/ledger_manager.py
index <HASH>..<HASH> 100644
--- a/plenum/common/ledger_manager.py
+++ b/plenum/common/ledger_manager.py
@@ -754,7 +754,7 @@ class LedgerManager(HasActionQueue):
return numRequest * (self.config.CatchupTransactionsTimeout +
0.1 * batchSize)
- def catchupCompleted(self, ledgerId: int, lastPpSeqNo: int=-1):
+ def catchupCompleted(self, ledgerId: int, lastPpSeqNo: int=0):
# Since multiple ledger will be caught up and catchups might happen
# multiple times for a single ledger, the largest seen
# ppSeqNo needs to be known.
diff --git a/plenum/server/node.py b/plenum/server/node.py
index <HASH>..<HASH> 100644
--- a/plenum/server/node.py
+++ b/plenum/server/node.py
@@ -1871,7 +1871,7 @@ class Node(HasActionQueue, Motor, Propagator, MessageProcessor, HasFileStorage,
for ppSeqNo, (lid, txnSeqNo) in reversed(self.batchToSeqNos.items()):
if lid == ledgerId and txnSeqNo == seqNo:
return ppSeqNo
- return -1
+ return 0
def executeBatch(self, ppSeqNo: int, ppTime: float, reqs: List[Request],
ledgerId, stateRoot, txnRoot) -> None: | use - as default ppSeqNo instead of -1 | hyperledger_indy-plenum | train | py,py |
dceb2d29a24ff59a6560fc5e7a5ee046a171980a | diff --git a/sos/plugins/soundcard.py b/sos/plugins/soundcard.py
index <HASH>..<HASH> 100644
--- a/sos/plugins/soundcard.py
+++ b/sos/plugins/soundcard.py
@@ -26,12 +26,9 @@ class Soundcard(Plugin):
def setup(self):
self.add_copy_spec("/proc/asound/*")
- self.add_cmd_output("lspci | grep -i audio")
self.add_cmd_output("aplay -l")
self.add_cmd_output("aplay -L")
self.add_cmd_output("amixer")
- self.add_cmd_output("lsmod | grep snd | awk '{print $1}'",\
- suggest_filename = "sndmodules_loaded")
class RedHatSoundcard(Soundcard, RedHatPlugin):
""" Sound card information for RedHat distros | Remove pipe use from soundcard plugin
This is redundant since the whole lspci and lsmod output is
captured elsewhere. Also removes shell syntax from the plugin.
Related: Issue #<I>. | sosreport_sos | train | py |
e77050c5b73220502529defb278d7cf5de00a04d | diff --git a/Tank/Plugins/Phantom.py b/Tank/Plugins/Phantom.py
index <HASH>..<HASH> 100644
--- a/Tank/Plugins/Phantom.py
+++ b/Tank/Plugins/Phantom.py
@@ -825,6 +825,7 @@ class StepperWrapper:
continue
cnt += 1
hashed_str += ";" + str(stat_option)
+ hashed_str+=";"+os.path.getmtime(self.ammo_file)
else:
if not self.uris:
raise RuntimeError("Neither phantom.ammofile nor phantom.uris specified") | Ensure filemtime is added in stpd cache | yandex_yandex-tank | train | py |
684ae0f68c583d41fac545a6f41a2a62c54f4fed | diff --git a/saltobserver/redis_stream.py b/saltobserver/redis_stream.py
index <HASH>..<HASH> 100644
--- a/saltobserver/redis_stream.py
+++ b/saltobserver/redis_stream.py
@@ -11,6 +11,7 @@ class RedisStream(object):
def __init__(self):
self.redis = Redis(connection_pool=redis_pool)
+ app.logger.debug("Using Redis version %s." % self.redis.info()['redis_version'])
actual_version = StrictVersion(self.redis.info()['redis_version'])
minimum_version = StrictVersion("2.8.0")
if actual_version < minimum_version: | make the logs include information about the redis version | debugloop_saltobserver | train | py |
3b6a8539e083d34731065ef5e1d72a9df361a154 | diff --git a/photonpump/conversations.py b/photonpump/conversations.py
index <HASH>..<HASH> 100644
--- a/photonpump/conversations.py
+++ b/photonpump/conversations.py
@@ -689,6 +689,7 @@ class CreatePersistentSubscription(Conversation):
result.ParseFromString(message.payload)
if result.result == SubscriptionResult.Success:
+ self.is_complete = True
self.result.set_result(None)
elif result.result == SubscriptionResult.AccessDenied:
diff --git a/test/conversations/test_create_persistent_subscription.py b/test/conversations/test_create_persistent_subscription.py
index <HASH>..<HASH> 100644
--- a/test/conversations/test_create_persistent_subscription.py
+++ b/test/conversations/test_create_persistent_subscription.py
@@ -120,3 +120,13 @@ E8 07 70 0A 78 00 82 01 0A 52 6F 75 6E 64 52 6F
assert actual_bytes == expected_bytes
assert len(actual_bytes) == len(expected_bytes)
+
+
+@pytest.mark.asyncio
+async def test_persistent_subscription_success():
+
+ convo = CreatePersistentSubscription("my-other-subscription", "my-other-stream")
+
+ await complete_subscription(convo, SubscriptionResult.Success)
+
+ assert convo.is_complete | CreatePersistentSubscription conversations are now completed when receiving success | madedotcom_photon-pump | train | py,py |
366dba950d2c2a8abc0a97f0ebc47621a790955b | diff --git a/spec/spec_app/app/controllers/instances.rb b/spec/spec_app/app/controllers/instances.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_app/app/controllers/instances.rb
+++ b/spec/spec_app/app/controllers/instances.rb
@@ -46,7 +46,7 @@ class Instances < BaseClass
def show(cloud_id:, id:, junk:, **other_params)
payload = request.payload
- response.body = {cloud_id: cloud_id, id: id, junk: junk, other_params: other_params, payload: payload.dump}
+ response.body = {cloud_id: cloud_id, id: id, junk: junk, other_params: other_params, payload: payload && payload.dump}
response.headers['Content-Type'] = 'application/vnd.acme.instance'
response
end | Protect against functional tests that don't include a GET payload and cause spurious backtraces | praxis_praxis | train | rb |
a1d160bd3e9985583fb4da56ee796e3ddf5f8ff8 | diff --git a/examples/rexec/client.js b/examples/rexec/client.js
index <HASH>..<HASH> 100644
--- a/examples/rexec/client.js
+++ b/examples/rexec/client.js
@@ -34,12 +34,12 @@ var sender = session.createWriteChannel();
console.log(process.argv.slice(3))
var cmd = {
- Cmd: process.argv[2],
Args: process.argv.slice(3),
- Stdin: sender.createDuplexStream(),
- Stdout: sender.createDuplexStream(),
+ Cmd: process.argv[2],
+ StatusChan: sender.createReadChannel(),
Stderr: sender.createDuplexStream(),
- StatusChan: sender.createReadChannel()
+ Stdin: sender.createDuplexStream(),
+ Stdout: sender.createDuplexStream()
}
sender.write(cmd) | Achieve a cool 'index out of range' thing! | GraftJS_jschan | train | js |
154890a494e650ea87c4db23732419477b850841 | diff --git a/fritzconnection/lib/fritzstatus.py b/fritzconnection/lib/fritzstatus.py
index <HASH>..<HASH> 100644
--- a/fritzconnection/lib/fritzstatus.py
+++ b/fritzconnection/lib/fritzstatus.py
@@ -89,14 +89,25 @@ class FritzStatus(AbstractLibraryBase):
return self.fc.call_action("WANIPConn", "X_AVM_DE_GetIPv6Prefix")
@property
- def uptime(self):
- """Uptime in seconds."""
+ def connection_uptime(self):
+ """Connection uptime in seconds."""
status = self.fc.call_action("WANIPConn", "GetStatusInfo")
return status["NewUptime"]
@property
+ def uptime(self):
+ """Connection uptime in seconds. Alias for self.connection_uptime for backward compatibility."""
+ return self.connection_uptime
+
+ @property
+ def device_uptime(self):
+ """Device uptime in seconds."""
+ status = self.fc.call_action("DeviceInfo1", "GetInfo")
+ return status["NewUpTime"]
+
+ @property
def str_uptime(self):
- """Uptime in seconds and in human readable format."""
+ """Connection uptime in human readable format."""
mins, secs = divmod(self.uptime, 60)
hours, mins = divmod(mins, 60)
return "%02d:%02d:%02d" % (hours, mins, secs) | Add wan_uptime, device_uptime and deprecate uptime (#<I>)
* Add wan_uptime, device_uptime and deprecate uptime
* Update fritzstatus.py
* Removed logging (no more in use)
* Update fritzstatus.py
* Update fritzstatus.py
* Update fritzstatus.py | kbr_fritzconnection | train | py |
58d30a0250fa7a508bbc725818057eaaa09f7811 | diff --git a/vendor/refinerycms/core/lib/refinery/generators.rb b/vendor/refinerycms/core/lib/refinery/generators.rb
index <HASH>..<HASH> 100644
--- a/vendor/refinerycms/core/lib/refinery/generators.rb
+++ b/vendor/refinerycms/core/lib/refinery/generators.rb
@@ -32,8 +32,8 @@ module Refinery
case path
when %r{.*/migrate/.*}
migration_template path, Rails.root.join('db', 'migrate', path.split('/migrate/').last.split(/^\d*_/).last)
- when %r{.*/seeds.*}
- template path, Rails.root.join("db/seeds#{path.split('/seeds').last}")
+ when %r{.*/seeds/.*}
+ template path, Rails.root.join('db', 'seeds', path.split('/seeds/').last)
end
end | Don't try to recreate the db/seeds.rb file, as it will have a conflict and refuse to go any further. | refinery_refinerycms | train | rb |
106ba98d64f2904053fd8dc86d15bca0a657546d | diff --git a/src/main/java/edu/ksu/canvas/CanvasApiFactory.java b/src/main/java/edu/ksu/canvas/CanvasApiFactory.java
index <HASH>..<HASH> 100644
--- a/src/main/java/edu/ksu/canvas/CanvasApiFactory.java
+++ b/src/main/java/edu/ksu/canvas/CanvasApiFactory.java
@@ -168,6 +168,8 @@ public class CanvasApiFactory {
readerMap.put(RoleReader.class, RoleImpl.class);
readerMap.put(ExternalToolReader.class, ExternalToolImpl.class);
readerMap.put(LoginReader.class, LoginImpl.class);
+ readerMap.put(AccountReportSummaryReader.class, AccountReportSummaryImpl.class);
+ readerMap.put(AccountReportReader.class, AccountReportImpl.class);
writerMap.put(AssignmentOverrideWriter.class, AssignmentOverrideImpl.class);
writerMap.put(AdminWriter.class, AdminImpl.class); | Add essential report classes to the API factory | kstateome_canvas-api | train | java |
317d100256ab7709cee4830573235a3d773fd54a | diff --git a/Seeder.php b/Seeder.php
index <HASH>..<HASH> 100644
--- a/Seeder.php
+++ b/Seeder.php
@@ -59,7 +59,7 @@ class Seeder {
// the databases via a connection and fire an event noting the seeding.
$table = $this->getTable($records, $file);
- $connection->table($table)->truncate();
+ $connection->table($table)->delete();
$connection->table($table)->insert($records); | move back to delete for seeding. | illuminate_database | train | php |
0e1f9ef99a5be81ad5b717507d22a374e816cb4f | diff --git a/container/src/main/java/org/jboss/forge/furnace/impl/FurnaceImpl.java b/container/src/main/java/org/jboss/forge/furnace/impl/FurnaceImpl.java
index <HASH>..<HASH> 100644
--- a/container/src/main/java/org/jboss/forge/furnace/impl/FurnaceImpl.java
+++ b/container/src/main/java/org/jboss/forge/furnace/impl/FurnaceImpl.java
@@ -137,7 +137,6 @@ public class FurnaceImpl implements Furnace
}
fireBeforeContainerStartedEvent();
- status = ContainerStatus.STARTED;
try
{
@@ -172,6 +171,8 @@ public class FurnaceImpl implements Furnace
}
}
}
+ status = ContainerStatus.STARTED;
+
Thread.sleep(100);
}
while (alive && serverMode); | Don't mark container as started until after first stable addon bootup sequence. | forge_furnace | train | java |
17ace24909b865f12e8d3389851b0a053d47e696 | diff --git a/installation-bundle/src/Translation/LanguageResolver.php b/installation-bundle/src/Translation/LanguageResolver.php
index <HASH>..<HASH> 100644
--- a/installation-bundle/src/Translation/LanguageResolver.php
+++ b/installation-bundle/src/Translation/LanguageResolver.php
@@ -87,11 +87,9 @@ class LanguageResolver
}
}
- $locale = $chunks[0];
-
// Language only, e.g. "en" or "fr"
- if (preg_match('/^[a-z]{2}$/', $locale)) {
- $locales[] = $locale;
+ if (preg_match('/^[a-z]{2}$/', $chunks[0])) {
+ $locales[] = $chunks[0];
}
} | [Installation] Fix a minor coding style issue. | contao_contao | train | php |
0c5cc42c378022df433bdac3751e3265b0c424c0 | diff --git a/pyxel/audio_player.py b/pyxel/audio_player.py
index <HASH>..<HASH> 100644
--- a/pyxel/audio_player.py
+++ b/pyxel/audio_player.py
@@ -68,6 +68,10 @@ class Channel:
if not self._is_playing:
return
+ if self._total_note_time == 0:
+ self._next_sound()
+ return
+
# forward note
if self._time % self._one_note_time == 0:
sound = self._sound_list[self._sound_index]
@@ -121,15 +125,18 @@ class Channel:
self._time += 1
if self._time == self._total_note_time:
- self._sound_index += 1
+ self._next_sound()
- if self._sound_index < len(self._sound_list):
- self._play_sound()
- elif self._is_loop:
- self._sound_index = 0
- self._play_sound()
- else:
- self.stop()
+ def _next_sound(self):
+ self._sound_index += 1
+
+ if self._sound_index < len(self._sound_list):
+ self._play_sound()
+ elif self._is_loop:
+ self._sound_index = 0
+ self._play_sound()
+ else:
+ self.stop()
@staticmethod
def _note_to_pitch(note): | Changed to allow sound of length 0 | kitao_pyxel | train | py |
58becf116580c37c63b89f4a660ebe293f6e7c4e | diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/cases/finder_test.rb
+++ b/activerecord/test/cases/finder_test.rb
@@ -209,7 +209,7 @@ class FinderTest < ActiveRecord::TestCase
end
def test_model_class_responds_to_first_bang
- assert_equal topics(:first), Topic.first!
+ assert_equal topics(:first), Topic.order(:id).first!
assert_raises ActiveRecord::RecordNotFound do
Topic.delete_all
Topic.first! | order is not guaranteed by this select, so add an order and call first! | rails_rails | train | rb |
284895d2887350b501fde3217ffe4e73da0ddd52 | diff --git a/constructor/callbacks-once/callbacks-once_test.js b/constructor/callbacks-once/callbacks-once_test.js
index <HASH>..<HASH> 100644
--- a/constructor/callbacks-once/callbacks-once_test.js
+++ b/constructor/callbacks-once/callbacks-once_test.js
@@ -42,10 +42,10 @@ QUnit.test('createInstance triggers a "created" event', function(assert){
});
QUnit.test("different methods should not refer to the same last item", function(){
- var Session = DefineMap.extend({
- id: 'number',
- email: 'string'
- });
+ function Session(data){
+ this.id = data.id;
+ this.email = data.email;
+ }
var createdCalled = 0;
var destroyedCalled = 0; | simplified test - removed DefineMap | canjs_can-connect | train | js |
300af6e6acabbffbda34ef1763f4b7f7a670f6c4 | diff --git a/docs/js/doc.js b/docs/js/doc.js
index <HASH>..<HASH> 100644
--- a/docs/js/doc.js
+++ b/docs/js/doc.js
@@ -150,9 +150,13 @@
function tocMenu(){
$('.toc-menu select').change(function(){
+ var $body = $('body');
var href = $(this).val();
+ var scroll0 = $body.scrollTop();
window.location.hash = href;
- $('html, body').animate({scrollTop: '-=100px'}, 800);
+ var scroll1 = $body.scrollTop();
+ var deltaScroll = scroll1 - scroll0;
+ $body.scrollTop($body.scrollTop() - (deltaScroll>0?200:0)).animate({scrollTop: (deltaScroll>0?'+':'-')+'=100px'}, 300)
});
} | docs(live-doc): in mobile view, makes menu moves consistent with pos | algolia_instantsearch.js | train | js |
b68787a61043783d266b8d6bb0aa86075a855897 | diff --git a/karma.conf.js b/karma.conf.js
index <HASH>..<HASH> 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -2,14 +2,10 @@
process.env.CHROME_BIN = require('puppeteer').executablePath();
module.exports = function (config) {
- const { argv } = process;
- let files;
-
- for (const arg of argv) {
- if (arg.startsWith('-f=')) {
- files = arg.slice(3).split(',');
- }
- }
+ const files = process.argv
+ .find(it => it.startsWith('-f='))
+ .slice(3)
+ .split(',');
config.set({
files, | simplify `karma.conf` | zloirock_core-js | train | js |
c1b0ec6faf6f987486666f9b80cd312c4c391cb4 | diff --git a/test/testcrawl.js b/test/testcrawl.js
index <HASH>..<HASH> 100644
--- a/test/testcrawl.js
+++ b/test/testcrawl.js
@@ -52,7 +52,7 @@ describe("Test Crawl",function() {
asyncCrawler.start();
asyncCrawler.on("fetchcomplete",function(queueItem,data,res) {
- evtDone = this.wait();
+ var evtDone = this.wait();
setTimeout(function(){
linksDiscovered ++; | Fixes global leak in tests. | simplecrawler_simplecrawler | train | js |
3c6b8bb8882fcd2083d1c489df3cc40062b4896c | diff --git a/network.go b/network.go
index <HASH>..<HASH> 100644
--- a/network.go
+++ b/network.go
@@ -124,6 +124,9 @@ func (mapper *PortMapper) setup() error {
if err := iptables("-t", "nat", "-A", "PREROUTING", "-j", "DOCKER"); err != nil {
return errors.New("Unable to setup port networking: Failed to inject docker in PREROUTING chain")
}
+ if err := iptables("-t", "nat", "-A", "OUTPUT", "-j", "DOCKER"); err != nil {
+ return errors.New("Unable to setup port networking: Failed to inject docker in OUTPUT chain")
+ }
return nil
} | Fixing Issue #<I>: Adding DOCKER to output chain during iptables setup | moby_moby | train | go |
54229f97f8179ae03bf0a45081a92f0fc02316db | diff --git a/pilot/lib/pilot/build_manager.rb b/pilot/lib/pilot/build_manager.rb
index <HASH>..<HASH> 100644
--- a/pilot/lib/pilot/build_manager.rb
+++ b/pilot/lib/pilot/build_manager.rb
@@ -22,7 +22,7 @@ module Pilot
UI.user_error!("Error uploading ipa file, for more information see above")
end
- UI.message("Successfully uploaded the new binary to iTunes Connect")
+ UI.success("Successfully uploaded the new binary to iTunes Connect")
if config[:skip_waiting_for_build_processing]
UI.important("Skip waiting for build processing")
@@ -74,7 +74,8 @@ module Pilot
return if config[:skip_submission]
distribute_build(build, options)
- UI.message("Successfully distributed build to beta testers 🚀")
+ type = options[:distribute_external] ? 'External' : 'Internal'
+ UI.success("Successfully distributed build to #{type} testers 🚀")
end
def list(options) | [pilot] Proper use of UI.success and display testflight distribution channel (#<I>) | fastlane_fastlane | train | rb |
98fae1598554a7501898cbefb59212ea04f9168d | diff --git a/flake8_import_order/__init__.py b/flake8_import_order/__init__.py
index <HASH>..<HASH> 100644
--- a/flake8_import_order/__init__.py
+++ b/flake8_import_order/__init__.py
@@ -171,11 +171,18 @@ class ImportOrderChecker(object):
prev_node = None
for node in self.visitor.imports:
+ n = self.visitor.node_sort_key(node)
+
+ if n[-1] and not is_sorted(n[-1]):
+ yield self.error(
+ node, "I101",
+ "Imported names are in the wrong order"
+ )
+
if prev_node is None:
prev_node = node
continue
- n = self.visitor.node_sort_key(node)
pn = self.visitor.node_sort_key(prev_node)
# FUTURES
@@ -200,12 +207,6 @@ class ImportOrderChecker(object):
"Imports are in the wrong order"
)
- if n[-1] and not is_sorted(n[-1]):
- yield self.error(
- node, "I101",
- "Imported names are in the wrong order"
- )
-
lines_apart = node.lineno - prev_node.lineno
if ( | Properly process the first import in a group. Fixes #9 | PyCQA_flake8-import-order | train | py |
c33846aa68431d8ac4ae5599956d5b8dfa876832 | diff --git a/functions/functions-wp-helper.php b/functions/functions-wp-helper.php
index <HASH>..<HASH> 100644
--- a/functions/functions-wp-helper.php
+++ b/functions/functions-wp-helper.php
@@ -10,6 +10,20 @@
return false;
}
+ function get_params($i = -1){
+ $args = explode('/', trim(strtolower($_SERVER['REQUEST_URI'])));
+ $newargs = array();
+ foreach($args as $arg){
+ if (strlen($arg)){
+ $newargs[] = $arg;
+ }
+ }
+ if ($i > -1){
+ return $newargs[$i];
+ }
+ return $newargs;
+ }
+
function get_json($url){
$data = self::get_curl($url);
return json_decode($data); | added a get_params to wp-helper | timber_timber | train | php |
87934f9986c6c9f3dc9162e073d43c915735b8a2 | diff --git a/src/Platform/Screen/Screen.php b/src/Platform/Screen/Screen.php
index <HASH>..<HASH> 100644
--- a/src/Platform/Screen/Screen.php
+++ b/src/Platform/Screen/Screen.php
@@ -108,14 +108,12 @@ abstract class Screen
public function handle($method = null, $parameters = null)
{
if ($this->request->method() === 'GET' || (is_null($method) && is_null($parameters))) {
-
$this->arguments = is_array($method) ? $method : [$method];
return $this->view();
}
if (! is_null($parameters)) {
-
$this->arguments = is_array($method) ? $method : [$method];
$this->reflectionParams($parameters);
@@ -123,7 +121,6 @@ abstract class Screen
return call_user_func_array([$this, $parameters], $this->arguments);
}
-
$this->arguments = is_array($parameters) ? $parameters : [$parameters];
$this->reflectionParams($method);
@@ -141,7 +138,7 @@ abstract class Screen
if (is_null($parameter->getClass())) {
continue;
}
-
+
if ($this->checkClassInArray($key)) {
continue;
} | Apply fixes from StyleCI (#<I>)
[ci skip] [skip ci] | orchidsoftware_platform | train | php |
b13cb0c1b77f9df7c33913bce37dae0791e240c6 | diff --git a/lib/fluent/plugin/buffer.rb b/lib/fluent/plugin/buffer.rb
index <HASH>..<HASH> 100644
--- a/lib/fluent/plugin/buffer.rb
+++ b/lib/fluent/plugin/buffer.rb
@@ -489,6 +489,7 @@ module Fluent
if metadata && !@stage[metadata] && (!@queued_num[metadata] || @queued_num[metadata] < 1)
@metadata_list.delete(metadata)
+ @queued_num.delete(metadata)
end
log.trace "chunk purged", instance: self.object_id, chunk_id: dump_unique_id_hex(chunk_id), metadata: metadata
end | Delete empty queued_num field after purging chunks
This should fix the memory-leak bug described in #<I>. | fluent_fluentd | train | rb |
0dc136f5d4657e238ef48aa735cce89c16985969 | diff --git a/src/java/voldemort/store/routed/NodeValue.java b/src/java/voldemort/store/routed/NodeValue.java
index <HASH>..<HASH> 100644
--- a/src/java/voldemort/store/routed/NodeValue.java
+++ b/src/java/voldemort/store/routed/NodeValue.java
@@ -24,7 +24,8 @@ import voldemort.versioning.Versioned;
import com.google.common.base.Objects;
/**
- * A wrapper around a node id, key and value
+ * A wrapper around a node id, key and value. This class represents one
+ * key/value as fetched from a single server.
*
* @author jay
*
@@ -83,8 +84,6 @@ final class NodeValue<K, V> implements Serializable, Cloneable {
return true;
if(!(o instanceof NodeValue))
return false;
- if(o == null)
- return false;
NodeValue<?, ?> v = (NodeValue<?, ?>) o;
return getNodeId() == v.getNodeId() && Objects.equal(getKey(), v.getKey()) | Redundant null check (patch from ishmael). Add meaningful docs. | voldemort_voldemort | train | java |
a8d8f53368db9a537aa3081795db9f433bdf47b1 | diff --git a/src/Messaging/PayloadTrait.php b/src/Messaging/PayloadTrait.php
index <HASH>..<HASH> 100644
--- a/src/Messaging/PayloadTrait.php
+++ b/src/Messaging/PayloadTrait.php
@@ -52,4 +52,10 @@ trait PayloadTrait
{
$this->payload = $payload;
}
+
+ /**
+ * Use this method to initialize message with defaults or extend your class from
+ * \Prooph\Common\Messaging\DomainMessage
+ */
+ abstract protected function init();
} | added abstract method init() to ensure it's available | prooph_common | train | php |
177d2be51613b309b2996825f054a60442662cda | diff --git a/lib/spreadsheet.rb b/lib/spreadsheet.rb
index <HASH>..<HASH> 100644
--- a/lib/spreadsheet.rb
+++ b/lib/spreadsheet.rb
@@ -42,7 +42,7 @@ module Spreadsheet
##
# The version of Spreadsheet you are using.
- VERSION = '0.6.5.4'
+ VERSION = '0.6.5.6'
##
# Default client Encoding. Change this value if your application uses a | Updated Version to <I> | zdavatz_spreadsheet | train | rb |
5b0bd4f305532a73f7330dfcff00a43572c6fcc5 | diff --git a/FluentDOM.php b/FluentDOM.php
index <HASH>..<HASH> 100644
--- a/FluentDOM.php
+++ b/FluentDOM.php
@@ -562,11 +562,12 @@ class FluentDOM implements IteratorAggregate, Countable, ArrayAccess {
throw new UnexpectedValueException('Invalid QName: QName is empty.');
} elseif (FALSE !== strpos($name, ':')) {
list($namespace, $localName) = explode(':', $name, 2);
- if ($this->_isNCName($namespace)) {
- return $this->_isNCName($localName, strlen($namespace));
- }
+ $this->_isNCName($namespace);
+ $this->_isNCName($localName, strlen($namespace));
+ return TRUE;
}
- return $this->_isNCName($name);
+ $this->_isNCName($name);
+ return TRUE;
}
/** | - Implemented: QName relies now on exceptions | ThomasWeinert_FluentDOM | train | php |
ba986c3254491631f12b7d840968284c1e6fb618 | diff --git a/fastlane/spec/private_public_fastfile_spec.rb b/fastlane/spec/private_public_fastfile_spec.rb
index <HASH>..<HASH> 100644
--- a/fastlane/spec/private_public_fastfile_spec.rb
+++ b/fastlane/spec/private_public_fastfile_spec.rb
@@ -25,6 +25,7 @@ describe Fastlane do
end
it "doesn't expose the private lanes in `fastlane lanes`" do
+ require 'fastlane/lane_list'
result = Fastlane::LaneList.generate(path)
expect(result).to include("such smooth")
expect(result).to_not include("private call") | Fix NameError when running single rspec (#<I>)
Running below command cause NameError: uninitialized constant Fastlane::LaneList.
This fix the issue.
```
rspec fastlane/spec/private_public_fastfile_spec.rb
``` | fastlane_fastlane | train | rb |
e344716e0a828e0e977bfb57d32577c230ce32be | diff --git a/lib/minispec-metadata/version.rb b/lib/minispec-metadata/version.rb
index <HASH>..<HASH> 100644
--- a/lib/minispec-metadata/version.rb
+++ b/lib/minispec-metadata/version.rb
@@ -1,3 +1,3 @@
module MiniSpecMetadata
- VERSION = "1.0.0"
+ VERSION = "2.0.0"
end | Bump to version <I>. | ordinaryzelig_minispec-metadata | train | rb |
38a9b23cf9ff4ee523b0a27bb59cdf9b3836771c | diff --git a/xerox/win.py b/xerox/win.py
index <HASH>..<HASH> 100644
--- a/xerox/win.py
+++ b/xerox/win.py
@@ -27,7 +27,7 @@ def paste():
"""Returns system clipboard contents."""
clip.OpenClipboard()
- d = clip.GetClipboardData(win32con.CF_TEXT)
+ d = clip.GetClipboardData(win32con.CF_UNICODETEXT)
clip.CloseClipboard()
return d | Ensure Unicode is returned for Windows | kennethreitz_xerox | train | py |
edc582a241cf41f258dcee8cce81f659e54493b5 | diff --git a/src/main/python/rlbot/parsing/custom_config.py b/src/main/python/rlbot/parsing/custom_config.py
index <HASH>..<HASH> 100644
--- a/src/main/python/rlbot/parsing/custom_config.py
+++ b/src/main/python/rlbot/parsing/custom_config.py
@@ -1,5 +1,7 @@
-import re
from configparser import RawConfigParser
+from pathlib import Path
+from typing import Union
+import re
import os
@@ -70,7 +72,7 @@ class ConfigObject:
for header in self.headers.values():
header.init_indices(max_index)
- def parse_file(self, config, max_index=None, config_directory=None):
+ def parse_file(self, config: Union[Path, str, RawConfigParser, 'ConfigObject'], max_index=None, config_directory=None):
"""
Parses the file internally setting values
:param config: an instance of RawConfigParser or a string to a .cfg file
@@ -79,6 +81,9 @@ class ConfigObject:
"""
self.config_directory = config_directory
+ if isinstance(config, Path):
+ config = str(config)
+
if isinstance(config, str):
if not os.path.isfile(config):
raise FileNotFoundError(config) | Support specifying files by Path in parse_file() (#<I>) | RLBot_RLBot | train | py |
9685aefbd0517dd179da1a0a3cce1722474ad32d | diff --git a/Tests/Functional/Drivers/Queue/StompQueueDriverTest.php b/Tests/Functional/Drivers/Queue/StompQueueDriverTest.php
index <HASH>..<HASH> 100644
--- a/Tests/Functional/Drivers/Queue/StompQueueDriverTest.php
+++ b/Tests/Functional/Drivers/Queue/StompQueueDriverTest.php
@@ -39,7 +39,7 @@ class StompQueueDriverTest extends AbstractQueueDriverTest
*/
protected function createDriver(): QueueDriverInterface
{
- return $this->getContainer()->get('smartesb.drivers.queue.rabbitmq');
+ return $this->getContainer()->get('smartesb.drivers.queue.main');
}
/** | AMQP: Revert wrong call to contianer | smartboxgroup_integration-framework-bundle | train | php |
e2405cd9bf1628ba9f027fffc1e02631ff35c409 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -72,7 +72,7 @@ Watchify.prototype.build = function () {
var outputFile = destDir + '/' + this.options.outputFile;
- mkdirp.sync(path.basename(outputFile));
+ mkdirp.sync(this.outputPath + '/' + path.dirname(outputFile));
this.options.browserify.basedir = this.cachePath; | ensure directory for output exists, but relative to the outputPath | eploko_broccoli-watchify | train | js |
cfce9c5fc5696c36ba80445e13f76abc27ad43ee | diff --git a/index/upside_down/row.go b/index/upside_down/row.go
index <HASH>..<HASH> 100644
--- a/index/upside_down/row.go
+++ b/index/upside_down/row.go
@@ -551,9 +551,7 @@ func (tfr *TermFrequencyRow) parseV(value []byte) error {
tv := TermVector{}
tv.field = uint16(field)
// at this point we expect at least one term vector
- if tfr.vectors == nil {
- tfr.vectors = make([]*TermVector, 0)
- }
+ tfr.vectors = make([]*TermVector, 0)
tv.pos, bytesRead = binary.Uvarint(value[currOffset:])
if bytesRead <= 0 { | initialize term vector list in parseV
otherwise reusing previous term frequency row causes us to
keep tacking on to one gigantic list | blevesearch_bleve | train | go |
d79ecc7ba250ce6910542152c86c03e6bb461bc8 | diff --git a/test/clean.js b/test/clean.js
index <HASH>..<HASH> 100644
--- a/test/clean.js
+++ b/test/clean.js
@@ -14,7 +14,11 @@ test('\nclean tests', function(t) {
[' =v1.2.3 ', '1.2.3'],
['v1.2.3', '1.2.3'],
[' v1.2.3 ', '1.2.3'],
- ['\t1.2.3', '1.2.3']
+ ['\t1.2.3', '1.2.3'],
+ ['>1.2.3', null],
+ ['~1.2.3', null],
+ ['<=1.2.3', null],
+ ['1.2.x', null]
].forEach(function(tuple) {
var range = tuple[0];
var version = tuple[1]; | (clean) added test cases for ranges
See item #<I> | npm_node-semver | train | js |
6f4c6780feb4e68428a068614602ade4919d7759 | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright 2016, Pedro Salgado
+# Copyright 2016-2018, Pedro Salgado
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -81,7 +81,7 @@ master_doc = 'index'
# General information about the project.
project = _package
author = 'Pedro Salgado'
-copyright = '2016, Pedro Salgado'
+copyright = '2016-2018, Pedro Salgado'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the | docs/conf.py: updated copyright range. | steenzout_python-sphinx | train | py |
934d1aeffb13b3f9655717921ece9d0b9578e2fa | diff --git a/lib/GeneratorResolver.php b/lib/GeneratorResolver.php
index <HASH>..<HASH> 100644
--- a/lib/GeneratorResolver.php
+++ b/lib/GeneratorResolver.php
@@ -200,9 +200,9 @@ trait GeneratorResolver {
if (is_callable($current)) {
$promise = new Success(function() use ($current) {
$result = call_user_func_array($current, func_get_args());
- if ($result instanceof \Generator) {
- $this->resolveGenerator($result);
- }
+ return $result instanceof \Generator
+ ? $this->resolveGenerator($result)
+ : $result;
});
} else {
$promise = new Failure(new \DomainException(
diff --git a/test/GeneratorResolverTest.php b/test/GeneratorResolverTest.php
index <HASH>..<HASH> 100644
--- a/test/GeneratorResolverTest.php
+++ b/test/GeneratorResolverTest.php
@@ -298,7 +298,8 @@ class GeneratorResolverTest extends \PHPUnit_Framework_TestCase {
// Because this Generator function is bound to the reactor it should be
// automatically resolved and our repeating watcher should be cancelled
// allowing the reactor to stop running.
- $boundFunc();
+ $result = $boundFunc();
+ $this->assertInstanceOf('Amp\\Promise', $result);
});
}
} | Return promise/result from bound functions | amphp_amp | train | php,php |
e40ad1e80f58e0356305cfb284184def261ed54b | diff --git a/src/Router.php b/src/Router.php
index <HASH>..<HASH> 100644
--- a/src/Router.php
+++ b/src/Router.php
@@ -167,18 +167,6 @@ class Router
/**
*
- * Clears out all existing definitions.
- *
- * @return null
- *
- */
- public function reset()
- {
- return $this->setRoutes(array());
- }
-
- /**
- *
* Gets a route that matches a given path and other server conditions.
*
* @param string $path The path to match against. | don't need reset() any more | auraphp_Aura.Router | train | php |
c12fde505ddb96893b168ef9b9f50b70caeacbcc | diff --git a/lib/rspec-puppet-utils.rb b/lib/rspec-puppet-utils.rb
index <HASH>..<HASH> 100644
--- a/lib/rspec-puppet-utils.rb
+++ b/lib/rspec-puppet-utils.rb
@@ -1,10 +1,4 @@
-require 'rspec'
-require 'mocha'
require 'mock_function'
require 'template_harness'
require 'hieradata/validator'
require 'hieradata/yaml_validator'
-
-RSpec.configure do |c|
- c.mock_with :mocha
-end
diff --git a/spec/classes/utils_spec.rb b/spec/classes/utils_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/classes/utils_spec.rb
+++ b/spec/classes/utils_spec.rb
@@ -1,6 +1,8 @@
require 'spec_helper'
require 'rspec-puppet-utils'
+include RSpecPuppetUtils
+
describe 'rspec-puppet-utils' do
it 'should require MockFunction' do | Cleaned up rspec-puppet-utils and removed unnecessary requires | Accuity_rspec-puppet-utils | train | rb,rb |
67a167a225e8c5c9183ae0baf5d88eb7c0ee120e | diff --git a/contentfiles/storage.py b/contentfiles/storage.py
index <HASH>..<HASH> 100644
--- a/contentfiles/storage.py
+++ b/contentfiles/storage.py
@@ -9,7 +9,7 @@ from django.utils.six.moves import urllib
from storages.backends.s3boto import S3BotoStorage
-CONTENTFILES_SSL = getattr(settings, 'CONTENTFILES_SSL', False)
+CONTENTFILES_SSL = getattr(settings, 'CONTENTFILES_SSL', True)
CONTENTFILES_PREFIX = getattr(settings, 'CONTENTFILES_PREFIX')
CONTENTFILES_HOSTNAME = getattr(settings, 'CONTENTFILES_HOSTNAME', None) | Use SSL by default for contentfiles
It's <I>! Allow turning off if needed though... | developersociety_blanc-contentfiles | train | py |
a4ee25fd891375995b883fef3d31352fe3735b5c | diff --git a/lang/en/commands.php b/lang/en/commands.php
index <HASH>..<HASH> 100644
--- a/lang/en/commands.php
+++ b/lang/en/commands.php
@@ -2,7 +2,7 @@
return [
- 'controller.title' => 'Admins',
+ 'controller.title' => 'Commands',
'controller.description' => 'Trigger any command for this site. Note: these may take awhile to execute.',
'execute' => 'Execute', | Fixing commands title
Closes #<I> | BKWLD_decoy | train | php |
1961014cda2a95031d3add6b8144e6c8da2953ac | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -414,7 +414,8 @@ module.exports = function(grunt) {
// Development
watch: {
options: {
- livereload: LIVERELOAD_PORT
+ livereload: LIVERELOAD_PORT,
+ spawn: false
},
scss: {
files: ['<%= path.blocks %>**/*.scss', '<%= path.bundles %>**/*.scss', '<%= path.blocks %>**/*.md'], | Don't spawn another grunt to speed up watch build
Former-commit-id: ce<I>a<I>b<I>dc0bcb<I>e2fd<I>ade | JetBrains_ring-ui | train | js |
6fb41cb7aa3179f69d034bc802655211246b0f3f | diff --git a/src/Database/vxPDO.php b/src/Database/vxPDO.php
index <HASH>..<HASH> 100644
--- a/src/Database/vxPDO.php
+++ b/src/Database/vxPDO.php
@@ -12,7 +12,7 @@ namespace vxPHP\Database;
*
* @author Gregor Kofler, info@gregorkofler.com
*
- * @version 1.4.0, 2016-04-04
+ * @version 1.4.1, 2016-04-11
*/
class vxPDO extends \PDO implements DatabaseInterface {
@@ -199,7 +199,7 @@ class vxPDO extends \PDO implements DatabaseInterface {
else if($attribute === strtolower(self::UPDATE_FIELD) && $this->touchLastUpdated) {
$names[] = self::UPDATE_FIELD;
- $values[] = NULL;
+ $values[] = date('Y-m-d H:i:s');
}
else if($attribute === strtolower(self::CREATE_FIELD)) {
@@ -266,7 +266,7 @@ class vxPDO extends \PDO implements DatabaseInterface {
else if($attribute === strtolower(self::UPDATE_FIELD) && $this->touchLastUpdated) {
$names[] = self::UPDATE_FIELD;
- $values[] = NULL;
+ $values[] = date('Y-m-d H:i:s');
}
} | Update field with updateRecord() and insertRecord() is now explicitly
written with a current timestamp, instead of relying on a timestamp
mechanism on the database side | Vectrex_vxPHP | train | php |
f72ab1aedff3d87888d28460bf44d6f6efb11690 | diff --git a/src/Anonym/Components/RequestHeaders.php b/src/Anonym/Components/RequestHeaders.php
index <HASH>..<HASH> 100644
--- a/src/Anonym/Components/RequestHeaders.php
+++ b/src/Anonym/Components/RequestHeaders.php
@@ -15,8 +15,23 @@
*/
class RequestHeaders
{
+ /**
+ * Headerları depolar
+ *
+ * @var array|false
+ */
protected $headers;
+
+ /**
+ * server bilgilerini depolar
+ *
+ * @var array
+ */
private $server;
+
+ /**
+ * sınıfı başlatır
+ */
public function __construct()
{
$this->headers = getallheaders();
@@ -31,6 +46,7 @@
{
return $this->server;
}
+
/**
* Header'ları ekler
*
@@ -40,4 +56,4 @@
{
return $this->headers;
}
- }
\ No newline at end of file
+ } | added comment lines to request headers class | AnonymPHP_Anonym-HttpFoundation | train | php |
028bd557ea1ad49d7b588ae73bbfa78204ad5290 | diff --git a/ds4drv/backends/hidraw.py b/ds4drv/backends/hidraw.py
index <HASH>..<HASH> 100644
--- a/ds4drv/backends/hidraw.py
+++ b/ds4drv/backends/hidraw.py
@@ -3,6 +3,7 @@ import itertools
from evdev import InputDevice
from pyudev import Context, Monitor
+from time import sleep
from ..backend import Backend
from ..exceptions import DeviceError
@@ -129,6 +130,11 @@ class HidrawBackend(Backend):
self._scanning_log_message()
for device in iter(monitor.poll, None):
if device.action == "add":
+ # Sometimes udev rules has not been applied at this point,
+ # causing permission denied error if we are running in user
+ # mode. With this sleep this will hopefully not happen.
+ sleep(1)
+
yield device
self._scanning_log_message() | hidraw: Attempt to fix potential race with udev rules. | chrippa_ds4drv | train | py |
9f94a7a401f678975197f6c5e8d39e8f2e7a6911 | diff --git a/sphinxcontrib/katex.py b/sphinxcontrib/katex.py
index <HASH>..<HASH> 100644
--- a/sphinxcontrib/katex.py
+++ b/sphinxcontrib/katex.py
@@ -85,9 +85,13 @@ def run_katex(latex, *options):
(cmd, ) + options,
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
+ stderr=subprocess.PIPE,
env=os.environ.copy()
)
stdout, stderr = p.communicate(latex.encode('utf-8'))
+ if p.returncode:
+ msg = 'KaTeX failed with\n: ' + stderr.decode('utf-8')
+ raise RuntimeError(msg)
return stdout.decode('utf-8') | Let pre-rendering fail if KaTeX fails (#<I>) | hagenw_sphinxcontrib-katex | train | py |
a21ceebeecb48a847acb3a629b2559574b6c2c21 | diff --git a/src/Client/ClientInterfaceRule.php b/src/Client/ClientInterfaceRule.php
index <HASH>..<HASH> 100644
--- a/src/Client/ClientInterfaceRule.php
+++ b/src/Client/ClientInterfaceRule.php
@@ -15,5 +15,5 @@ class ClientInterfaceRule extends ApiInterfaceRule implements InterfaceAware
/**
* @var string
*/
- protected $classRegex = '(\\\\Client\\\\.+ClientInterface$)';
+ protected $classRegex = '(\\\\Client\\\\[A-Za-z]+\\\\[A-Za-z]+ClientInterface$)';
}
diff --git a/src/Common/ApiInterfaceRule.php b/src/Common/ApiInterfaceRule.php
index <HASH>..<HASH> 100644
--- a/src/Common/ApiInterfaceRule.php
+++ b/src/Common/ApiInterfaceRule.php
@@ -81,7 +81,7 @@ class ApiInterfaceRule extends SprykerAbstractRule implements InterfaceAware
if (
preg_match(
'(
- \*\s+[{}A-Z0-9\-]+.*\s+
+ \*\s+["{}\[\],=>$A-Z0-9\-]+.*\s+
\*?\s*
\*\s+@api
)xi', | TE-<I>: Fixed false-positive reports in ClientInterfaceRule and ApiInterfaceRule | spryker_architecture-sniffer | train | php,php |
cb3232dccefa4f1a1d57f07788507f63265aa5fa | diff --git a/lib/contentful_rails/preview.rb b/lib/contentful_rails/preview.rb
index <HASH>..<HASH> 100644
--- a/lib/contentful_rails/preview.rb
+++ b/lib/contentful_rails/preview.rb
@@ -15,8 +15,8 @@ module ContentfulRails
return
end
- #check subdomain matches the configured one
- if request.subdomain == ContentfulRails.configuration.preview_domain
+ #check subdomain matches the configured one - we assume it's first sub.domain.in.the.array
+ if request.subdomains.first == ContentfulRails.configuration.preview_domain
authenticated = authenticate_with_http_basic do |u,p|
u == ContentfulRails.configuration.preview_username
p == ContentfulRails.configuration.preview_password | Always use the first subdomain to determine whether this is the preview domain or now | contentful_contentful_rails | train | rb |
8297bdbd1a3fe3af8f3efbc51e3d3bd9049b9056 | diff --git a/pymacaron/__init__.py b/pymacaron/__init__.py
index <HASH>..<HASH> 100644
--- a/pymacaron/__init__.py
+++ b/pymacaron/__init__.py
@@ -265,6 +265,9 @@ class API(object):
log.info("Running in a Celery worker - Not starting the Flask app")
return
+ # Initialize monitoring, if any is defined
+ monitor_init(app=app, config=conf)
+
if os.path.basename(sys.argv[0]) == 'gunicorn':
# Gunicorn takes care of spawning workers
log.info("Running in Gunicorn - Not starting the Flask app")
@@ -273,9 +276,6 @@ class API(object):
# Debug mode is the default when not running via gunicorn
app.debug = self.debug
- # Initialize monitoring, if any
- monitor_init(app=app, config=conf)
-
app.run(host='0.0.0.0', port=self.port)
#
diff --git a/pymacaron/monitor.py b/pymacaron/monitor.py
index <HASH>..<HASH> 100644
--- a/pymacaron/monitor.py
+++ b/pymacaron/monitor.py
@@ -12,8 +12,6 @@ use_scout = False
def monitor_init(app=None, config=None, celery=False):
- log.debug("Init monitoring with app=%s config=%s celery=%s" % (app, config, celery))
-
if not config:
config = get_config() | Bugfix. Initialize monitoring earlier, to monitor even gunicorn apps | pymacaron_pymacaron | train | py,py |
738b9b5c2286c83e2514620895dfd8bbc928d3ce | diff --git a/graylog2-server/src/main/java/org/graylog2/bundles/Extractor.java b/graylog2-server/src/main/java/org/graylog2/bundles/Extractor.java
index <HASH>..<HASH> 100644
--- a/graylog2-server/src/main/java/org/graylog2/bundles/Extractor.java
+++ b/graylog2-server/src/main/java/org/graylog2/bundles/Extractor.java
@@ -43,8 +43,6 @@ public class Extractor {
private String conditionValue;
@JsonProperty
private int order;
- @JsonProperty
- private String regexConditionPattern;
public String getTitle() {
return title;
@@ -125,12 +123,4 @@ public class Extractor {
public void setOrder(int order) {
this.order = order;
}
-
- public String getRegexConditionPattern() {
- return regexConditionPattern;
- }
-
- public void setRegexConditionPattern(String regexConditionPattern) {
- this.regexConditionPattern = regexConditionPattern;
- }
} | Remove unused bundle.Extractor#regexConditionPattern
The field `regexConditionPattern` is actually only used in case of an RegexExtractor
and is derived from `conditionValue` directly (precomiled Pattern instance). | Graylog2_graylog2-server | train | java |
3a2609aa7d938c5f1d3bafd0b77affa75ece73b6 | diff --git a/basic_cms/tests/test_api.py b/basic_cms/tests/test_api.py
index <HASH>..<HASH> 100644
--- a/basic_cms/tests/test_api.py
+++ b/basic_cms/tests/test_api.py
@@ -31,7 +31,7 @@ class CMSPagesApiTests(TestCase):
self.assertEqual(response.status_code, 404)
response = self.client.get(reverse('basic_cms_api', args=['terms']), data)
self.assertEqual(response.status_code, 200)
- self.assertDictEqual(json.loads(self.original_json_data), json.loads(response.content))
+ self.assertDictEqual(json.loads(self.original_json_data), json.loads(response.content.decode("utf-8")))
# self.assertEqual(self.original_json_data, response.content)
response = self.client.get(reverse('basic_cms_api', args=['terms'])) | python <I> support #5 | ArabellaTech_django-basic-cms | train | py |
615b189f808e1683880b3c4054eab9e53205b544 | diff --git a/tests/test_user.py b/tests/test_user.py
index <HASH>..<HASH> 100644
--- a/tests/test_user.py
+++ b/tests/test_user.py
@@ -291,11 +291,11 @@ def test_request_password_reset_by_sms_code(): # type: () -> None
@with_setup(get_setup_func())
def test_reset_password_by_sms_code(): # type: () -> None
try:
- User.reset_password_by_sms_code('1861111' + str(random.randrange(1000, 9999)), "password")
+ User.reset_password_by_sms_code(str(random.randrange(100000, 999999)), "password")
except LeanCloudError as e:
- if e.code != 1:
+ if e.code != 603:
raise e
-
+
@with_setup(get_setup_func())
def test_request_login_sms_code(): # type: () -> None | Add a unit test for reset_password_by_sms_code | leancloud_python-sdk | train | py |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.