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 |
|---|---|---|---|---|---|
aad09d747941df20c65845b183226f5c15519674 | diff --git a/lib/ronin/formatting/binary/packer.rb b/lib/ronin/formatting/binary/packer.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/formatting/binary/packer.rb
+++ b/lib/ronin/formatting/binary/packer.rb
@@ -185,11 +185,14 @@ module Ronin
)
end
+ # The types
+ attr_reader :types
+
#
# Creates a new Binary Packer.
#
- # @param [Array<type, (type, length)>] template
- # The template for the packer.
+ # @param [Array<type, (type, length)>] types
+ # The types which the packer will use.
#
# @raise [ArgumentError]
# A given type is not known.
@@ -229,14 +232,15 @@ module Ronin
# @example
# Packer.new(:uint32, [:char, 100])
#
- def initialize(*template)
+ def initialize(*types)
+ @types = types
@template = ''
- template.each do |format|
- type, length = format
+ types.each do |type|
+ type, length = type
unless (code = TYPES[type])
- raise(ArgumentError,"#{code.inspect} not supported")
+ raise(ArgumentError,"#{type.inspect} not supported")
end
@template << code << length.to_s | Expose the types used by the Packer. | ronin-ruby_ronin-support | train | rb |
ed883449659c2c28f933db7b988fdf1471c2d34c | diff --git a/uPortal-soffit-renderer/src/test/java/org/apereo/portal/soffit/renderer/ModelAttributeServiceTest.java b/uPortal-soffit-renderer/src/test/java/org/apereo/portal/soffit/renderer/ModelAttributeServiceTest.java
index <HASH>..<HASH> 100644
--- a/uPortal-soffit-renderer/src/test/java/org/apereo/portal/soffit/renderer/ModelAttributeServiceTest.java
+++ b/uPortal-soffit-renderer/src/test/java/org/apereo/portal/soffit/renderer/ModelAttributeServiceTest.java
@@ -35,9 +35,6 @@ import org.apereo.portal.soffit.model.v1_0.Preferences;
import org.junit.Test;
import org.mockito.Mockito;
-/**
- * @author drewwills
- */
public class ModelAttributeServiceTest extends ModelAttributeService {
private final Object returnValue = new Object(); | UP-<I>: Modest updates from PR feedback | Jasig_uPortal | train | java |
dbd8101ae9236c0af613a1f182ee421e6a838bc8 | diff --git a/src/WellCommerce/Bundle/ShipmentBundle/WellCommerceShipmentBundle.php b/src/WellCommerce/Bundle/ShipmentBundle/WellCommerceShipmentBundle.php
index <HASH>..<HASH> 100755
--- a/src/WellCommerce/Bundle/ShipmentBundle/WellCommerceShipmentBundle.php
+++ b/src/WellCommerce/Bundle/ShipmentBundle/WellCommerceShipmentBundle.php
@@ -12,7 +12,9 @@
namespace WellCommerce\Bundle\ShipmentBundle;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
use WellCommerce\Bundle\CoreBundle\HttpKernel\AbstractWellCommerceBundle;
+use WellCommerce\Bundle\ShippingBundle\DependencyInjection\Compiler;
/**
* Class WellCommerceShippingBundle | Added WellCommerceShipmentBundle | WellCommerce_WishlistBundle | train | php |
b9386e7be83bc568e8283087c792e20eb248b82f | diff --git a/handler/src/main/java/io/netty/handler/execution/MemoryAwareThreadPoolExecutor.java b/handler/src/main/java/io/netty/handler/execution/MemoryAwareThreadPoolExecutor.java
index <HASH>..<HASH> 100644
--- a/handler/src/main/java/io/netty/handler/execution/MemoryAwareThreadPoolExecutor.java
+++ b/handler/src/main/java/io/netty/handler/execution/MemoryAwareThreadPoolExecutor.java
@@ -452,6 +452,10 @@ public class MemoryAwareThreadPoolExecutor extends ThreadPoolExecutor {
* make sure important tasks are not counted.
*/
protected boolean shouldCount(Runnable task) {
+ if (task instanceof ChannelDownstreamEventRunnable) {
+ return false;
+ }
+
if (task instanceof ChannelUpstreamEventRunnable) {
ChannelUpstreamEventRunnable r = (ChannelUpstreamEventRunnable) task;
ChannelEvent e = r.getEvent(); | Do not count a ChannelDownstreamEventRunnable
* MATPE is only for upstream events. | netty_netty | train | java |
61874cf25d3f43258531f7b54c50bc1dd04e166f | diff --git a/util.go b/util.go
index <HASH>..<HASH> 100755
--- a/util.go
+++ b/util.go
@@ -30,7 +30,7 @@ var (
// NULL character and is the lowest possible value (in terms of codepoint, which is also
// how redis sorts strings) for an ASCII character.
nullString = string([]byte{byte(0)})
- // hardwareId is a unique id for the current machine. Right now it uses the MAC address.
+ // hardwareId is a unique id for the current machine. Right now it uses the crc32 checksum of the MAC address.
hardwareId = ""
) | Update doc comment about hardwareId | albrow_zoom | train | go |
665e94784ca75257df6fe1455e5cdfc41e8c5e46 | diff --git a/superset/assets/src/explore/controlPanels/PivotTable.js b/superset/assets/src/explore/controlPanels/PivotTable.js
index <HASH>..<HASH> 100644
--- a/superset/assets/src/explore/controlPanels/PivotTable.js
+++ b/superset/assets/src/explore/controlPanels/PivotTable.js
@@ -44,4 +44,12 @@ export default {
groupby: { includeTime: true },
columns: { includeTime: true },
},
+ sectionOverrides: {
+ druidTimeSeries: {
+ controlSetRows: [['granularity', 'druid_time_origin'], ['time_range']],
+ },
+ sqlaTimeSeries: {
+ controlSetRows: [['granularity_sqla', 'time_grain_sqla'], ['time_range']],
+ },
+ },
}; | [fix] Adding time grains to PivotTable (#<I>) | apache_incubator-superset | train | js |
ee2d3b2922b4b4b41db73df1b4985039d0de9e70 | diff --git a/src/test/java/tech/sirwellington/alchemy/generator/ChecksTest.java b/src/test/java/tech/sirwellington/alchemy/generator/ChecksTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/tech/sirwellington/alchemy/generator/ChecksTest.java
+++ b/src/test/java/tech/sirwellington/alchemy/generator/ChecksTest.java
@@ -43,13 +43,6 @@ public class ChecksTest
Checks.class.newInstance();
}
- @Test(expected = IllegalAccessException.class)
- public void testCannotInstantiateInnerClass() throws InstantiationException, IllegalAccessException
- {
- System.out.println("testCannotInstantiateInnerClass");
- Checks.class.newInstance();
- }
-
@Test
public void testCheckNotNull()
{ | Removing superfluous test case | SirWellington_alchemy-generator | train | java |
1292445b25c5acab0aa81ce40b55fd40c072a23b | diff --git a/lib/faalis/engine.rb b/lib/faalis/engine.rb
index <HASH>..<HASH> 100644
--- a/lib/faalis/engine.rb
+++ b/lib/faalis/engine.rb
@@ -24,7 +24,12 @@ require 'cancan'
require 'model_discovery'
require 'angularjs-rails'
require 'lodash-rails'
-require 'gettext_i18n_rails'
+
+# required gettext related gem only in developement
+if Rails.env.development?
+ require 'gettext_i18n_rails'
+end
+
module Faalis
# `Engine` class of **Faalis**.
class Engine < ::Rails::Engine | a little enhancement on loading gettext related gems | Yellowen_Faalis | train | rb |
405d746d0cd8cfc7b272a00773e36056b035aca8 | diff --git a/lib/synapse/service_watcher/zookeeper.rb b/lib/synapse/service_watcher/zookeeper.rb
index <HASH>..<HASH> 100644
--- a/lib/synapse/service_watcher/zookeeper.rb
+++ b/lib/synapse/service_watcher/zookeeper.rb
@@ -127,7 +127,12 @@ class Synapse::ServiceWatcher
new_backends = []
@zk.children(@discovery['path'], :watch => true).each do |id|
- node = @zk.get("#{@discovery['path']}/#{id}")
+ begin
+ node = @zk.get("#{@discovery['path']}/#{id}")
+ rescue ZK::Exceptions::NoNode => e
+ log.error("synapse: consistency issue reading #{id} at #{@discovery['path']}: #{e}")
+ next
+ end
begin
# TODO: Do less munging, or refactor out this processing | Fix the race condition in the Zookeeper watcher | airbnb_synapse | train | rb |
cc0236fabdc2cb5e290c4a02861a30078bf325c3 | diff --git a/src/accounts/search_indexes.py b/src/accounts/search_indexes.py
index <HASH>..<HASH> 100644
--- a/src/accounts/search_indexes.py
+++ b/src/accounts/search_indexes.py
@@ -47,16 +47,11 @@ class UserIndex(indexes.SearchIndex, indexes.Indexable):
def prepare(self, obj):
prepared_data = super(UserIndex, self).prepare(obj)
- message_count = self.prepared_data['message_count']
- changeset_count = self.prepared_data['changeset_count']
- ticket_count = self.prepared_data['ticket_count']
- wiki_count = self.prepared_data['wiki_count']
-
prepared_data['contribution_count'] = sum((
- message_count,
- changeset_count,
- ticket_count,
- wiki_count
+ self.prepared_data['message_count'],
+ self.prepared_data['changeset_count'],
+ self.prepared_data['ticket_count'],
+ self.prepared_data['wiki_count']
))
return prepared_data | Removing a few variables on accounts search_indexes | colab_colab | train | py |
b53d5d147e6673072cb8e09d4d94fcc6e9e96b8b | diff --git a/bashplotlib/histogram.py b/bashplotlib/histogram.py
index <HASH>..<HASH> 100644
--- a/bashplotlib/histogram.py
+++ b/bashplotlib/histogram.py
@@ -165,7 +165,7 @@ def plot_hist(f, height=20.0, bincount=None, binwidth=None, pch="o", colour="def
else:
printcolour(" ", True, colour)
print
- xs = hist.keys() * 2
+ xs = hist.keys()
print " " * (nlen+1) + "-" * len(xs)
@@ -175,8 +175,8 @@ def plot_hist(f, height=20.0, bincount=None, binwidth=None, pch="o", colour="def
printcolour(" " * (nlen+1), True, colour)
for x in range(0, len(hist)):
num = str(bins[x])
- if x % 2 == 0:
- print " ",
+ if x % 2 != 0:
+ pass
elif i < len(num):
print num[i],
else: | Short fix to make x-labels align correctly with the buckets | glamp_bashplotlib | train | py |
0ff360c128858a6be6b80fc094d8a45fd9c11297 | diff --git a/graphene_gae/ndb/fields.py b/graphene_gae/ndb/fields.py
index <HASH>..<HASH> 100644
--- a/graphene_gae/ndb/fields.py
+++ b/graphene_gae/ndb/fields.py
@@ -150,30 +150,6 @@ class NdbKeyField(FieldType):
key = getattr(entity, self.name)
if isinstance(key, list):
- return self.__auto_resolve_repeated(entity, key)
+ return ndb.get_multi(key)
- return self.__auto_resolve_key(entity, key)
-
- def __auto_resolve_repeated(self, entity, keys):
- if not self.name.endswith('_keys'):
- return ndb.get_multi(keys)
-
- cache_name = self.name[:-4] # TODO: pluralise
- if hasattr(entity, cache_name):
- return getattr(entity, cache_name)
-
- values = ndb.get_multi(keys)
- setattr(entity, cache_name, values)
- return values
-
- def __auto_resolve_key(self, entity, key):
- if not self.name.endswith('_key'):
- return key.get()
-
- cache_name = self.name[:-4]
- if hasattr(entity, cache_name):
- return getattr(entity, cache_name)
-
- value = key.get()
- setattr(entity, cache_name, value)
- return value
+ return key.get() | Removd unecessary NdbKeyField fetching optimization
There are better ways to do caching and pre-fetching in GraphQL than this (ugly) hack… | graphql-python_graphene-gae | train | py |
3d014bde203e9ee3e644fdb8b78629c23e18b7ab | diff --git a/app/deploy.go b/app/deploy.go
index <HASH>..<HASH> 100644
--- a/app/deploy.go
+++ b/app/deploy.go
@@ -55,6 +55,7 @@ type DeployData struct {
CanRollback bool
RemoveDate time.Time `bson:",omitempty"`
Diff string
+ Message string
}
func findValidImages(apps ...App) (set.Set, error) {
@@ -127,6 +128,7 @@ func eventToDeployData(evt *event.Event, validImages set.Set, full bool) *Deploy
if err == nil {
data.Commit = startOpts.Commit
data.Origin = startOpts.GetOrigin()
+ data.Message = startOpts.Message
}
if full {
data.Log = evt.Log | Adding Message field to DeployData/DeployInfo, otherwise this field isnt really useful as a deployment info besides being at event information | tsuru_tsuru | train | go |
e84871cbbf583a1e17bec63e2f015c1d69f83a9e | diff --git a/lib/AbstractObject.php b/lib/AbstractObject.php
index <HASH>..<HASH> 100644
--- a/lib/AbstractObject.php
+++ b/lib/AbstractObject.php
@@ -24,7 +24,32 @@ abstract class AbstractObject
/** Reference to the current controller. Read only. Use setController() */
public $controller;
- /** Exception class to use when $this->exception() is called */
+ /**
+ * Exception class to use when $this->exception() is called. When
+ * you later call ->exception() method, you can either override
+ * or postfix your exception with second argument
+ *
+ *
+ * $default_exception='PathFinder' by default would
+ * return 'Exception_PathFinder' from exception().
+ *
+ * $default_exceptoin='PathFinder' in combination with
+ * ->exception('Blah','_NotFound') will return
+ * 'Exception_PathFinder_NotFound'
+ *
+ * $default_exception='BaseException' in combination with
+ * ->exception('Blah', 'PathFinder') will create
+ * 'Exception_PathFinder' exception.
+ *
+ * and finally
+ *
+ * $default_exception='PathFinder' in combination with
+ * ->exception('Blah','NotFound') will return
+ * 'Exception_NotFound';
+ *
+ *
+ * TODO: implement test-cases for the above
+ */
public $default_exception='BaseException';
/** Default controller to initialize when calling setModel() */ | Document abstract object's exception() approach in more details. | atk4_atk4 | train | php |
bf29e3b34769e9d275894b6e069a89a93abb079b | diff --git a/webpack/react_app/components/FeaturesDropdown/index.js b/webpack/react_app/components/FeaturesDropdown/index.js
index <HASH>..<HASH> 100644
--- a/webpack/react_app/components/FeaturesDropdown/index.js
+++ b/webpack/react_app/components/FeaturesDropdown/index.js
@@ -23,6 +23,7 @@ const FeaturesDropdown = ({ hostId }) => {
response: { results: features },
status,
} = useAPI('get', foremanUrl(REX_FEATURES_API));
+
const dispatch = useDispatch();
const dropdownItems = features
?.filter(feature => feature.host_action_button)
@@ -64,7 +65,7 @@ const FeaturesDropdown = ({ hostId }) => {
};
FeaturesDropdown.propTypes = {
- hostId: PropTypes.string,
+ hostId: PropTypes.number,
};
FeaturesDropdown.defaultProps = {
hostId: undefined, | Refs #<I> - fix the 'scedule a job' button in new host | theforeman_foreman_remote_execution | train | js |
5c07033847d1d98e2664a28df7132ce069f33fcc | diff --git a/cucumber-messages/ruby/lib/cucumber/messages.rb b/cucumber-messages/ruby/lib/cucumber/messages.rb
index <HASH>..<HASH> 100644
--- a/cucumber-messages/ruby/lib/cucumber/messages.rb
+++ b/cucumber-messages/ruby/lib/cucumber/messages.rb
@@ -1,3 +1,7 @@
+module Cucumber
+ module Messages
+ end
+end
require 'cucumber/messages_pb'
require 'cucumber/messages/binary_to_message_enumerator'
require 'cucumber/messages/ndjson_to_message_enumerator' | Fix cucumber-messages for Ruby | cucumber_cucumber | train | rb |
820863aec082484f2963f4a1b11b5a8f4c67813f | diff --git a/indra/sources/biopax/api.py b/indra/sources/biopax/api.py
index <HASH>..<HASH> 100644
--- a/indra/sources/biopax/api.py
+++ b/indra/sources/biopax/api.py
@@ -1,7 +1,6 @@
from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import itertools
-from indra.java_vm import autoclass, JavaException
from . import pathway_commons_client as pcc
from .processor import BiopaxProcessor
@@ -162,6 +161,23 @@ def process_owl(owl_filename):
return process_model(model)
+def process_owl_str(owl_str):
+ """Returns a BiopaxProcessor for a BioPAX OWL file.
+
+ Parameters
+ ----------
+ owl_str : string
+ The string of an owl file to process.
+
+ Returns
+ -------
+ bp : BiopaxProcessor
+ A BiopaxProcessor containing the obtained BioPAX model in bp.model.
+ """
+ model = pcc.owl_str_to_model(owl_str)
+ return process_model(model)
+
+
def process_model(model):
"""Returns a BiopaxProcessor for a BioPAX model object. | Add function to process owl string. | sorgerlab_indra | train | py |
7ce3e2f0159ac266277c245ced1f246786352035 | diff --git a/lib/solargraph/source/fragment.rb b/lib/solargraph/source/fragment.rb
index <HASH>..<HASH> 100644
--- a/lib/solargraph/source/fragment.rb
+++ b/lib/solargraph/source/fragment.rb
@@ -269,8 +269,8 @@ module Solargraph
end
if signature.start_with?('.')
# @todo Smelly exceptional case for arrays
- if signature == '.[].'
- signature = 'Array.new.'
+ if signature.start_with?('.[].')
+ signature.sub!(/^\.\[\]/, 'Array.new')
else
line, col = get_position_at(index - 1)
pn = @source.node_at(line, col) | Fragment signatures handle chains from literal arrays. | castwide_solargraph | train | rb |
cc3038a3ff3490676921d5f3794147992b8f4d69 | diff --git a/src/cli-options.js b/src/cli-options.js
index <HASH>..<HASH> 100644
--- a/src/cli-options.js
+++ b/src/cli-options.js
@@ -63,7 +63,7 @@ var program = optimist
})
.option('keep', {
boolean: true,
- default: false,
+ default: true,
alias: 'k',
description: 'keep tested version if it is working'
}) | major(keep): set option keep = true by default, close #<I> | bahmutov_next-update | train | js |
7be2304d30477cdb09cd0027db6e932d3a05860e | diff --git a/shared/login/signup/username-email-form.js b/shared/login/signup/username-email-form.js
index <HASH>..<HASH> 100644
--- a/shared/login/signup/username-email-form.js
+++ b/shared/login/signup/username-email-form.js
@@ -42,8 +42,8 @@ class UsernameEmailForm extends Component {
// $FlowIssue type this connector
export default connect(
state => ({
- usernameErrorText: state.signup.usernameError,
- emailErrorText: state.signup.emailError,
+ usernameErrorText: state.signup.usernameError && state.signup.usernameError.message,
+ emailErrorText: state.signup.emailError && state.signup.emailError.message,
username: state.signup.username,
email: state.signup.email,
waiting: state.signup.waiting, | apply Error -> string transformation in the container, not the store | keybase_client | train | js |
b43bd2dd749c087b28ceba9505f793d3713887d9 | diff --git a/src/ui/ToolTip.js b/src/ui/ToolTip.js
index <HASH>..<HASH> 100644
--- a/src/ui/ToolTip.js
+++ b/src/ui/ToolTip.js
@@ -86,13 +86,14 @@ class ToolTip extends UIComponent {
buildOn() {
const dom = createEl('div');
+ const options = this.options || {};
if (options.height) {
dom.style.height = options.height + 'px';
}
if (options.width) {
dom.style.width = options.width + 'px';
}
- const cssName = this.options.cssName;
+ const cssName = options.cssName;
if (!cssName && options.height) {
dom.style.lineHeight = options.height + 'px';
} | fix tooltip cannot set width and height | maptalks_maptalks.js | train | js |
8a1b14b938da71d8d8b10e9b34e6ee789158cea6 | diff --git a/symphony/lib/core/class.symphony.php b/symphony/lib/core/class.symphony.php
index <HASH>..<HASH> 100644
--- a/symphony/lib/core/class.symphony.php
+++ b/symphony/lib/core/class.symphony.php
@@ -288,7 +288,7 @@ abstract class Symphony implements Singleton
* When set to true, this function will always create a new
* instance of ExtensionManager, replacing self::$ExtensionManager.
*/
- public static function initialiseExtensionManager($force=false)
+ public static function initialiseExtensionManager($force = false)
{
if (!$force && self::$ExtensionManager instanceof ExtensionManager) {
return true; | Fix code format
Picked from <I>fbb<I>d2
Picked from 8ab1c<I>eb9 | symphonycms_symphony-2 | train | php |
dcc480817b6ac5c2dea317c300c8df84eaf80d1c | diff --git a/src/BoomCMS/ServiceProviders/InstallerServiceProvider.php b/src/BoomCMS/ServiceProviders/InstallerServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/BoomCMS/ServiceProviders/InstallerServiceProvider.php
+++ b/src/BoomCMS/ServiceProviders/InstallerServiceProvider.php
@@ -33,7 +33,7 @@ class InstallerServiceProvider extends BaseServiceProvider
$name = $request->input('user_name');
$email = $request->input('user_email');
- $person = $this->dispatch(new Jobs\CreatePerson($name, $email));
+ $person = $this->dispatch(new Jobs\CreatePerson($email, $name));
$person->setSuperuser(true);
Person::save($person); | Fixed order of arguments to create person command | boomcms_boom-installer | train | php |
96931548fc9aaea35d9381dbcc77bd918aa9e7b3 | diff --git a/lib/throttled-map-concurrent-all.js.js b/lib/throttled-map-concurrent-all.js.js
index <HASH>..<HASH> 100644
--- a/lib/throttled-map-concurrent-all.js.js
+++ b/lib/throttled-map-concurrent-all.js.js
@@ -5,7 +5,7 @@ module.exports = {
if(typeof (numWorkers) === 'function') {
callback = numWorkers;
- numWorkers = Math.ceiling(items.length / 2);
+ numWorkers = Math.ceil(items.length / 2);
}
if(items.length === 0) { return callback(null, []); } | Update throttled-map-concurrent-all.js.js | GannettDigital_palinode | train | js |
bb31492e4e78856d2830284bfda6bed39c779e62 | diff --git a/tests/StaticArrayyTest.php b/tests/StaticArrayyTest.php
index <HASH>..<HASH> 100644
--- a/tests/StaticArrayyTest.php
+++ b/tests/StaticArrayyTest.php
@@ -14,6 +14,7 @@ class StaticArrayyTest extends PHPUnit_Framework_TestCase
{
/** @noinspection PhpUndefinedMethodInspection */
/** @noinspection PhpUnusedLocalVariableInspection */
+ /** @noinspection OnlyWritesOnParameterInspection */
$result = A::invalidMethod('foo');
} | [+]: ignore some warnings from PhpStorm ... v2 | voku_Arrayy | train | php |
7eb0fb2b4b845acef6586842b1b7631de6c5df96 | diff --git a/lib/actv/version.rb b/lib/actv/version.rb
index <HASH>..<HASH> 100644
--- a/lib/actv/version.rb
+++ b/lib/actv/version.rb
@@ -1,3 +1,3 @@
module ACTV
- VERSION = "1.3.4"
+ VERSION = "1.3.6"
end | Version bump (assumes that remove_production_check branch merged first) | activenetwork_actv | train | rb |
715e1af7d1de6b7b2ebfb34370dd8339930494e2 | diff --git a/lib/faraday/adapter/em_synchrony.rb b/lib/faraday/adapter/em_synchrony.rb
index <HASH>..<HASH> 100644
--- a/lib/faraday/adapter/em_synchrony.rb
+++ b/lib/faraday/adapter/em_synchrony.rb
@@ -52,6 +52,8 @@ module Faraday
client = block.call
end
+ raise client.error if client.error
+
save_response(env, client.response_header.status, client.response) do |resp_headers|
client.response_header.each do |name, value|
resp_headers[name.to_sym] = value | don't swallow exceptions in em-synchrony | lostisland_faraday | train | rb |
700a72c749dcbb6b5c9f39ebb1164a4487319217 | diff --git a/sample/cute/core/src/forplay/sample/cute/core/CuteGame.java b/sample/cute/core/src/forplay/sample/cute/core/CuteGame.java
index <HASH>..<HASH> 100644
--- a/sample/cute/core/src/forplay/sample/cute/core/CuteGame.java
+++ b/sample/cute/core/src/forplay/sample/cute/core/CuteGame.java
@@ -116,31 +116,21 @@ public class CuteGame implements Game, Keyboard.Listener, Pointer.Listener {
}
@Override
- public void onPointerEnd(int x, int y) {
+ public void onPointerEnd(float x, float y) {
touchVectorX = touchVectorY = 0;
}
@Override
- public void onPointerDrag(int x, int y) {
+ public void onPointerDrag(float x, float y) {
touchMove(x, y);
}
@Override
- public void onPointerStart(int x, int y) {
+ public void onPointerStart(float x, float y) {
touchMove(x, y);
}
@Override
- public void onPointerMove(int x, int y) {
- // ignore
- }
-
- @Override
- public void onPointerScroll(int velocity) {
- // ignore
- }
-
- @Override
public void onKeyDown(int buttonCode) {
switch (buttonCode) {
case Keyboard.KEY_SPACE: | Update CuteGame for updated Pointer API | threerings_playn | train | java |
94c973be56e559f37a68e406d4d217fd5cea2fa5 | diff --git a/lib/unparser/emitter/resbody.rb b/lib/unparser/emitter/resbody.rb
index <HASH>..<HASH> 100644
--- a/lib/unparser/emitter/resbody.rb
+++ b/lib/unparser/emitter/resbody.rb
@@ -9,6 +9,8 @@ module Unparser
class Standalone < self
+ handle :resbody
+
private
# Perform dispatch | Add back handler for resbody for mutant identity guards
* Closes #<I> | mbj_unparser | train | rb |
7797742e4ac01d071f9e7fb67271c88f1ecb610c | diff --git a/src/caniuse-parser.js b/src/caniuse-parser.js
index <HASH>..<HASH> 100644
--- a/src/caniuse-parser.js
+++ b/src/caniuse-parser.js
@@ -211,11 +211,11 @@ function handleDataFeed(entries) {
var isMobile = entry[4] == "Yes";
var pageviews = +entry[5];
- if (os == "iOS" || os == "iPad" || os == "iPhone" || os == "iPod") {
+ if (browser == "Opera" && (isMobile || os == "(not set)")) {
+ browser = "Opera Mobile";
+ } else if (os == "iOS" || os == "iPad" || os == "iPhone" || os == "iPod") {
// all apps on ios must use safari engine by apple rules
browser = "iOS Safari";
- } else if (browser == "Opera" && (isMobile || os == "(not set)")) {
- browser = "Opera Mobile";
} else if (browser == "Safari (in-app)") {
browser = "iOS Safari";
} else if (browser == "BlackBerry") { | Move Opera Mobile conditional up just in case | browserslist_browserslist-ga | train | js |
f2b3588d03ca8c810222073d63e1a446d8efca61 | diff --git a/bin/static/config/servers/DEFAULT/03_mqtt_socketService.js b/bin/static/config/servers/DEFAULT/03_mqtt_socketService.js
index <HASH>..<HASH> 100644
--- a/bin/static/config/servers/DEFAULT/03_mqtt_socketService.js
+++ b/bin/static/config/servers/DEFAULT/03_mqtt_socketService.js
@@ -53,8 +53,8 @@ module.exports = function (ctx, done) {
var sessionId = op.clientId
socketService.onConnect(sessionId, authToken, serverEmitter, function () {
conn.end()
- }, function (err, session, user) { // eslint-disable-line handle-callback-err
- if (!user) {
+ }, function (err, session, user) {
+ if (err || !user) {
conn.connack({
// Connection Refused, not authorized
returnCode: 0x05 | perhaps error is also a reason to refuse connection | SciSpike_yaktor | train | js |
b0e21f36347991851b0b9e9403df269a6a2da984 | diff --git a/chess/pgn.py b/chess/pgn.py
index <HASH>..<HASH> 100644
--- a/chess/pgn.py
+++ b/chess/pgn.py
@@ -530,7 +530,7 @@ class GameModelCreator(BaseVisitor):
self.in_variation = True
def handle_error(self, error):
- logging.exception("error during pgn parsing")
+ LOGGER.exception("error during pgn parsing")
def result(self):
""" | Do not directly use logging, use a logger | niklasf_python-chess | train | py |
2cd857dd3668a6767100e91223cdffbf3807940f | diff --git a/domain/src/main/java/ch/dissem/bitmessage/entity/valueobject/InventoryVector.java b/domain/src/main/java/ch/dissem/bitmessage/entity/valueobject/InventoryVector.java
index <HASH>..<HASH> 100644
--- a/domain/src/main/java/ch/dissem/bitmessage/entity/valueobject/InventoryVector.java
+++ b/domain/src/main/java/ch/dissem/bitmessage/entity/valueobject/InventoryVector.java
@@ -21,6 +21,7 @@ import ch.dissem.bitmessage.utils.Strings;
import java.io.IOException;
import java.io.OutputStream;
+import java.util.Arrays;
/**
* Created by chris on 13.03.15.
@@ -31,6 +32,22 @@ public class InventoryVector implements Streamable {
*/
private final byte[] hash;
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof InventoryVector)) return false;
+
+ InventoryVector that = (InventoryVector) o;
+
+ return Arrays.equals(hash, that.hash);
+
+ }
+
+ @Override
+ public int hashCode() {
+ return hash != null ? Arrays.hashCode(hash) : 0;
+ }
+
public byte[] getHash() {
return hash;
} | If we compare IVs, they of course must properly implement the equals method
This fixes the bug where we would request objects again that were already stored. | Dissem_Jabit | train | java |
0f5b53f43fd39c765dbbc0d980f550ca7a57d1bf | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -61,5 +61,6 @@ setup(
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
],
+ requires=['six'],
tags=['BASIC', 'zxspectrum', 'compiler', 'z80']
) | Add six module
Needed for python2/3 compatibility | boriel_zxbasic | train | py |
36726bdeb6dcbed92648996e07030e70248a63e4 | diff --git a/src/plugins/SoftwareGenerator/templates/forEach/MetaTemplates.js b/src/plugins/SoftwareGenerator/templates/forEach/MetaTemplates.js
index <HASH>..<HASH> 100644
--- a/src/plugins/SoftwareGenerator/templates/forEach/MetaTemplates.js
+++ b/src/plugins/SoftwareGenerator/templates/forEach/MetaTemplates.js
@@ -1,4 +1,4 @@
-define(['bower/handlebars/dist/handlebars.min',
+define(['bower/handlebars/handlebars.min',
'./uml/Templates',
'text!./Makefile.tmpl',
'text!./test.cpp'],
diff --git a/src/plugins/SoftwareGenerator/templates/forEach/uml/Templates.js b/src/plugins/SoftwareGenerator/templates/forEach/uml/Templates.js
index <HASH>..<HASH> 100644
--- a/src/plugins/SoftwareGenerator/templates/forEach/uml/Templates.js
+++ b/src/plugins/SoftwareGenerator/templates/forEach/uml/Templates.js
@@ -1,4 +1,4 @@
-define(['bower/handlebars/dist/handlebars.min',
+define(['bower/handlebars/handlebars.min',
'underscore',
'text!./StateBase.hpp',
'text!./DeepHistoryState.hpp', | minor fix to reorganization of bower. | finger563_webgme-hfsm | train | js,js |
201f49ab0d988d9e7d6527bb397e2cf98f48b8a7 | diff --git a/src/MessageParser.php b/src/MessageParser.php
index <HASH>..<HASH> 100644
--- a/src/MessageParser.php
+++ b/src/MessageParser.php
@@ -298,8 +298,9 @@ class MessageParser
$this->readHeaders($handle, $message);
$contentType = $part->getHeaderValue('Content-Type');
$mimeVersion = $part->getHeaderValue('Mime-Version');
+ $isMimeNotDefined = ($part === $message && $contentType === null && $mimeVersion === null);
do {
- if ($part === $message && $contentType === null && $mimeVersion === null) {
+ if ($isMimeNotDefined) {
$this->readUUEncodedOrPlainTextPart($handle, $message);
} else {
$part = $this->readMimeMessagePart($handle, $message, $part); | Simplify condition in MessageParser::read | zbateson_mail-mime-parser | train | php |
4bea7248cd31ff74d0ce8aa5f57141f9b2e85cd0 | diff --git a/src/python/pants/backend/python/target_types.py b/src/python/pants/backend/python/target_types.py
index <HASH>..<HASH> 100644
--- a/src/python/pants/backend/python/target_types.py
+++ b/src/python/pants/backend/python/target_types.py
@@ -204,7 +204,7 @@ class PexEntryPointField(AsyncFieldMixin, SecondaryOwnerMixin, Field):
"shorthand to specify a file name, using the same syntax as the `sources` field:\n\n 1) "
"'app.py', Pants will convert into the module `path.to.app`;\n 2) 'app.py:func', Pants "
"will convert into `path.to.app:func`.\n\nYou must use the file name shorthand for file "
- "arguments to work with this target.\n\nTo leave off an entry point, set to '<none>'."
+ "arguments to work with this target.\n\nTo leave off an entry point, set to `<none>`."
)
required = True
value: EntryPoint | Fix a markdown issue in a help string. (#<I>)
This rendered as an unknown HTML tag instead of a literal string.
After this change, it renders as desired.
[ci skip-rust]
[ci skip-build-wheels] | pantsbuild_pants | train | py |
d949515d518f99e7bded459649ac96e9e3ea715c | diff --git a/tests/test_tungsten.py b/tests/test_tungsten.py
index <HASH>..<HASH> 100644
--- a/tests/test_tungsten.py
+++ b/tests/test_tungsten.py
@@ -32,15 +32,15 @@ class TungstenTestSuite(unittest.TestCase):
if __name__ == '__main__':
# Get appid from command line
- parser = argparse.ArgumentParser(description='Tungsten Test Suite')
- parser.add_argument('appid', help='AppID')
- parser.add_argument('unittest_args', nargs='*')
- args = parser.parse_args()
+ #parser = argparse.ArgumentParser(description='Tungsten Test Suite')
+ #parser.add_argument('appid', help='AppID')
+ #parser.add_argument('unittest_args', nargs='*')
+ #args = parser.parse_args()
- appid = args.appid
+ appid = sys.argv[1]
# Change sys.argv back to rest of arguments for unit test
- sys.argv[1:] = args.unittest_args
+ sys.argv[1:] = sys.argv[2:]
# Run unit tests
unittest.main() | Fixed test_tungsten.py method of accessing appid from command line | seenaburns_Tungsten | train | py |
4039b26b2e9ebd573bc37006ac44b315c1f0cda1 | diff --git a/src/main/java/org/sonar/plugins/groovy/codenarc/CodeNarcSensor.java b/src/main/java/org/sonar/plugins/groovy/codenarc/CodeNarcSensor.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/sonar/plugins/groovy/codenarc/CodeNarcSensor.java
+++ b/src/main/java/org/sonar/plugins/groovy/codenarc/CodeNarcSensor.java
@@ -153,6 +153,7 @@ public class CodeNarcSensor implements Sensor {
int i = 1;
for (File sourceDir : moduleFileSystem.sourceDirs()) {
CodeNarcRunner runner = new CodeNarcRunner();
+ // TODO SONARGROOV-24
FilesystemSourceAnalyzer analyzer = new FilesystemSourceAnalyzer();
// only one source directory
@@ -169,7 +170,6 @@ public class CodeNarcSensor implements Sensor {
runner.setRuleSetFiles("file:" + codeNarcConfiguration.getAbsolutePath());
- // TODO : might be possible to process results object to get violations
runner.execute();
result.add(reportFile);
i++; | SONARGROOV-<I> Added TODO | pmayweg_sonar-groovy | train | java |
a4853e35609a40d26d423ac680d527b4608156e5 | diff --git a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+++ b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
@@ -948,6 +948,7 @@ abstract class AbstractPlatform
if(strtolower($columnData['type']) == "string" && $columnData['length'] === null) {
$columnData['length'] = 255;
}
+ $columnData['unsigned'] = $column->getUnsigned();
$columnData['precision'] = $column->getPrecision();
$columnData['scale'] = $column->getScale();
$columnData['default'] = $column->getDefault(); | Adding the option of unsigned field. | doctrine_dbal | train | php |
ea869e7c931c565b83262fc83361153bfec1c3ef | diff --git a/Tone/instrument/Sampler.js b/Tone/instrument/Sampler.js
index <HASH>..<HASH> 100644
--- a/Tone/instrument/Sampler.js
+++ b/Tone/instrument/Sampler.js
@@ -17,6 +17,7 @@ define(["Tone/core/Tone", "Tone/instrument/Instrument", "Tone/core/Buffers", "To
* //sampler will repitch the closest sample
* sampler.triggerAttack("D3")
* })
+ * @extends {Tone.Instrument}
*/
Tone.Sampler = function(urls){ | updating jsdoc comment to reflect that class extends Tone.Instrument | Tonejs_Tone.js | train | js |
f4d24ff5c3de63cf9a141844a5f8bb2c0e8ce7e4 | diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php
index <HASH>..<HASH> 100644
--- a/mod/quiz/lib.php
+++ b/mod/quiz/lib.php
@@ -266,6 +266,7 @@ function quiz_update_grades($quiz=null, $userid=0, $nullifnone=true) {
}
if ($quiz != null) {
+ quiz_grade_item_update($quiz); // Recreate it if necessary
if ($grades = quiz_get_user_grades($quiz, $userid)) {
grade_update('mod/quiz', $quiz->course, 'mod', 'quiz', $quiz->id, 0, $grades);
@@ -909,4 +910,4 @@ function quiz_check_file_access($attemptid, $questionid) {
// otherwise, this user does not have permission
return false;
}
-?>
\ No newline at end of file
+?> | Updating grades will update the grade_item too | moodle_moodle | train | php |
7802651ca9927f73a8d5ffdcc1cab8ddadd8ac14 | diff --git a/class.form.php b/class.form.php
index <HASH>..<HASH> 100644
--- a/class.form.php
+++ b/class.form.php
@@ -1360,6 +1360,7 @@ class form extends pfbc {
}
elseif($eleType == "checkbox") {
if(is_array($ele->options)) {
+ $optionSize = sizeof($ele->options);
if($optionSize > 1 && substr($ele->attributes["name"], -2) != "[]")
$ele->attributes["name"] .= "[]";
@@ -1381,7 +1382,6 @@ class form extends pfbc {
}
$str .= '<div class="pfbc-checkboxes">';
- $optionSize = sizeof($ele->options);
for($o = 0; $o < $optionSize; ++$o) {
if($ele->options[$o]->value !== "") {
if(is_numeric($ele->options[$o]->value)) | Corrected several php notices in the ajax.php example file included with
the project download.
git-svn-id: <URL> | lkorth_php-form-builder-class | train | php |
39839825e312d302a83a69da5eec27b70db24f1e | diff --git a/bin/view.py b/bin/view.py
index <HASH>..<HASH> 100755
--- a/bin/view.py
+++ b/bin/view.py
@@ -233,7 +233,8 @@ def main(list_ids, model, contact_server, raw_data_id, show_raw):
if contact_server:
data = _fetch_data_from_server(raw_data_id)
print("hwrt version: %s" % hwrt.__version__)
- display_data(data['data'], data['id'], model, show_raw)
+ if data is not None:
+ display_data(data['data'], data['id'], model, show_raw)
else:
logging.info("RAW_DATA_ID %i does not exist or "
"database connection did not work.", raw_data_id) | bin/view.py: Don't display data if it is not available | MartinThoma_hwrt | train | py |
af154c75777b55b7fe1b0a0d88151af24e3aa4c5 | diff --git a/lib/grim/pdf.rb b/lib/grim/pdf.rb
index <HASH>..<HASH> 100644
--- a/lib/grim/pdf.rb
+++ b/lib/grim/pdf.rb
@@ -29,8 +29,7 @@ module Grim
#
def count
@count ||= begin
- result = SafeShell.execute("gs", "-dNODISPLAY", "-q", "-sFile=#{@path}", "./lib/pdf_info.ps")
-
+ result = SafeShell.execute("gs", "-dNODISPLAY", "-q", "-sFile=#{@path}", File.expand_path('../../../lib/pdf_info.ps', __FILE__))
result.gsub(WarningRegex, '').to_i
end
end | Use relative file path to get pdf_info.ps | jonmagic_grim | train | rb |
43ba563a1c409402ba9ac0afbe68d227341b37a5 | diff --git a/pkg/api/pluginproxy/pluginproxy.go b/pkg/api/pluginproxy/pluginproxy.go
index <HASH>..<HASH> 100644
--- a/pkg/api/pluginproxy/pluginproxy.go
+++ b/pkg/api/pluginproxy/pluginproxy.go
@@ -88,7 +88,7 @@ func NewApiPluginProxy(ctx *middleware.Context, proxyPath string, route *plugins
}
for key, value := range headers {
- log.Info("setting key %v value %v", key, value[0])
+ log.Trace("setting key %v value %v", key, value[0])
req.Header.Set(key, value[0])
}
} | fix(logging): change log level to trace for plugin proxy logging call, fixes #<I> | grafana_grafana | train | go |
55000e4b1ab1db58ac9b05c28aada0528bfec95f | diff --git a/resource_aws_cloudwatch_log_group.go b/resource_aws_cloudwatch_log_group.go
index <HASH>..<HASH> 100644
--- a/resource_aws_cloudwatch_log_group.go
+++ b/resource_aws_cloudwatch_log_group.go
@@ -91,11 +91,13 @@ func resourceAwsCloudWatchLogGroupRead(d *schema.ResourceData, meta interface{})
d.Set("retention_in_days", lg.RetentionInDays)
}
- tags, err := flattenCloudWatchTags(d, conn)
- if err != nil {
- return err
+ if meta.(*AWSClient).partition != "aws-us-gov" {
+ tags, err := flattenCloudWatchTags(d, conn)
+ if err != nil {
+ return err
+ }
+ d.Set("tags", tags)
}
- d.Set("tags", tags)
return nil
}
@@ -152,7 +154,7 @@ func resourceAwsCloudWatchLogGroupUpdate(d *schema.ResourceData, meta interface{
}
}
- if d.HasChange("tags") {
+ if meta.(*AWSClient).partition != "aws-us-gov" && d.HasChange("tags") {
oraw, nraw := d.GetChange("tags")
o := oraw.(map[string]interface{})
n := nraw.(map[string]interface{}) | Skip tag operations on cloudwatch logs in govcloud partition. | terraform-providers_terraform-provider-aws | train | go |
832aab6e76a984289cb9679d65d806b7571aeff7 | diff --git a/para-server/src/main/java/com/erudika/para/aop/SearchQueryAspect.java b/para-server/src/main/java/com/erudika/para/aop/SearchQueryAspect.java
index <HASH>..<HASH> 100644
--- a/para-server/src/main/java/com/erudika/para/aop/SearchQueryAspect.java
+++ b/para-server/src/main/java/com/erudika/para/aop/SearchQueryAspect.java
@@ -70,7 +70,7 @@ public class SearchQueryAspect implements MethodInterceptor {
Object result = null;
if (measuredAnno != null) {
- result = invokeTimedSearch(appid, superMethod, mi);
+ result = invokeTimedSearch(appid, searchMethod, mi);
} else {
result = mi.proceed();
} | fixed wrong method timed in SearchQueryAspect | Erudika_para | train | java |
3742511dd60b684b16503b86932f057df338f7e3 | diff --git a/ELiDE/ELiDE/board/board.py b/ELiDE/ELiDE/board/board.py
index <HASH>..<HASH> 100644
--- a/ELiDE/ELiDE/board/board.py
+++ b/ELiDE/ELiDE/board/board.py
@@ -291,12 +291,10 @@ class Board(RelativeLayout):
candidate.reciprocal.selected = True
candidate.selected = True
if hasattr(self.app.selection, 'selected'):
- if isinstance(self.app.selection, Arrow) and self.app.selection.reciprocal:
- if candidate is not self.app.selection:
- self.app.selection.selected = False
- self.app.selection.reciprocal.selected = False
- else:
- self.app.selection.selected = False
+ self.app.selection.selected = False
+ if isinstance(self.app.selection, Arrow) and self.app.selection.reciprocal\
+ and candidate is not self.app.selection.reciprocal:
+ self.app.selection.reciprocal.selected = False
self.app.selection = candidate
self.keep_selection = True
parent = candidate.parent | Handle switching selection between reciprocal nonmirror arrows correctly again | LogicalDash_LiSE | train | py |
073ee36246769cf536d0b88e5ab9dd72f4225d02 | diff --git a/src/com/google/javascript/rhino/testing/TestErrorReporter.java b/src/com/google/javascript/rhino/testing/TestErrorReporter.java
index <HASH>..<HASH> 100644
--- a/src/com/google/javascript/rhino/testing/TestErrorReporter.java
+++ b/src/com/google/javascript/rhino/testing/TestErrorReporter.java
@@ -42,7 +42,7 @@ package com.google.javascript.rhino.testing;
import static com.google.common.truth.Truth.assertThat;
import com.google.javascript.rhino.ErrorReporter;
-
+import java.util.Arrays;
import org.junit.Assert;
/**
@@ -103,10 +103,16 @@ public final class TestErrorReporter implements ErrorReporter {
}
public void assertHasEncounteredAllWarnings() {
- assertThat(warnings).hasLength(warningsIndex);
+ if (warnings.length != warningsIndex) {
+ Assert.fail(
+ "missing warnings: " + Arrays.asList(warnings).subList(warningsIndex, warnings.length));
+ }
}
public void assertHasEncounteredAllErrors() {
- assertThat(errors).hasLength(errorsIndex);
+ if (errors.length != errorsIndex) {
+ Assert.fail(
+ "missing errors: " + Arrays.asList(errors).subList(errorsIndex, errors.length));
+ }
}
} | Fix TestErrorReporter to no longer give misleading assertion failures.
Currently when a warning is expected but not produced,
it fails with "Not true that [my expected warning] has length 0" which is very confusing.
This changes it to fail with "missing warnings: [my expected warning]".
-------------
Created by MOE: <URL> | google_closure-compiler | train | java |
85bf064a38420a959e689c4a2249326d67ea4283 | diff --git a/src/mui/layout/Menu.js b/src/mui/layout/Menu.js
index <HASH>..<HASH> 100644
--- a/src/mui/layout/Menu.js
+++ b/src/mui/layout/Menu.js
@@ -7,9 +7,17 @@ import { Link } from 'react-router';
const Menu = ({ resources }) => (
<Paper style={{ flex: '0 0 15em', order: -1 }}>
<List>
- {resources.map(resource =>
- <ListItem key={resource.name} containerElement={<Link to={`/${resource.name}`} />} primaryText={resource.options.label || inflection.humanize(inflection.pluralize(resource.name))} leftIcon={<resource.icon />} />
- )}
+ {resources
+ .filter(r => r.list)
+ .map(resource =>
+ <ListItem
+ key={resource.name}
+ containerElement={<Link to={`/${resource.name}`} />}
+ primaryText={resource.options.label || inflection.humanize(inflection.pluralize(resource.name))}
+ leftIcon={<resource.icon />}
+ />
+ )
+ }
</List>
</Paper>
); | Hide resources in the Menu when they don't have a list view | marmelab_react-admin | train | js |
977616458c0c4d77dd28470b05ced59730092557 | diff --git a/Mail/smtp.php b/Mail/smtp.php
index <HASH>..<HASH> 100644
--- a/Mail/smtp.php
+++ b/Mail/smtp.php
@@ -305,7 +305,7 @@ class Mail_smtp extends Mail {
$res = $this->_smtp->data($body, $textHeaders);
list(,$args) = $this->_smtp->getResponse();
- if (preg_match("/Ok: queued as (.*)/", $args, $queued)) {
+ if (preg_match("/Message queued as (.*)/", $args, $queued)) {
$this->queued_as = $queued[1];
} | Fixed : Server response is "Message" and not "Ok:" | pear_Mail | train | php |
3644b28fe9cd25fdea46a0767d5794a3e4e37f36 | diff --git a/misc/log-analytics/import_logs.py b/misc/log-analytics/import_logs.py
index <HASH>..<HASH> 100755
--- a/misc/log-analytics/import_logs.py
+++ b/misc/log-analytics/import_logs.py
@@ -360,11 +360,11 @@ class Configuration(object):
)
option_parser.add_option(
'--exclude-path', dest='excluded_paths', action='append', default=[],
- help="Paths to exclude. Can be specified multiple times"
+ help="Any URL path matching this exclude-path will not be imported in Piwik. Can be specified multiple times"
)
option_parser.add_option(
'--exclude-path-from', dest='exclude_path_from',
- help="Each line from this file is a path to exclude"
+ help="Each line from this file is a path to exclude (see: --exclude-path)"
)
option_parser.add_option(
'--include-path', dest='included_paths', action='append', default=[], | Clarify doc for --exclude-path
as suggested in <URL> | matomo-org_matomo | train | py |
69410655bfd40e851f79c262487337330aeb5a46 | diff --git a/dublincore.py b/dublincore.py
index <HASH>..<HASH> 100644
--- a/dublincore.py
+++ b/dublincore.py
@@ -85,7 +85,7 @@ def dc_description(mydoc, parent, artmeta):
'short', 'executive-summary']
for type in type_hierarchy:
try:
- abstract_node = artmeta.abstract[type]
+ abstract_node = artmeta.abstracts[type]
except KeyError:
pass
else: | Slight bug fix in dc:description | SavinaRoja_OpenAccess_EPUB | train | py |
3e7dbdcca41a46456147fef8dfe7c7ffc303a46a | diff --git a/HARK/ConsumptionSaving/tests/test_ConsMarkovModel.py b/HARK/ConsumptionSaving/tests/test_ConsMarkovModel.py
index <HASH>..<HASH> 100644
--- a/HARK/ConsumptionSaving/tests/test_ConsMarkovModel.py
+++ b/HARK/ConsumptionSaving/tests/test_ConsMarkovModel.py
@@ -89,5 +89,4 @@ class test_ConsMarkovSolver(unittest.TestCase):
def test_solve(self):
self.test_checkMarkovInputs()
- self.model.timeFwd()
self.model.solve() | Remove timeFwd reference in Markov test | econ-ark_HARK | train | py |
46e13a70cc167d37dacc213cc4c17794f79f17a9 | diff --git a/test/test_lock.rb b/test/test_lock.rb
index <HASH>..<HASH> 100644
--- a/test/test_lock.rb
+++ b/test/test_lock.rb
@@ -52,5 +52,21 @@ module RestoreBundledWith
end
end
end
+
+ sub_test_case '#==' do
+ test 'compare different lock file' do
+ v19 = File.read('./test/fixtures/v1-9-example1.lock')
+ v110 = File.read('./test/fixtures/v1-10-example1.lock')
+ assert do
+ Lock.new(v19) != Lock.new(v110)
+ end
+ end
+ test 'compare same lock file' do
+ v110 = File.read('./test/fixtures/v1-10-example1.lock')
+ assert do
+ Lock.new(v110) == Lock.new(v110)
+ end
+ end
+ end
end
end | test(lock): compare lock files | packsaddle_ruby-restore_bundled_with | train | rb |
29fcc3f4a5f028294e67779e2669bf67faedd6f6 | diff --git a/django_nopassword/urls.py b/django_nopassword/urls.py
index <HASH>..<HASH> 100644
--- a/django_nopassword/urls.py
+++ b/django_nopassword/urls.py
@@ -2,7 +2,7 @@
from django.conf.urls import patterns, url
urlpatterns = patterns('',
- url(r'^login/$', 'django_nopassword.views.login'),
+ url(r'^login/$', 'django_nopassword.views.login', name='login'),
url(r'^login-code/(?P<username>[a-zA-Z0-9_@\.-]+)/(?P<login_code>[a-zA-Z0-9]+)/$',
'django_nopassword.views.login_with_code'),
url(r'^logout/$', 'django_nopassword.views.logout'), | fix #7, fix redirect problem in logout | relekang_django-nopassword | train | py |
c6d592ab4cc4f9c8aba8778621774d2c9658e160 | diff --git a/tests/test_main.py b/tests/test_main.py
index <HASH>..<HASH> 100644
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -11,3 +11,9 @@ def test_is_repo_url():
assert is_repo_url('/audreyr/cookiecutter.git') is False
assert is_repo_url('/home/audreyr/cookiecutter') is False
+
+ appveyor_temp_dir = (
+ 'c:\\users\\appveyor\\appdata\\local\\temp\\1\\pytest-0\\'
+ 'test_default_output_dir0\\template'
+ )
+ assert is_repo_url(appveyor_temp_dir) is False | Add a test for an appveyor path (see #<I>) | audreyr_cookiecutter | train | py |
d9b5ab7a9aa0d752359eca15f4c12e24219a025f | diff --git a/spillway/query.py b/spillway/query.py
index <HASH>..<HASH> 100644
--- a/spillway/query.py
+++ b/spillway/query.py
@@ -45,16 +45,20 @@ class GeoQuerySet(query.GeoQuerySet):
Keyword args:
srid -- EPSG id for for transforming the output geometry.
"""
- if not srid:
+ if not srid and not connection.ops.spatialite:
return super(GeoQuerySet, self).extent()
transform = self._transform(self.geo_field.column, srid)
- ext = {'extent': '%s(%s)' % (connection.ops.extent, transform)}
+ # Spatialite extent() is supported post-1.7.
+ if connection.ops.spatialite:
+ ext = {'extent': 'AsText(%s(%s))' % ('Extent', transform)}
+ else:
+ ext = {'extent': '%s(%s)' % (connection.ops.extent, transform)}
# The bare order_by() is needed to remove the default sort field which
# is not present in this aggregation.
qs = self.extra(select=ext).values('extent').order_by()
try:
return tuple(map(float, re.findall('[-.\d]+', qs[0]['extent'])))
- except IndexError:
+ except (IndexError, TypeError):
return ()
def filter_geometry(self, **kwargs): | Add spatialite support for extent() | bkg_django-spillway | train | py |
c9c850250289832a172d2c7c24a1be93209821b0 | diff --git a/environs/jujutest/livetests.go b/environs/jujutest/livetests.go
index <HASH>..<HASH> 100644
--- a/environs/jujutest/livetests.go
+++ b/environs/jujutest/livetests.go
@@ -205,12 +205,13 @@ func (t *LiveTests) checkUpgradeMachineAgent(c *C, m *state.Machine) {
c.Assert(gotTools.Binary, Equals, version.Current)
c.Logf("putting testing version of juju tools")
- upgradeTools, err := environs.PutTools(t.Env.Storage(), "bumpversion")
- c.Assert(err, IsNil)
- // Check that the put version really is the version we expect.
newVersion := version.Current
newVersion.Patch++
+ upgradeTools, err := environs.PutTools(t.Env.Storage(), &newVersion)
+ c.Assert(err, IsNil)
+
+ // Check that the put version really is the version we expect.
c.Assert(upgradeTools.Binary, Equals, newVersion)
err = m.ProposeAgentTools(upgradeTools) | environs/jujutest: use new PutTools interface | juju_juju | train | go |
0554454b11f04e225613a13bcc65f8eac0f4f4ac | diff --git a/local-links.js b/local-links.js
index <HASH>..<HASH> 100644
--- a/local-links.js
+++ b/local-links.js
@@ -50,12 +50,12 @@ function isLocal(event, anchor, lookForHash) {
var aHash = anchor.hash || (anchor.href.indexOf('#') > -1 ? '#' + anchor.href.split('#')[1] : null);
var inPageHash;
- // Window has no port, but anchor does
- if (!window.location.port && anchor.port) {
- // IE9 sometimes includes the default port on anchor.host
+ // Window has no port, but anchor has the default port
+ if (!window.location.port && anchor.port && (anchor.port === '80' || anchor.port === '443')) {
+ // IE9 sometimes includes the default port (80 or 443) on anchor.host
// so we append the default port to the window host in this case
// so they will match for the host equality check [1]
- wHost += ':80';
+ wHost += ':' + anchor.port;
}
// Hosts are the same, its a local link | check for <I> and <I> in default port | lukekarrys_local-links | train | js |
625b40d44b4e2f2efa16b17070f9322252926d57 | diff --git a/Entity/EmailTranslation.php b/Entity/EmailTranslation.php
index <HASH>..<HASH> 100644
--- a/Entity/EmailTranslation.php
+++ b/Entity/EmailTranslation.php
@@ -10,7 +10,7 @@ use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="lexik_email_translation")
- * @ORM\HasLifeCycleCallbacks
+ * @ORM\HasLifecycleCallbacks
*
* @author Laurent Heurtault <l.heurtault@lexik.fr>
* @author Cédric Girard <c.girard@lexik.fr> | Fix annotation capitalisation
This was causing the following error:
[Doctrine\Common\Annotations\AnnotationException]
[Semantical Error] The annotation "@Doctrine\ORM\Mapping\HasLifeCycleCallbacks" in class Lexik\Bundle\MailerBundle\Entity\EmailTranslation does not exist, or could not be auto-loaded. | lexik_LexikMailerBundle | train | php |
b78e9e82cd9614fbe137c01bde9439c4e16ca323 | diff --git a/src/Httpful/Request.php b/src/Httpful/Request.php
index <HASH>..<HASH> 100644
--- a/src/Httpful/Request.php
+++ b/src/Httpful/Request.php
@@ -685,9 +685,6 @@ class Request
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $headers[] = !empty($this->expected_type) ?
- "Accept: {$this->expected_type}, text/plain" :
- "Accept: */*";
$headers = array();
if (!isset($this->headers['User-Agent'])) {
$user_agent = 'User-Agent: HttpFul/1.0 (cURL/';
@@ -712,6 +709,12 @@ class Request
}
$headers[] = "Content-Type: {$this->content_type}";
+ // http://pretty-rfc.herokuapp.com/RFC2616#header.accept
+ $accept = "Accept: */*; q=0.5, text/plain; q=0.8,\r\n\t" .
+ 'text/html;level=3; q=0.9';
+ if (!empty($this->expected_type))
+ $accept .= ", {$this->expected_type}";
+ $headers[] = $accept;
foreach ($this->headers as $header => $value) {
$headers[] = "$header: $value"; | Complete Acceptable test header.
If you can coneg against this Accept: header you can mark your implementation passed.
Contains all the legal LWS.
Preferable mime types are listed in reverse order, expected mime-type is added to the end.
The order the server should sort these in are as follows
1 expected/type
<I> text/html;level=3
<I> text/plain
<I> *.*
This will also prevent you from getting <I> Not Acceptable errors. | nategood_httpful | train | php |
96829835266e3d3040e669ba8bd7a3295411b222 | diff --git a/src/java/com/threerings/presents/server/PresentsServer.java b/src/java/com/threerings/presents/server/PresentsServer.java
index <HASH>..<HASH> 100644
--- a/src/java/com/threerings/presents/server/PresentsServer.java
+++ b/src/java/com/threerings/presents/server/PresentsServer.java
@@ -259,17 +259,21 @@ public class PresentsServer
*/
public void shutdown ()
{
+ ObserverList downers = _downers;
+ if (downers == null) {
+ Log.warning("Refusing repeat shutdown request.");
+ return;
+ }
+ _downers = null;
+
// shut down the connection manager (this will cease all network
// activity but not actually close the connections)
if (conmgr.isRunning()) {
conmgr.shutdown();
- } else {
- Log.warning("Refusing repeat shutdown request.");
- return;
}
// shut down all shutdown participants
- _downers.apply(new ObserverList.ObserverOp() {
+ downers.apply(new ObserverList.ObserverOp() {
public boolean apply (Object observer) {
((Shutdowner)observer).shutdown();
return true; | We can't rely on the connection manager not being shutdown to determine
whether or not we're already shutdown as it may have shutdown
unexpectedly.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1 | threerings_narya | train | java |
7a131d78e9a2a0875725562897834d9f28938acf | diff --git a/pysra/propagation.py b/pysra/propagation.py
index <HASH>..<HASH> 100755
--- a/pysra/propagation.py
+++ b/pysra/propagation.py
@@ -244,7 +244,7 @@ class QuarterWaveLenCalculator(AbstractCalculator):
for l, t, s in zip(self.profile, thickness, slowness)
], self.profile.wt_depth)
# Update the calculated amplificaiton
- return (self.motion, profile, self.loc_input)
+ self(self.motion, profile, self.loc_input)
class LinearElasticCalculator(AbstractCalculator): | Fixed qwl optimization to update profile at end. | arkottke_pysra | train | py |
b270960fae72eb4ccd9ca0a18eb07a4bf32d0ff6 | diff --git a/ModelBundle/Repository/SiteRepository.php b/ModelBundle/Repository/SiteRepository.php
index <HASH>..<HASH> 100644
--- a/ModelBundle/Repository/SiteRepository.php
+++ b/ModelBundle/Repository/SiteRepository.php
@@ -24,6 +24,22 @@ class SiteRepository extends AbstractAggregateRepository implements SiteReposito
}
/**
+ * @param array $sitesIds
+ *
+ * @return array
+ */
+ public function findBySiteIds(array $sitesIds)
+ {
+ return parent::findBy(
+ array(
+ 'siteId' => array('$in' => $sitesIds),
+ 'deleted' => false
+ )
+ );
+ }
+
+
+ /**
* @param boolean $deleted
*
* @return array | add media share site (#<I>)
* add media share site
* fix find sites ids | open-orchestra_open-orchestra-model-bundle | train | php |
8e35086cd6d72a1332a2c11863368a038c986c45 | diff --git a/NfcManager.js b/NfcManager.js
index <HASH>..<HASH> 100644
--- a/NfcManager.js
+++ b/NfcManager.js
@@ -149,6 +149,10 @@ class NfcManager {
}
_handleSessionClosed = () => {
+ if (this._subscription) {
+ this._subscription.remove();
+ this._subscription = null;
+ }
this._clientTagDiscoveryListener = null;
this._clientSessionClosedListener && this._clientSessionClosedListener();
} | (ios) clear subscription when session closed | whitedogg13_react-native-nfc-manager | train | js |
85cf9d62ade58d1bfe91a89fcce9aceec0fd77fe | diff --git a/guild.go b/guild.go
index <HASH>..<HASH> 100644
--- a/guild.go
+++ b/guild.go
@@ -5,7 +5,6 @@ type Guild struct {
Name string `json:"name"`
Icon string `json:"icon"`
Region string `json:"region"`
- JoinedAt string `json:"joined_at"` // make time stamp
AfkTimeout int `json:"afk_timeout"`
AfkChannelId int `json:"afk_channel_id,string"`
EmbedChannelId int `json:"embed_channel_id,string"` | Removed duplicated JoinedAt.. | bwmarrin_discordgo | train | go |
b0de7b484a389c8de75d493fc83a49e34b8e4c67 | diff --git a/src/Menu.php b/src/Menu.php
index <HASH>..<HASH> 100644
--- a/src/Menu.php
+++ b/src/Menu.php
@@ -449,8 +449,8 @@ class Menu extends Component implements ArrayAccess, QueryOperatorFieldInterface
* Wrapper method to get all menu items for the current language without hidden items for
* the specific where statement.
*
- * @param array $where See {{\luya\cms\menu\Query::where}}
- * @param boolean $preloadModels Whether to preload all models for the given menu Query. See {{luya\cms\menu\Query::preloadModels}}
+ * @param array $where See {{\luya\cms\menu\Query::where()}}
+ * @param boolean $preloadModels Whether to preload all models for the given menu Query. See {{luya\cms\menu\Query::preloadModels()}}
* @see \luya\cms\menu\Query::where()
* @return \luya\cms\menu\QueryIterator
*/
@@ -463,7 +463,7 @@ class Menu extends Component implements ArrayAccess, QueryOperatorFieldInterface
* Wrapper method to get one menu item for current language without hidden items for the
* sepcific where statement.
*
- * @param array $where See {{\luya\cms\menu\Query::where}}
+ * @param array $where See {{\luya\cms\menu\Query::where()}}
* @see \luya\cms\menu\Query::where()
* @return \luya\cms\menu\Item
*/ | fixed api links in phpdoc | luyadev_luya-module-cms | train | php |
31d6d62c52c85fdc9ac0d4bfed1bb50e7de37328 | diff --git a/lib/statistics.rb b/lib/statistics.rb
index <HASH>..<HASH> 100644
--- a/lib/statistics.rb
+++ b/lib/statistics.rb
@@ -60,7 +60,7 @@ module Statistics
if value
sql = ((@filter_all_on || {}).merge(scoped_options[:filter_on] || {}))[key].gsub("?", "'#{value}'")
sql = sql.gsub("%t", "#{table_name}")
- sql_frag = ActiveRecord::Base.send(:sanitize_sql_for_conditions, sql)
+ sql_frag = send(:sanitize_sql_for_conditions, sql)
case
when sql_frag.nil? : nil
when scoped_options[:conditions].nil? : scoped_options[:conditions] = sql_frag | santize_sql_for_conditions should be called on a subclass of ActiveRecord::Base | acatighera_statistics | train | rb |
0243549db4d237cb78e720d55a9cae89b91f6830 | diff --git a/lib/rules/camelcase.js b/lib/rules/camelcase.js
index <HASH>..<HASH> 100644
--- a/lib/rules/camelcase.js
+++ b/lib/rules/camelcase.js
@@ -186,7 +186,7 @@ module.exports = {
const assignmentKeyEqualsValue = node.parent.key.name === node.parent.value.name;
- if (isUnderscored(name) && node.parent.computed) {
+ if (nameIsUnderscored && node.parent.computed) {
report(node);
}
diff --git a/tests/lib/rules/camelcase.js b/tests/lib/rules/camelcase.js
index <HASH>..<HASH> 100644
--- a/tests/lib/rules/camelcase.js
+++ b/tests/lib/rules/camelcase.js
@@ -92,6 +92,14 @@ ruleTester.run("camelcase", rule, {
options: [{ properties: "never" }]
},
{
+ code: "const { ['foo']: _foo } = obj;",
+ parserOptions: { ecmaVersion: 6 }
+ },
+ {
+ code: "const { [_foo_]: foo } = obj;",
+ parserOptions: { ecmaVersion: 6 }
+ },
+ {
code: "var { category_id } = query;",
options: [{ ignoreDestructuring: true }],
parserOptions: { ecmaVersion: 6 } | Fix: camelcase false positive with computed property (fixes #<I>) (#<I>) | eslint_eslint | train | js,js |
7acaffe33f2aaa1e06ac68bcdf06d9b0adc59912 | diff --git a/lib/stupidedi/versions/functional_groups/002001/element_defs.rb b/lib/stupidedi/versions/functional_groups/002001/element_defs.rb
index <HASH>..<HASH> 100644
--- a/lib/stupidedi/versions/functional_groups/002001/element_defs.rb
+++ b/lib/stupidedi/versions/functional_groups/002001/element_defs.rb
@@ -5661,7 +5661,7 @@ module Stupidedi
E369 = t::AN.new(:E369, "Free-form Description" , 1, 45)
E372 = t::AN.new(:E372, "Lading Liability Code - Nissan Part Description", 1, 25)
- E373 = t::DT.new(:E373 , "Date" , 8, 8)
+ E373 = t::DT.new(:E373 , "Date" , 6, 6)
E374 = t::ID.new(:E374 , "Date/Time Qualifier" , 3, 3,
s::CodeList.build(
"001" => "Cancel after", | Adjust size of element E<I> per envelope instructions for <I> | irobayna_stupidedi | train | rb |
1bec02f44b59d0f71196060231d22006909c7487 | diff --git a/src/sources/mvt.js b/src/sources/mvt.js
index <HASH>..<HASH> 100644
--- a/src/sources/mvt.js
+++ b/src/sources/mvt.js
@@ -21,6 +21,12 @@ export class MVTSource extends NetworkTileSource {
var buffer = new Pbf(data);
source.data = new VectorTile(buffer);
source.layers = this.toGeoJSON(source.data);
+
+ // Apply optional data transform
+ if (typeof this.transform === 'function') {
+ source.layers = this.transform(source.layers, this.extra_data);
+ }
+
delete source.data; // comment out to save raw data for debugging
} | data sources: call optional `transform` function for MVT sources
NB: feature properties can be modified, but geometry is already mercator projected and scaled to local tile coordinates | tangrams_tangram | train | js |
6c3ccf4d14d7a85290882ad461fe0d1999b2b2f7 | diff --git a/src/main/java/graphql/language/OperationDefinition.java b/src/main/java/graphql/language/OperationDefinition.java
index <HASH>..<HASH> 100644
--- a/src/main/java/graphql/language/OperationDefinition.java
+++ b/src/main/java/graphql/language/OperationDefinition.java
@@ -10,7 +10,7 @@ import java.util.Map;
import static graphql.language.NodeUtil.directivesByName;
-public class OperationDefinition extends AbstractNode<OperationDefinition> implements Definition<OperationDefinition> {
+public class OperationDefinition extends AbstractNode<OperationDefinition> implements Definition<OperationDefinition>, SelectionSetContainer {
public enum Operation {
QUERY, MUTATION, SUBSCRIPTION | operation definition is a SelectionSetContainer | graphql-java_graphql-java | train | java |
8991ceb209884f72beba0ab8b166a258c0af3e1d | diff --git a/lib/utils/yamlAstParser.js b/lib/utils/yamlAstParser.js
index <HASH>..<HASH> 100644
--- a/lib/utils/yamlAstParser.js
+++ b/lib/utils/yamlAstParser.js
@@ -107,7 +107,7 @@ const addNewArrayItem = (ymlFile, pathInYml, newValue) =>
}
currentNode[arrayPropertyName] = _.union(arrayProperty, [newValue]);
- const branchToReplaceName = _.head(pathInYmlArray);
+ const branchToReplaceName = pathInYmlArray[0];
const newObject = {};
newObject[branchToReplaceName] = plainObject[branchToReplaceName];
const newText = yaml.dump(newObject);
@@ -155,7 +155,7 @@ const removeExistingArrayItem = (ymlFile, pathInYml, removeValue) =>
}
}
- const headObjectPath = _.head(pathInYmlArray);
+ const headObjectPath = pathInYmlArray[0];
let newText = '';
if (plainObject[headObjectPath]) { | refactor: Replace `_.head` with `array[0]` (#<I>) | serverless_serverless | train | js |
1fdd95131480c8619addc3c564713506a41c171c | diff --git a/animal/admin.py b/animal/admin.py
index <HASH>..<HASH> 100644
--- a/animal/admin.py
+++ b/animal/admin.py
@@ -18,7 +18,7 @@ class AnimalAdmin(admin.ModelAdmin):
}),
)
raw_id_fields = ("Breeding",)
- list_display = ('MouseID', 'Rack', 'Rack_Position', 'Cage', 'CageID', 'Markings','Gender', 'Genotype', 'Strain', 'Background', 'Generation', 'Backcross', 'Born', 'Alive', 'Death')
+ list_display = ('MouseID', 'Rack', 'Rack_Position', 'Cage', 'Markings','Gender', 'Genotype', 'Strain', 'Background', 'Generation', 'Backcross', 'Born', 'Alive', 'Death')
list_filter = ('Alive','Strain', 'Background','Gender','Genotype','Backcross')
search_fields = ['MouseID', 'Cage']
radio_fields = {"Gender": admin.HORIZONTAL, "Strain":admin.HORIZONTAL, "Background": admin.HORIZONTAL, "Genotype": admin.HORIZONTAL, "Cause_of_Death": admin.HORIZONTAL} | removed CageID from admin list filter | davebridges_mousedb | train | py |
503ac4129eaebfd44ee564a093063cbb4b16ecd4 | diff --git a/src/Enhavo/Bundle/AppBundle/Controller/ResourceController.php b/src/Enhavo/Bundle/AppBundle/Controller/ResourceController.php
index <HASH>..<HASH> 100644
--- a/src/Enhavo/Bundle/AppBundle/Controller/ResourceController.php
+++ b/src/Enhavo/Bundle/AppBundle/Controller/ResourceController.php
@@ -225,7 +225,13 @@ class ResourceController extends BaseController
$this->appEventDispatcher->dispatchPostEvent(ResourceActions::CREATE, $configuration, $newResource);
$this->eventDispatcher->dispatchPostEvent(ResourceActions::CREATE, $configuration, $newResource);
- return $this->redirectHandler->redirectToResource($configuration, $newResource);
+ $this->addFlash('success', $this->get('translator')->trans('form.message.success', [], 'EnhavoAppBundle'));
+ $route = $configuration->getRedirectRoute(null);
+ return $this->redirectToRoute($route, [
+ 'id' => $newResource->getId(),
+ 'tab' => $request->get('tab'),
+ 'view_id' => $request->get('view_id')
+ ]);
}
public function indexAction(Request $request): Response | Fixed redirect and list update after duplicate action | enhavo_enhavo | train | php |
9eaeeb235ffefcac798798284ce30ca99d283423 | diff --git a/serve.go b/serve.go
index <HASH>..<HASH> 100644
--- a/serve.go
+++ b/serve.go
@@ -20,6 +20,7 @@ func Serve(c *cli.Context) {
cache := cache.New(c.Duration("cache"), 30*time.Second)
health := healthHandler{
+ c: c,
gossConfig: getGossConfig(c),
sys: system.New(c),
outputer: getOutputer(c),
@@ -64,6 +65,7 @@ func (h healthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if found {
resp = tmp.(res)
} else {
+ h.sys = system.New(h.c)
log.Printf("%v: Stale cache, running tests", r.RemoteAddr)
iStartTime := time.Now()
out := validate(h.sys, h.gossConfig, h.maxConcurrent) | Reset cache between `goss serve` runs (#<I>) | aelsabbahy_goss | train | go |
f77c05b31e7800b82589028aff62188e69a8b535 | diff --git a/dataviews/dataviews.py b/dataviews/dataviews.py
index <HASH>..<HASH> 100644
--- a/dataviews/dataviews.py
+++ b/dataviews/dataviews.py
@@ -582,7 +582,7 @@ class TableStack(Stack):
stacks[str(label)][new_key] = Curve(zip(xvalues, yvalues), **settings)
# If there are multiple table entries, generate grid
- stack_data = stacks.values()
+ stack_data = list(stacks.values())
stack_grid = stack_data[0]
for stack in stack_data[1:]:
stack_grid += stack | Fixed collate for Python 3 compatibility | pyviz_holoviews | train | py |
8f73f6688d6b783983fbafe931a1d2a3ec3e9939 | diff --git a/eventsourcing/domain.py b/eventsourcing/domain.py
index <HASH>..<HASH> 100644
--- a/eventsourcing/domain.py
+++ b/eventsourcing/domain.py
@@ -417,7 +417,7 @@ def event(
return create_command_method_decorator
else:
- if hasattr(arg, "__name__"):
+ if isinstance(arg, (staticmethod, classmethod)) or hasattr(arg, "__name__"):
item = f"'{arg.__name__}'"
else:
item = f"{arg}" | Fixed test for Python < <I> (static and class method). | johnbywater_eventsourcing | train | py |
3707c4710a06b9cb0f970da7879e486dd0e6af6f | diff --git a/email.go b/email.go
index <HASH>..<HASH> 100644
--- a/email.go
+++ b/email.go
@@ -160,7 +160,19 @@ func (e *Email) Send(addr string, a smtp.Auth) error {
//writeMIME writes the quoted-printable text to the IO Writer
func writeMIME(w io.Writer, s string) error {
+ // Basic rules (comments to be removed once this function is fully implemented)
+ // * If character is printable, it can be represented AS IS
+ // * Lines must have a max of 76 characters
+ // * Lines must not end with whitespace
+ // - Rather, append a soft break (=) to the end of the line after the space for preservation
+ // *
_, err := fmt.Fprintf(w, "%s\r\n", s)
+ for _, c := range s {
+ // Check if we can just print the character
+ if (c >= '!' && c < '=') || (c >= '>' && c < '~') {
+ return nil
+ }
+ }
if err != nil {
return err
} | Working on writeMime function (may make this a full encoder later) | jordan-wright_email | train | go |
3a84ff7135def389eb9f361bf94e1205722ad14a | diff --git a/web/concrete/src/Block/Block.php b/web/concrete/src/Block/Block.php
index <HASH>..<HASH> 100644
--- a/web/concrete/src/Block/Block.php
+++ b/web/concrete/src/Block/Block.php
@@ -1036,9 +1036,6 @@ class Block extends Object implements \Concrete\Core\Permission\ObjectInterface
$q = "delete from CollectionVersionBlocks where bID = ?";
$r = $db->query($q, array($bID));
- $q = "delete from ComposerContentLayout where bID = ?";
- $r = $db->query($q, array($bID));
-
$q = "delete from BlockPermissionAssignments where bID = ?";
$r = $db->query($q, array($bID)); | remove ComposerContentLayout reference
That I can tell this is not need and gives errors on uninstall when working with packages that install defaultTemplate blocks.
Former-commit-id: b2eec<I>fd8bf5d<I>f7f<I>f2d<I>f<I>c<I>e2eb | concrete5_concrete5 | train | php |
2cf07a483f779d4312691c22ed4159ac855c41af | diff --git a/src/com/google/javascript/jscomp/ClosureRewriteModule.java b/src/com/google/javascript/jscomp/ClosureRewriteModule.java
index <HASH>..<HASH> 100644
--- a/src/com/google/javascript/jscomp/ClosureRewriteModule.java
+++ b/src/com/google/javascript/jscomp/ClosureRewriteModule.java
@@ -823,6 +823,10 @@ final class ClosureRewriteModule implements HotSwapCompilerPass {
if (!n.hasChildren()) {
Node nameNode = IR.name(n.getString()).srcref(n);
n.addChildToBack(nameNode);
+ Node changeScope = NodeUtil.getEnclosingChangeScopeRoot(n);
+ if (changeScope != null) {
+ compiler.reportChangeToChangeScope(changeScope);
+ }
}
} | Add a missing reportChange call which can lead to a ValidityCheck failure
-------------
Created by MOE: <URL> | google_closure-compiler | train | java |
bd6ad8af1fa7cd12684f0287374b9fe71a8c958a | diff --git a/src/Codeception/PHPUnit/ResultPrinter/HTML.php b/src/Codeception/PHPUnit/ResultPrinter/HTML.php
index <HASH>..<HASH> 100644
--- a/src/Codeception/PHPUnit/ResultPrinter/HTML.php
+++ b/src/Codeception/PHPUnit/ResultPrinter/HTML.php
@@ -252,6 +252,23 @@ class HTML extends CodeceptionResultPrinter
$this->failures[Descriptor::getTestSignature($test)][] = $this->cleanMessage($e);
parent::addFailure($test, $e, $time);
}
+
+ /**
+ * Starts test.
+ *
+ * @param \PHPUnit_Framework_Test $test
+ */
+ public function startTest(\PHPUnit_Framework_Test $test)
+ {
+ $name = Descriptor::getTestSignature($test);
+ if (isset($this->failures[$name])) {
+ // test failed in before hook
+ return;
+ }
+
+ // start test and mark initialize as passed
+ parent::startTest($test);
+ }
/** | Fixed #<I> - HTML Report marks tests as succeeded (#<I>)
* Fixed #<I>
* Remove whitespace | Codeception_base | train | php |
d23d0398fe3b889064d12941a18bf844497fd46d | diff --git a/backup/backuplib.php b/backup/backuplib.php
index <HASH>..<HASH> 100644
--- a/backup/backuplib.php
+++ b/backup/backuplib.php
@@ -315,7 +315,7 @@
$status = execute_sql("INSERT INTO {$CFG->prefix}backup_files
(backup_code, file_type, path)
VALUES
- ('$backup_unique_code','course','$dir')",false);
+ ('$backup_unique_code','course','".addslashes($dir)."')",false);
}
//Do some output
backup_flush(30); | Merged from MOODLE_<I>_STABLE: Escape strings for database. SC # <I> | moodle_moodle | train | php |
3813bd452909ec92835f3c369ba5607094545ec2 | diff --git a/lib/pith/server.rb b/lib/pith/server.rb
index <HASH>..<HASH> 100644
--- a/lib/pith/server.rb
+++ b/lib/pith/server.rb
@@ -12,7 +12,7 @@ module Pith
use Rack::Lint
use Pith::Server::AutoBuild, project
use Adsf::Rack::IndexFileFinder, :root => project.output_dir
- run Rack::File.new(project.output_dir)
+ run Rack::Directory.new(project.output_dir)
end
end
diff --git a/lib/pith/version.rb b/lib/pith/version.rb
index <HASH>..<HASH> 100644
--- a/lib/pith/version.rb
+++ b/lib/pith/version.rb
@@ -1,3 +1,3 @@
module Pith
- VERSION = "0.0.3".freeze
+ VERSION = "0.0.4a1".freeze
end | Serve a directory-listing, if no index-file is found. | mdub_pith | train | rb,rb |
420f7fd507fd5868adc1e0398c2422aac16d2013 | diff --git a/activerecord/test/cases/query_cache_test.rb b/activerecord/test/cases/query_cache_test.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/cases/query_cache_test.rb
+++ b/activerecord/test/cases/query_cache_test.rb
@@ -170,6 +170,18 @@ end
class QueryCacheExpiryTest < ActiveRecord::TestCase
fixtures :tasks, :posts, :categories, :categories_posts
+ def test_cache_gets_cleared_after_migration
+ # warm the cache
+ Post.find(1)
+
+ # change the column definition
+ Post.connection.change_column :posts, :title, :string, :limit => 80
+ assert_nothing_raised { Post.find(1) }
+
+ # restore the old definition
+ Post.connection.change_column :posts, :title, :string
+ end
+
def test_find
Task.connection.expects(:clear_query_cache).times(1) | Added failing test case for changing schema in migration not clearing the prepared statement cache | rails_rails | train | rb |
5a994ed3054c17259c04e7c145dcd69d6279eae0 | diff --git a/test/lib/browser/load-css.js b/test/lib/browser/load-css.js
index <HASH>..<HASH> 100644
--- a/test/lib/browser/load-css.js
+++ b/test/lib/browser/load-css.js
@@ -7,7 +7,7 @@ module.exports = function (t, a, d) {
webmake(`${ pg }/lib/browser-test.js`)(result => {
// eslint-disable-next-line no-eval
result = eval(result);
- a(result.style.innerHTML, "body { color: black; background: white; }");
- a(result.html.innerHTML, "<p><span>Hello!</span></p>");
+ a(result.style.innerHTML, "body {\n\tcolor: black;\n\tbackground: white;\n}");
+ a(result.html.innerHTML, "<p><span>Hello!</span></p>\n");
}).done(d, d);
}; | test: Update up to changes in dependencies | medikoo_modules-webmake | train | js |
573777b399f32f9c58cf358eb1ce09439fc6bec2 | diff --git a/src/Blueprint.php b/src/Blueprint.php
index <HASH>..<HASH> 100644
--- a/src/Blueprint.php
+++ b/src/Blueprint.php
@@ -494,6 +494,20 @@ abstract class Blueprint
}
}
+ /**
+ * Reset the query and source; prep for another pass
+ *
+ */
+ protected function reset() {
+ $this->activePattern = false;
+ $this->activeFilters = [];
+ $this->activeTransformations = [];
+ $this->insert_records = [];
+ $this->set = [];
+ $queryclass = get_class($this->query);
+ $this->query = new $queryclass();
+ }
+
// PRIVATE METHODS
private function loadElements($query = false) {
@@ -515,14 +529,4 @@ abstract class Blueprint
return $this->query;
}
}
-
- private function reset() {
- $this->activePattern = false;
- $this->activeFilters = [];
- $this->activeTransformations = [];
- $this->insert_records = [];
- $this->set = [];
- $queryclass = get_class($this->query);
- $this->query = new $queryclass();
- }
}
\ No newline at end of file | Changed reset() to protected instead of private; useful when dealing with transformations | sypherlev_blueprint | train | php |
8367b242e514382c958cec8fd670399f7e51a6e3 | diff --git a/salt/loader.py b/salt/loader.py
index <HASH>..<HASH> 100644
--- a/salt/loader.py
+++ b/salt/loader.py
@@ -155,6 +155,10 @@ class Loader(object):
self.grains = opts['grains']
else:
self.grains = {}
+ if 'pillar' in opts:
+ self.pillar = opts['pillar']
+ else:
+ self.pillar = {}
self.opts = self.__prep_mod_opts(opts)
def __prep_mod_opts(self, opts):
@@ -340,6 +344,7 @@ class Loader(object):
mod.__opts__ = self.opts
mod.__grains__ = self.grains
+ mod.__pillar__ = self.pillar
if pack:
if isinstance(pack, list): | Add pillar data to the loader | saltstack_salt | train | py |
1d37554a4a500e276b833b67abad27132336ab6a | diff --git a/broqer/op/_operator.py b/broqer/op/_operator.py
index <HASH>..<HASH> 100644
--- a/broqer/op/_operator.py
+++ b/broqer/op/_operator.py
@@ -57,7 +57,7 @@ def build_operator(operator_cls):
The resulting function takes a publisher as argument and returns a new
publisher corresponding the operator functionality.
- """
+ """
def _op(*args, **kwargs):
def _build(publisher):
return operator_cls(publisher, *args, **kwargs)
diff --git a/broqer/op/accumulate.py b/broqer/op/accumulate.py
index <HASH>..<HASH> 100644
--- a/broqer/op/accumulate.py
+++ b/broqer/op/accumulate.py
@@ -1,5 +1,6 @@
"""
-Call a function with state and new value which is returning new state and value to emit.
+Call a function with state and new value which is returning new state and value
+to emit.
Usage:
>>> from broqer import Subject, op | pep8 fixes for _operator and accumulate | semiversus_python-broqer | train | py,py |
b72919d79fc3dddd05573df4bce26895d83708bc | diff --git a/lib/wongi-engine/wme.rb b/lib/wongi-engine/wme.rb
index <HASH>..<HASH> 100644
--- a/lib/wongi-engine/wme.rb
+++ b/lib/wongi-engine/wme.rb
@@ -40,7 +40,7 @@ module Wongi::Engine
def =~ template
raise "Cannot match a WME against a #{template.class}" unless Template === template
- result = match_member( template, :subject ) & match_member( template, :predicate ) & match_member( template, :object )
+ result = match_member( self.subject, template.subject ) & match_member( self.predicate, template.predicate ) & match_member( self.object, template.object )
if result.match?
result
end
@@ -122,10 +122,8 @@ module Wongi::Engine
end.clear
end
- def match_member template, member
+ def match_member mine, theirs
result = WMEMatchData.new
- mine = self.send member
- theirs = template.send member
if theirs == :_ || mine == theirs
result.match!
elsif Template.variable? theirs | switched from #send to concrete methods in WME | ulfurinn_wongi-engine | train | rb |
be576c2092f845a2db01e1851db4b36091ca7520 | diff --git a/spec/unit/fetchers/net_fetcher_spec.rb b/spec/unit/fetchers/net_fetcher_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/fetchers/net_fetcher_spec.rb
+++ b/spec/unit/fetchers/net_fetcher_spec.rb
@@ -278,6 +278,10 @@ module Omnibus
let(:cumulative_downloaded_length) { 100 }
+ let(:uri_open_target) do
+ RUBY_VERSION.to_f < 2.7 ? subject : URI
+ end
+
def capturing_stdout
old_stdout, $stdout = $stdout, progress_bar_output
yield
@@ -286,7 +290,7 @@ module Omnibus
end
before do
- expect(subject).to receive(:open).with(source[:url], expected_open_opts) do |_url, open_uri_opts|
+ expect(uri_open_target).to receive(:open).with(source[:url], expected_open_opts) do |_url, open_uri_opts|
open_uri_opts[:content_length_proc].call(reported_content_length)
open_uri_opts[:progress_proc].call(cumulative_downloaded_length) | Update download mock based on Ruby version
In our code we call .open on a different object based on which version
of Ruby we are using. We need to ensure we reflect that in our tests. | chef_omnibus | train | rb |
64c99b1e374c22b9c4bedc02e4cff241b8800839 | diff --git a/salt/wheel/pillar_roots.py b/salt/wheel/pillar_roots.py
index <HASH>..<HASH> 100644
--- a/salt/wheel/pillar_roots.py
+++ b/salt/wheel/pillar_roots.py
@@ -94,7 +94,7 @@ def write(data, path, env='base', index=0):
'''
if not env in __opts__['pillar_roots']:
return 'Named environment {0} is not present'.format(env)
- if not len(__opts__['pillar_roots'][env]) > index:
+ if len(__opts__['pillar_roots'][env]) <= index:
return 'Specified index {0} in environment {1} is not present'.format(
index, env)
if os.path.isabs(path): | wheel.pillar_roots: not X > Y -> X <= Y | saltstack_salt | train | py |
3239aca69bd940626f3e27ab829fc7fa1c7cdc5e | diff --git a/p2p/server.go b/p2p/server.go
index <HASH>..<HASH> 100644
--- a/p2p/server.go
+++ b/p2p/server.go
@@ -30,7 +30,7 @@ const (
frameReadTimeout = 30 * time.Second
// Maximum amount of time allowed for writing a complete message.
- frameWriteTimeout = 5 * time.Second
+ frameWriteTimeout = 20 * time.Second
)
var errServerStopped = errors.New("server stopped") | p2p: bump global write timeout to <I>s
The previous value of 5 seconds causes timeouts for legitimate messages
if large messages are sent. | ethereum_go-ethereum | train | go |
29174508f8ae4e71a4bdbc554d0197c18e58cb03 | diff --git a/spec/rails/view_spec.rb b/spec/rails/view_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/rails/view_spec.rb
+++ b/spec/rails/view_spec.rb
@@ -7,7 +7,7 @@ describe "a view" do
end
it "can capture with an erector block" do
- pending("needs some re-work (maybe how haml does it?)")
+ pending("not sure why this is failing if form_tag is working")
message = Erector::Widget.new(@view) do
captured = @helpers.capture do
h1 'capture me!'
@@ -30,4 +30,4 @@ describe "the case which fake_erbout handles" do
foo.should == 'foo'
end.to_s.should == ""
end
-end
\ No newline at end of file
+end | Not sure why capture is not working; reflect this in the pending message.
git-svn-id: svn+ssh://rubyforge.org/var/svn/erector/trunk@<I> 4b<I>b9-<I>f2-<I>-<I>b1-b<I>f<I>b<I>f | erector_erector | train | rb |
4607ab3aeebdfa52444bd0fa57e5d4f0c352a298 | diff --git a/spec/premailer-rails3/hook_spec.rb b/spec/premailer-rails3/hook_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/premailer-rails3/hook_spec.rb
+++ b/spec/premailer-rails3/hook_spec.rb
@@ -2,6 +2,7 @@ require 'spec_helper'
describe PremailerRails::Hook do
describe '.delivering_email' do
+ before { File.stubs(:read).returns('') }
def run_hook(message)
PremailerRails::Hook.delivering_email(message)
end | Fix a file error in hook specs | fphilipe_premailer-rails | train | rb |
97387a7f80758f043ac38c162b9d5b969e5e088b | diff --git a/lib/rest/client.rb b/lib/rest/client.rb
index <HASH>..<HASH> 100644
--- a/lib/rest/client.rb
+++ b/lib/rest/client.rb
@@ -113,6 +113,8 @@ module Rest
break
rescue Rest::HttpError => ex
if ex.code == 503
+ raise ex if current_retry == max_retries - 1
+
pow = (4 ** (current_retry)) * 100 # milliseconds
#puts 'pow=' + pow.to_s
s = Random.rand * pow | Should raise error if max_retries reached. | iron-io_rest | train | rb |
0c5b4c15f880b1e96ac70ced1de2d7d4f989c19e | diff --git a/sos/report/plugins/networking.py b/sos/report/plugins/networking.py
index <HASH>..<HASH> 100644
--- a/sos/report/plugins/networking.py
+++ b/sos/report/plugins/networking.py
@@ -268,6 +268,8 @@ class Networking(Plugin):
self.add_cmd_output([
ns_cmd_prefix + "ip address show",
ns_cmd_prefix + "ip route show table all",
+ ns_cmd_prefix + "ip -s -s neigh show",
+ ns_cmd_prefix + "ip rule list",
ns_cmd_prefix + "iptables-save",
ns_cmd_prefix + "ip6tables-save",
ns_cmd_prefix + "netstat %s -neopa" % self.ns_wide, | [networking] Include ns ip neigh and ip rule info
Resolves: #<I>
Closes: #<I> | sosreport_sos | train | py |
acb326149adffe03fd06aac6515ed58b682f646b | diff --git a/pymc3/tests/test_variational_inference.py b/pymc3/tests/test_variational_inference.py
index <HASH>..<HASH> 100644
--- a/pymc3/tests/test_variational_inference.py
+++ b/pymc3/tests/test_variational_inference.py
@@ -505,7 +505,7 @@ def test_elbo():
# Create variational gradient tensor
mean_field = MeanField(model=model)
- with pm.theanof.change_flags(compute_test_value="off"):
+ with theano.config.change_flags(compute_test_value="off"):
elbo = -pm.operators.KL(mean_field)()(10000)
mean_field.shared_params["mu"].set_value(post_mu)
@@ -732,7 +732,6 @@ def fit_kwargs(inference, use_minibatch):
return _select[(type(inference), key)]
-@pytest.mark.run("first")
def test_fit_oo(inference, fit_kwargs, simple_model_data):
trace = inference.fit(**fit_kwargs).sample(10000)
mu_post = simple_model_data["mu_post"]
@@ -911,7 +910,6 @@ def binomial_model_inference(binomial_model, inference_spec):
return inference_spec()
-@pytest.mark.run(after="test_sample_replacements")
def test_replacements(binomial_model_inference):
d = tt.bscalar()
d.tag.test_value = 1 | Repair change_flags reference and remove pytest.mark.run decorators
We do not have pytest-ordering in the dependencies and tests should be unordered anyway. | pymc-devs_pymc | 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.