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 |
|---|---|---|---|---|---|
d307a23f5af2dffe84b18a7ec0b4d4eaae82f83b | diff --git a/provider/godaddy/godaddy.go b/provider/godaddy/godaddy.go
index <HASH>..<HASH> 100644
--- a/provider/godaddy/godaddy.go
+++ b/provider/godaddy/godaddy.go
@@ -550,7 +550,7 @@ func maxOf(vars ...int64) int64 {
func toString(obj interface{}) string {
b, err := json.MarshalIndent(obj, "", " ")
- if e != nil {
+ if err != nil {
return fmt.Sprintf("<%v>", e)
} | Update provider/godaddy/godaddy.go
Typo: rename e to err | kubernetes-incubator_external-dns | train | go |
b5fa3dca01a632e983874a636438e450312cfe42 | diff --git a/src/test/org/openscience/cdk/interfaces/AbstractAtomContainerTest.java b/src/test/org/openscience/cdk/interfaces/AbstractAtomContainerTest.java
index <HASH>..<HASH> 100644
--- a/src/test/org/openscience/cdk/interfaces/AbstractAtomContainerTest.java
+++ b/src/test/org/openscience/cdk/interfaces/AbstractAtomContainerTest.java
@@ -77,7 +77,7 @@ public abstract class AbstractAtomContainerTest extends AbstractChemObjectTest {
}
@Test public void testCloneButKeepOriginalsIntact() throws Exception {
- IMolecule molecule = (IMolecule)newChemObject();
+ IAtomContainer molecule = (IAtomContainer)newChemObject();
IAtom atom = molecule.getBuilder().newAtom();
molecule.addAtom(atom);
Assert.assertEquals(atom, molecule.getAtom(0)); | Fixed a ClassCastException in a unit test; I messed up (mea culpa) | cdk_cdk | train | java |
bd958c73facc045b02a5cb9be5da0ed1d7a21ae9 | diff --git a/saltcloud/config.py b/saltcloud/config.py
index <HASH>..<HASH> 100644
--- a/saltcloud/config.py
+++ b/saltcloud/config.py
@@ -313,6 +313,10 @@ def apply_cloud_providers_config(overrides, defaults=None):
'single entry for EC2, Joyent, Openstack, and so '
'forth.'
)
+ raise saltcloud.exceptions.SaltCloudConfigError(
+ 'The cloud provider alias {0!r} has multiple entries '
+ 'for the {1[provider]!r} driver.'.format(key, details)
+ )
handled_providers.add(
details['provider']
) | Fail soon with an improper cloud providers alias setup. | saltstack_salt | train | py |
ba79ef85aaf5a12fe54c41841c1044ccbab28843 | diff --git a/ailment/analyses/propagator.py b/ailment/analyses/propagator.py
index <HASH>..<HASH> 100644
--- a/ailment/analyses/propagator.py
+++ b/ailment/analyses/propagator.py
@@ -83,8 +83,8 @@ def get_engine(base_engine):
super(SimEnginePropagator, self).__init__()
self._stack_pointer_tracker = stack_pointer_tracker
- def _process(self, state, successors, block=None):
- super(SimEnginePropagator, self)._process(state, successors, block=block)
+ def _process(self, state, successors, block=None, whitelist=None, **kwargs):
+ super(SimEnginePropagator, self)._process(state, successors, block=block, whitelist=whitelist, **kwargs)
#
# VEX statement handlers | Propagator: Support statement whitelists. | angr_ailment | train | py |
d931318aaf025ff8e0c608543f2dd18fbf4c8501 | diff --git a/src/rzslider.js b/src/rzslider.js
index <HASH>..<HASH> 100644
--- a/src/rzslider.js
+++ b/src/rzslider.js
@@ -284,6 +284,7 @@ function throttle(func, wait, options) {
self = this;
this.initElemHandles();
+ this.addAccessibility();
this.calcViewDimensions();
this.setMinAndMax();
@@ -587,6 +588,18 @@ function throttle(func, wait, options) {
this.selBar.addClass('rz-draggable');
}
},
+
+ /**
+ * Adds accessibility atributes
+ *
+ * Run only once during initialization
+ *
+ * @returns {undefined}
+ */
+ addAccessibility: function ()
+ {
+ this.sliderElem.attr("role", "slider");
+ },
/**
* Calculate dimensions that are dependent on view port size | Added role=slider for better accessibility. | angular-slider_angularjs-slider | train | js |
ddaf5fc1715c3de91e55e087c39bf58938ed34f9 | diff --git a/test/test_listplugin.rb b/test/test_listplugin.rb
index <HASH>..<HASH> 100755
--- a/test/test_listplugin.rb
+++ b/test/test_listplugin.rb
@@ -584,7 +584,7 @@ module ListPluginTests
nid,d = @rc.rttable.search_node("aa")
vn = @rc.rttable.get_vnode_id(d)
- st = Roma::Storage::TCMemStorage.new
+ st = Roma::Storage::RubyHashStorage.new
st.vn_list = [vn]
st.storage_path = 'storage_test'
st.opendb | Use Ruby Hash storage instead of TokyoCabinet | roma_roma | train | rb |
472cfef4ca3d1df90937bea4693d791f3488c3cc | diff --git a/tests/Database/Ddd/EntityTest.php b/tests/Database/Ddd/EntityTest.php
index <HASH>..<HASH> 100644
--- a/tests/Database/Ddd/EntityTest.php
+++ b/tests/Database/Ddd/EntityTest.php
@@ -1101,7 +1101,7 @@ class EntityTest extends TestCase
'delete_at' => 0,
]));
- $post = Post::connectSandbox(['password' => '123456'], function () {
+ $post = Post::connectSandbox(['password' => $GLOBALS['LEEVEL_ENV']['DATABASE']['MYSQL']['PASSWORD']], function () {
return Post::find()->where('id', 1)->findOne();
}); | tests(entity): fix tests of connectSandbox | hunzhiwange_framework | train | php |
3ca226e897e977cd6545b5c2528ceef23f843e8a | diff --git a/plexapi/audio.py b/plexapi/audio.py
index <HASH>..<HASH> 100644
--- a/plexapi/audio.py
+++ b/plexapi/audio.py
@@ -186,12 +186,12 @@ class Track(Audio):
def build_item(server, elem, initpath):
- VIDEOCLS = {Movie.TYPE:Movie, Show.TYPE:Show, Season.TYPE:Season, Episode.TYPE:Episode}
- vtype = elem.attrib.get('type')
- if vtype in VIDEOCLS:
- cls = VIDEOCLS[vtype]
+ AUDIOCLS = {Artist.TYPE:Artist, Album.TYPE:Album, Track.TYPE:Track}
+ atype = elem.attrib.get('type')
+ if atype in AUDIOCLS:
+ cls = AUDIOCLS[atype]
return cls(server, elem, initpath)
- raise UnknownType('Unknown video type: %s' % vtype)
+ raise UnknownType('Unknown audio type: %s' % atype)
def find_key(server, key): | Fix build_item() to deal with audio | pkkid_python-plexapi | train | py |
1eecea606b5ba43cda90d7d58930e59fd266f2a1 | diff --git a/doc.go b/doc.go
index <HASH>..<HASH> 100644
--- a/doc.go
+++ b/doc.go
@@ -181,7 +181,7 @@ Conn.PgTypes.
See example_custom_type_test.go for an example of a custom type for the
PostgreSQL point type.
-[]byte Mapping
+Raw Bytes Mapping
[]byte passed as arguments to Query, QueryRow, and Exec are passed unmodified
to PostgreSQL. In like manner, a *[]byte passed to Scan will be filled with | Tweak doc.go so section head is detected | jackc_pgx | train | go |
2a004c638dc16840308e95cc51b86b92a4cd969f | diff --git a/src/Helper/DrushHelper.php b/src/Helper/DrushHelper.php
index <HASH>..<HASH> 100644
--- a/src/Helper/DrushHelper.php
+++ b/src/Helper/DrushHelper.php
@@ -59,7 +59,8 @@ class DrushHelper extends Helper
if (!$reset && isset($version)) {
return $version;
}
- exec($this->getDrushExecutable() . ' --version', $drushVersion, $returnCode);
+ $command = $this->getDrushExecutable() . ' --version';
+ exec($command, $drushVersion, $returnCode);
if ($returnCode > 0) {
$message = $returnCode == 127 ? 'Error finding Drush version' : 'Drush is not installed';
throw new \Exception($message, $returnCode);
@@ -68,7 +69,7 @@ class DrushHelper extends Helper
// Parse the version from the Drush output. It should be a string a bit
// like " Drush Version : 8.0.0-beta14 ".
if (!preg_match('/:\s*([0-9]+\.[a-z0-9\-\.]+)\s*$/', $drushVersion[0], $matches)) {
- throw new \Exception("Unexpected 'drush --version' output: \n" . implode("\n", $drushVersion));
+ throw new \Exception("Unexpected output from command '$command': \n" . implode("\n", $drushVersion));
}
$version = $matches[1]; | Even clearer drush version error output
We need to see the exact command being run | platformsh_platformsh-cli | train | php |
57719c745cd76fc578b47920733ce7c97c17c71d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -174,9 +174,6 @@ setup_config = dict(
'multitaper', 'seismology', 'signal processing'],
packages=find_packages(),
zip_safe=False,
- # this is needed for "pip install instaseis==dev"
- download_url=("https://github.com/krischer/mtspect/zipball/master"
- "#egg=instaseis=dev"),
include_package_data=True
) | Removing unnecessary download_url line.
Those who want the dev version can just checkout from github. | krischer_mtspec | train | py |
39ebf12b528653f10ecaf48b878f9855d568a92f | diff --git a/api/api.go b/api/api.go
index <HASH>..<HASH> 100644
--- a/api/api.go
+++ b/api/api.go
@@ -20,7 +20,6 @@ import (
"net/http"
"net/url"
"os"
- "regexp"
"strings"
"sync"
"time"
@@ -241,7 +240,7 @@ func (a *API) apiRequest(reqMethod string, reqPath string, data []byte) ([]byte,
if !a.useExponentialBackoff {
break
}
- if matched, _ := regexp.MatchString("code 403", err.Error()); matched {
+ if strings.Contains(err.Error(), "code 403") {
break
}
} | fix: simplify check for <I> on api call error | circonus-labs_circonus-gometrics | train | go |
6e366c5c083e43b98d8dc033c3b6594563061641 | diff --git a/src/danog/MadelineProto/Magic.php b/src/danog/MadelineProto/Magic.php
index <HASH>..<HASH> 100644
--- a/src/danog/MadelineProto/Magic.php
+++ b/src/danog/MadelineProto/Magic.php
@@ -94,7 +94,7 @@ class Magic
self::$revision = 'Revision: '.self::$revision.$latest;
}
self::$can_parallel = false;
- if (php_sapi_name() === 'cli') {
+ if (php_sapi_name() === 'cli' && !(class_exists('\\Phar') && \Phar::running())) {
try {
$back = debug_backtrace(0);
$promise = \Amp\File\get(end($back)['file']); | Disable parallel processing on phar | danog_MadelineProto | train | php |
fabcef1fb8a405f2d81ba4671c53690a1441fad7 | diff --git a/lib/todos.js b/lib/todos.js
index <HASH>..<HASH> 100644
--- a/lib/todos.js
+++ b/lib/todos.js
@@ -200,9 +200,7 @@ function getLanguage (filename /*, content */) {
}
function fromDiff (repo, diff, sha, conf) {
- conf = _.merge({
- "onProgress": _.noop
- }, conf || {}, config.defaults);
+ conf = _.merge({ "onProgress": _.noop }, config.defaults, conf || {});
var todos = _.flatten(_.map(diff, function (file) {
var addedLines = _.filter(file.lines, "add"); | FIX always using config defaults in fromDiff | naholyr_github-todos | train | js |
32abb72224b0827e06bea8eebd36e630a63640ae | diff --git a/delay.js b/delay.js
index <HASH>..<HASH> 100644
--- a/delay.js
+++ b/delay.js
@@ -6,7 +6,7 @@ var isReduced = require("./is-reduced")
var end = require("./end")
function delay(source, ms) {
- ms = ms || 3 // Minimum 3ms, as on less dispatch order becomes unreliable
+ ms = ms || 6 // Minimum 6ms, as on less dispatch order becomes unreliable
return reducible(function(next, result) {
var timeout = 0
var ended = false | Increase default delay from to 3 to 6 as phantom
seems to act strange on less that that. | Gozala_reducers | train | js |
e8becfe440101fba0532eca8372d63e3a75ee7ce | diff --git a/src/plugins/pouchdb.gql.js b/src/plugins/pouchdb.gql.js
index <HASH>..<HASH> 100644
--- a/src/plugins/pouchdb.gql.js
+++ b/src/plugins/pouchdb.gql.js
@@ -287,7 +287,7 @@
symbol("identifier", function (tok) {
//here we allow for identifiers with the same name as functions
- if (isfunction (tok.value) && peekToken().type === "(") {
+ if (isFunction (tok.value) && peekToken().type === "(") {
var args= [];
while(advance()){
if (token.type === ")"){ | (#<I>) - fixed a typo in gql plugin | pouchdb_pouchdb | train | js |
f5b25f5d459d0cb8b29bfbe559e3c29db12e7d72 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ here = os.path.abspath(os.path.dirname(__file__))
setup(
name='django-tilebundler',
- version='0.1-alpha6',
+ version='0.1-beta2',
author='Syrus Mesdaghi',
author_email='geoshape.org@gmail.com',
url='https://github.com/ROGUE-JCTD/django-tilebundler',
@@ -27,11 +27,11 @@ setup(
'Programming Language :: Python :: 2.7'
],
install_requires=[
- 'Django==1.6.10',
+ 'Django>=1.6.10',
'MapProxy==1.8.0',
- 'PyYAML==3.10',
- 'django-tastypie==0.12.1',
- 'Shapely==1.5.9',
+ 'PyYAML>=3.10',
+ 'django-tastypie>=0.12.1',
+ 'Shapely>=1.5.9',
'psutil==3.0.1'
]
) | allow >= on some dependancies. | ROGUE-JCTD_django-tilebundler | train | py |
2e456802eb90124f714026beff53e8a6977a6b43 | diff --git a/src/reporter/Coverage.php b/src/reporter/Coverage.php
index <HASH>..<HASH> 100644
--- a/src/reporter/Coverage.php
+++ b/src/reporter/Coverage.php
@@ -182,6 +182,11 @@ class Coverage extends Terminal
}
}
+ /**
+ * Output the coverage report of a metrics instance.
+ *
+ * @param Metrics $metrics A metrics instance.
+ */
protected function _renderCoverage($metrics)
{
$stats = $metrics->data();
diff --git a/src/reporter/coverage/Collector.php b/src/reporter/coverage/Collector.php
index <HASH>..<HASH> 100644
--- a/src/reporter/coverage/Collector.php
+++ b/src/reporter/coverage/Collector.php
@@ -388,6 +388,15 @@ class Collector
return $this->_methodMetrics($node, $metrics);
}
+ /**
+ * Helper for `Collector::metrics()`.
+ *
+ * @param string $type The metric type.
+ * @param integer $index The line index.
+ * @param integer $value The value to update.
+ * @param integer $increment The increment to perform if the line has not already been processed.
+ * @return integer The metric value.
+ */
protected function _lineMetric($type, $index, $value, $increment = 1) {
if ($this->_processed[$type] >= $index) {
return $value; | Adds missing docblocs. | kahlan_kahlan | train | php,php |
9169edacc90e95be45b72b18fff3ac73097fdb40 | diff --git a/calculation-engine/engine-tests/engine-it-performance/src/test/java/com/dataart/spreadsheetanalytics/BenchmarkTestParent.java b/calculation-engine/engine-tests/engine-it-performance/src/test/java/com/dataart/spreadsheetanalytics/BenchmarkTestParent.java
index <HASH>..<HASH> 100644
--- a/calculation-engine/engine-tests/engine-it-performance/src/test/java/com/dataart/spreadsheetanalytics/BenchmarkTestParent.java
+++ b/calculation-engine/engine-tests/engine-it-performance/src/test/java/com/dataart/spreadsheetanalytics/BenchmarkTestParent.java
@@ -60,7 +60,7 @@ public class BenchmarkTestParent {
public void startAllBenchmarks() throws Exception {
ChainedOptionsBuilder opts = new OptionsBuilder()
.mode(Mode.SampleTime)
- .timeUnit(TimeUnit.MILLISECONDS)
+ .timeUnit(TimeUnit.NANOSECONDS)
.warmupTime(TimeValue.seconds(1))
.warmupIterations(8)
.measurementTime(TimeValue.seconds(1)) | perf tests timeunit is changed to nanosecs | DataArt_CalculationEngine | train | java |
7d42fc2cefb5acfdb4196764cd387888be95b090 | diff --git a/i3ipc/connection.py b/i3ipc/connection.py
index <HASH>..<HASH> 100644
--- a/i3ipc/connection.py
+++ b/i3ipc/connection.py
@@ -15,6 +15,8 @@ import os
import subprocess
from threading import Timer, Lock
import time
+import Xlib
+import Xlib.display
python2 = sys.version_info[0] < 3
@@ -49,17 +51,10 @@ class Connection(object):
if not socket_path:
try:
- socket_path = subprocess.check_output(['i3', '--get-socketpath'],
- close_fds=True,
- universal_newlines=True).strip()
- except Exception:
- pass
-
- if not socket_path:
- try:
- socket_path = subprocess.check_output(['sway', '--get-socketpath'],
- close_fds=True,
- universal_newlines=True).strip()
+ disp = Xlib.display.Display()
+ root = disp.screen().root
+ i3atom = disp.intern_atom("I3_SOCKET_PATH")
+ socket_path = root.get_full_property(i3atom, Xlib.X.AnyPropertyType).value.decode()
except Exception:
pass | Use Xlib directly instead of calling i3 in a subprocess to get the socket path | acrisci_i3ipc-python | train | py |
669faed1391c827bb8c846075b48ac4758123e7f | diff --git a/test/jade.test.js b/test/jade.test.js
index <HASH>..<HASH> 100644
--- a/test/jade.test.js
+++ b/test/jade.test.js
@@ -645,18 +645,6 @@ module.exports = {
assert.equal(html, render(str));
- // Non-Enumerable
- var str = [
- '- each val in 1',
- ' li= val'
- ].join('\n');
-
- var html = [
- '<li>1</li>'
- ].join('');
-
- assert.equal(html, render(str));
-
// Complex
var str = [
'- var obj = { foo: "bar", baz: "raz" };', | Each no longer works with non-enumerables | pugjs_then-pug | train | js |
635ac61e8c5ad992d30535aed0235a8efe2f4c77 | diff --git a/src/Watchers/ExceptionWatcher.php b/src/Watchers/ExceptionWatcher.php
index <HASH>..<HASH> 100644
--- a/src/Watchers/ExceptionWatcher.php
+++ b/src/Watchers/ExceptionWatcher.php
@@ -49,7 +49,9 @@ class ExceptionWatcher extends Watcher
'message' => $exception->getMessage(),
'trace' => $trace,
'line_preview' => ExceptionContext::get($exception),
- 'context' => Arr::except($event->context, ['exception', 'telescope']),
+ 'context' => transform(Arr::except($event->context, ['exception', 'telescope']), function ($context) {
+ return ! empty($context) ? $context : null;
+ }),
])->tags($this->tags($event))
);
} | Only send context if it has value, otherwise set it to null. | laravel_telescope | train | php |
7b78083516494a664e9faba18579d5e6a10d80c3 | diff --git a/amino/do.py b/amino/do.py
index <HASH>..<HASH> 100644
--- a/amino/do.py
+++ b/amino/do.py
@@ -1,5 +1,5 @@
from types import GeneratorType
-from typing import TypeVar, Callable, Any, Generator, cast, Type
+from typing import TypeVar, Callable, Any, Generator, Type
import functools
from amino.tc.base import F
@@ -13,6 +13,8 @@ Do = Generator
# NOTE ostensibly, this cannot be tailrecced without separating strictly evaluated monadic composition from lazy ones.
# itr.gi_frame.f_lasti is the instruction pointer and could be used to detect laziness.
+# NOTE due to the nature of generators, a do with a lazily evaluated monad cannot be executed twice.
+# NOTE Lists don't work properly because the generator will be consumed by the first element
def untyped_do(f: Callable[..., Generator[G, B, None]]) -> Callable[..., G]:
@functools.wraps(f)
def do_loop(*a: Any, **kw: Any) -> F[B]:
@@ -36,7 +38,7 @@ def do(tpe: Type[A]) -> Callable[[Callable[..., Generator]], Callable[..., A]]:
f.tpe = tpe
f.__do = None
f.__do_original = f
- return cast(Callable[[Callable[..., Generator]], Callable[..., A]], functools.wraps(f)(untyped_do))(f)
+ return functools.wraps(f)(untyped_do)(f)
return deco
tdo = do | remove cast from `do` | tek_amino | train | py |
b7f970e5ea1d5d1b2f4f0c66a922b929242550c5 | diff --git a/lib/roar/representer.rb b/lib/roar/representer.rb
index <HASH>..<HASH> 100644
--- a/lib/roar/representer.rb
+++ b/lib/roar/representer.rb
@@ -17,12 +17,6 @@ module Roar
end
end
- attr_reader :represented
-
- def initialize(represented=nil) # FIXME!
- @represented = represented
- end
-
# DISCUSS: serialize on instance?
def serialize(represented, mime_type) | removing @represented as we all hate ivars. | trailblazer_roar | train | rb |
26d5e6f2f22b88b0d35fad3461a0919e6601be9d | diff --git a/lib/Drupal/AppConsole/Command/GeneratorFormCommand.php b/lib/Drupal/AppConsole/Command/GeneratorFormCommand.php
index <HASH>..<HASH> 100644
--- a/lib/Drupal/AppConsole/Command/GeneratorFormCommand.php
+++ b/lib/Drupal/AppConsole/Command/GeneratorFormCommand.php
@@ -163,12 +163,12 @@ class GeneratorFormCommand extends GeneratorCommand {
// TODO: validate
$input_type = $d->askAndValidate(
$output,
- $dialog->getQuestion(' Type'),
+ $dialog->getQuestion(' Type', 'textfield',':'),
function($input) use ($input_types){
return $input;
},
false,
- null,
+ 'textfield',
$input_types
); | Set textfield as default on field generation | hechoendrupal_drupal-console | train | php |
8b8c159f4de8f657a7bee73a96f05c307eb2e8c0 | diff --git a/src/java/org/apache/cassandra/gms/Gossiper.java b/src/java/org/apache/cassandra/gms/Gossiper.java
index <HASH>..<HASH> 100644
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@ -817,6 +817,8 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
return;
}
+ localState.markDead();
+
MessageOut<EchoMessage> echoMessage = new MessageOut<EchoMessage>(MessagingService.Verb.ECHO, new EchoMessage(), EchoMessage.serializer);
logger.trace("Sending a EchoMessage to {}", addr);
IAsyncCallback echoHandler = new IAsyncCallback() | Mark EPS as dead before sending echo command.
Patch by Sankalp Kohli, reviewed by brandonwilliams for CASSANDRA-<I> | Stratio_stratio-cassandra | train | java |
faa7f6270e26a6f734e3c18b4a6f0e2e92a39bae | diff --git a/demos/modal.php b/demos/modal.php
index <HASH>..<HASH> 100644
--- a/demos/modal.php
+++ b/demos/modal.php
@@ -61,4 +61,5 @@ $t->on('click', 'tr', new \atk4\ui\jsModal(
]
)
));
+$t->addStyle('cursor', 'pointer'); | imply ability to click on table with mouse pointer. | atk4_ui | train | php |
11cfdb23940b2c76e1104c82afc9552ac6f3dc19 | diff --git a/src/attributes.js b/src/attributes.js
index <HASH>..<HASH> 100644
--- a/src/attributes.js
+++ b/src/attributes.js
@@ -317,12 +317,12 @@ jQuery.extend({
return ret;
} else {
- var attr = elem.getAttribute( name );
+ ret = elem.getAttribute( name );
// Non-existent attributes return null, we normalize to undefined
- return attr === null || attr === "undefined" || attr === "null" ?
+ return ret === null || ret === "null" ?
undefined :
- attr;
+ ret;
}
}
},
@@ -336,7 +336,7 @@ jQuery.extend({
// set property to null if getSetAttribute not supported (IE6-7)
// setting className to null makes the class "null"
if ( name === "className" ) {
- elem.className = "";
+ elem[ name ] = "";
} else {
elem.setAttribute( name, null );
} | Non-existent attribute for jQuery.attr no longer needs to check for "undefined"
- Remove an unnecessary var
- Use variable in removeAttr for better minification | jquery_jquery | train | js |
207528992b1330cfed4683861f4691241ceac270 | diff --git a/go/dhcp/api.go b/go/dhcp/api.go
index <HASH>..<HASH> 100644
--- a/go/dhcp/api.go
+++ b/go/dhcp/api.go
@@ -5,7 +5,6 @@ import (
"fmt"
"io"
"io/ioutil"
- "log"
"net"
"net/http"
"strconv"
@@ -208,11 +207,11 @@ func decodeOptions(b string) map[dhcp.OptionCode][]byte {
var options []Options
_, value := etcdGet(b)
decodedValue := converttobyte(value)
+ var dhcpOptions = make(map[dhcp.OptionCode][]byte)
if err := json.Unmarshal(decodedValue, &options); err != nil {
- log.Fatal(err)
+ return dhcpOptions
}
- // spew.Dump(options)
- var dhcpOptions = make(map[dhcp.OptionCode][]byte)
+
for _, option := range options {
var Value interface{}
switch option.Type { | Do not crash when there is nothing in the cache | inverse-inc_packetfence | train | go |
82d3f514c7937657f8af283b5320c8853493cf65 | diff --git a/lib/webpack.config.js b/lib/webpack.config.js
index <HASH>..<HASH> 100644
--- a/lib/webpack.config.js
+++ b/lib/webpack.config.js
@@ -109,13 +109,6 @@ const plugins = [
}),
];
-if (isDev) {
- plugins.push(
- new webpack.HotModuleReplacementPlugin(),
- new webpack.NoEmitOnErrorsPlugin()
- );
-}
-
if (!isDev) {
plugins.push(
new CompressionWebpackPlugin({ | PWA-<I> Removed unnecessary plugins. | shopgate_cloud-sdk-webpack | train | js |
71b121ca7ae3da493110aa7b652230cd2c3cb219 | diff --git a/gym-unity/setup.py b/gym-unity/setup.py
index <HASH>..<HASH> 100755
--- a/gym-unity/setup.py
+++ b/gym-unity/setup.py
@@ -38,6 +38,6 @@ setup(
author_email="ML-Agents@unity3d.com",
url="https://github.com/Unity-Technologies/ml-agents",
packages=find_packages(),
- install_requires=["gym==0.20.0", f"mlagents_envs=={VERSION}"],
+ install_requires=["gym==0.21.0", f"mlagents_envs=={VERSION}"],
cmdclass={"verify": VerifyVersionCommand},
) | upgrade gym to <I> (#<I>) | Unity-Technologies_ml-agents | train | py |
f59fbbce5503fc6b8d1e8514d48a57a4db10a936 | diff --git a/lib/travis/model/job/test.rb b/lib/travis/model/job/test.rb
index <HASH>..<HASH> 100644
--- a/lib/travis/model/job/test.rb
+++ b/lib/travis/model/job/test.rb
@@ -17,7 +17,7 @@ class Job
class << self
def append_log!(id, chars)
- job = find(id, :select => [:id, :repository_id, :source_id, :source_type, :state, :config]) # is this still needed? we introduced this as an optimization when the log was still on the jobs table
+ job = find(id)
job.append_log!(chars) unless job.finished?
end
end | no need to select a reduced set of fields any more | travis-ci_travis-core | train | rb |
98a618848cebd04ae3bf0e79c9fa25c3e7cde58f | diff --git a/src/main/java/org/asteriskjava/manager/internal/AbstractBuilder.java b/src/main/java/org/asteriskjava/manager/internal/AbstractBuilder.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/asteriskjava/manager/internal/AbstractBuilder.java
+++ b/src/main/java/org/asteriskjava/manager/internal/AbstractBuilder.java
@@ -54,15 +54,6 @@ abstract class AbstractBuilder
setterName = "clazz";
}
- /*
- * The class property needs to be renamed. It is used in
- * MusicOnHoldEvent.
- */
- if ("class".equals(setterName))
- {
- setterName = "classname";
- }
-
setter = setters.get(setterName);
if (setter == null && !setterName.endsWith("s")) // no exact match | Remove dead code from AbstractBuilder.setAttributes()
The lines above this already change 'class' -> 'clazz' so this block
can never be executed. | asterisk-java_asterisk-java | train | java |
03d4d91a6f71e7b359afafa927bb87309b82072a | diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php
index <HASH>..<HASH> 100644
--- a/src/DependencyInjection/Configuration.php
+++ b/src/DependencyInjection/Configuration.php
@@ -18,8 +18,9 @@ class Configuration implements ConfigurationInterface
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('ashley_dawson_glide');
-
- $rootNode = $treeBuilder->getRootNode();
+ $rootNode = \method_exists($treeBuilder, 'getRootNode')
+ ? $treeBuilder->getRootNode()
+ : $treeBuilder->root('ashley_dawson_glide');
$rootNode
->children() | Make treebuilder configuration backwards compatible with older Symfony versions | AshleyDawson_GlideBundle | train | php |
16038c5a12691d9c0a406c834a0bc18be051f109 | diff --git a/tests/test_mock_solver_loading.py b/tests/test_mock_solver_loading.py
index <HASH>..<HASH> 100644
--- a/tests/test_mock_solver_loading.py
+++ b/tests/test_mock_solver_loading.py
@@ -202,6 +202,8 @@ alpha|file-alpha-url,file-alpha-token,,alpha-solver
"""
+# patch the new config loading mechanism, to test only legacy config loading
+@mock.patch("dwave.cloud.config.detect_configfile_path", lambda: None)
class MockConfiguration(unittest.TestCase):
"""Ensure that the precedence of configuration sources is followed.""" | Fix legacy config loading tests
While testing legacy config loading, completely disable the new config
loading. | dwavesystems_dwave-cloud-client | train | py |
18191897d3f3bec76f48f990f21dc8f12cc89c67 | diff --git a/axes/decorators.py b/axes/decorators.py
index <HASH>..<HASH> 100644
--- a/axes/decorators.py
+++ b/axes/decorators.py
@@ -176,9 +176,13 @@ def get_user_attempts(request):
if COOLOFF_TIME:
for attempt in attempts:
- if attempt.attempt_time + COOLOFF_TIME < datetime.now() \
- and attempt.trusted is False:
- attempt.delete()
+ if attempt.attempt_time + COOLOFF_TIME < datetime.now():
+ if attempt.trusted:
+ attempt.failures_since_start = 0
+ attempt.save()
+ else:
+ attempt.delete()
+ objects_deleted = True
return attempts | When the cooloff period has expired if the user is trusted: reset the
failure counter otherwise obliterate the user. | jazzband_django-axes | train | py |
d02c427a76d5d8ef2f099bae79b7af69be3f643a | diff --git a/request.go b/request.go
index <HASH>..<HASH> 100644
--- a/request.go
+++ b/request.go
@@ -52,6 +52,7 @@ func (a *Request) GetRequestedScopes() Arguments {
}
func (a *Request) SetRequestedScopes(s Arguments) {
+ a.Scopes = nil
for _, scope := range s {
a.AppendRequestedScope(scope)
} | request: fix SetRequestedScopes (#<I>) | ory_fosite | train | go |
449f009b39e961856d49069a07e56902f439efd8 | diff --git a/lib/Minify/HTML.php b/lib/Minify/HTML.php
index <HASH>..<HASH> 100644
--- a/lib/Minify/HTML.php
+++ b/lib/Minify/HTML.php
@@ -135,7 +135,7 @@ class Minify_HTML
.'|canvas|caption|center|col(?:group)?|dd|dir|div|dl|dt|fieldset|figcaption|figure|footer|form'
.'|frame(?:set)?|h[1-6]|head|header|hgroup|hr|html|legend|li|link|main|map|menu|meta|nav'
.'|ol|opt(?:group|ion)|output|p|param|section|t(?:able|body|head|d|h||r|foot|itle)'
- .'|ul|video)\\b[^>]*>)/i', '$1', $this->_html);
+ .'|ul|video)\\b[^>]*>)/iu', '$1', $this->_html);
// remove ws outside of all elements
$this->_html = preg_replace( | Fix issue where minify() would corrupt Unicode characters (such as ) in some environments
Adding the `u` flag there fixes an issue in my environment (MAMP <I> with PHP <I>) where `minify()` would corrupt the ` ` character (it would get replaced by the replacement character). | mrclay_minify | train | php |
7a6c2e04a996803e174ce9a74dac3c7cd0b17b3d | diff --git a/avatar/views.py b/avatar/views.py
index <HASH>..<HASH> 100644
--- a/avatar/views.py
+++ b/avatar/views.py
@@ -50,17 +50,20 @@ def _notification_updated(request, avatar):
def _get_avatars(user):
# Default set. Needs to be sliced, but that's it. Keep the natural order.
- avatars = user.avatar_set.all()
+ avatars = user.avatar_set.all()
# Current avatar
- avatar = avatars.filter(primary=True)[:1]
- if avatar:
- avatar = avatar[0]
+ primary_avatar = avatars.order_by('-primary')[:1]
+ if primary_avatar:
+ avatar = primary_avatar[0]
else:
avatar = None
- # Slice the default set now that we used the queryset for the primary avatar
- avatars = avatars[:AVATAR_MAX_AVATARS_PER_USER]
+ if AVATAR_MAX_AVATARS_PER_USER == 1:
+ avatars = primary_avatar
+ else:
+ # Slice the default set now that we used the queryset for the primary avatar
+ avatars = avatars[:AVATAR_MAX_AVATARS_PER_USER]
return (avatar, avatars)
def add(request, extra_context={}, next_override=None): | This method is more closer to the original and should be more robust even if you change the max number of avatars | GeoNode_geonode-avatar | train | py |
eb862dbc97454c8d6f4290bf493ceb16d2ce561a | diff --git a/lib/billy/proxy.rb b/lib/billy/proxy.rb
index <HASH>..<HASH> 100644
--- a/lib/billy/proxy.rb
+++ b/lib/billy/proxy.rb
@@ -70,7 +70,7 @@ module Billy
EM.run do
EM.error_handler do |e|
Billy.log :error, "#{e.class} (#{e.message}):"
- Billy.log :error, e.backtrace.join("\n")
+ Billy.log :error, e.backtrace.join("\n") unless e.backtrace.nil?
end
@signature = EM.start_server(host, Billy.config.proxy_port, ProxyConnection) do |p| | Don't print backtrace when it's not available
Causing an exception in EM error handler terminates
thread, what in turns makes subsequent specs fail | oesmith_puffing-billy | train | rb |
3ed9438a004eae5abda923c5209bd2e8667f9d3f | diff --git a/app/models/organization.rb b/app/models/organization.rb
index <HASH>..<HASH> 100644
--- a/app/models/organization.rb
+++ b/app/models/organization.rb
@@ -48,7 +48,9 @@ class Organization < ApplicationRecord
has_many :ip_pool_rules, :dependent => :destroy, :as => :owner
after_create do
- self.ip_pools << IPPool.transactional.default
+ if pool = IPPool.transactional.default
+ self.ip_pools << IPPool.transactional.default
+ end
end
def status
diff --git a/db/seeds.rb b/db/seeds.rb
index <HASH>..<HASH> 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -3,4 +3,4 @@ user = User.create!(:first_name => "Example", :last_name => "Admin", :email_addr
org = Organization.create!(:name => "Acme Inc", :permalink => "acme", :time_zone => "London", :owner => user)
org.users << user
-server = Server.create!(:ip_pool => ip_pool, :organization => org, :name => "Example Server", :permalink => "example", :mode => "Live")
+server = Server.create!(:organization => org, :name => "Example Server", :permalink => "example", :mode => "Live") | fixes issue with creating new organizations when there are no ip pools | atech_postal | train | rb,rb |
34290ceba7e6bdae73f41a80734d82ae785eea6d | diff --git a/lib/comfortable_mexican_sofa/seeds/page.rb b/lib/comfortable_mexican_sofa/seeds/page.rb
index <HASH>..<HASH> 100644
--- a/lib/comfortable_mexican_sofa/seeds/page.rb
+++ b/lib/comfortable_mexican_sofa/seeds/page.rb
@@ -170,7 +170,6 @@ module ComfortableMexicanSofa::Seeds::Page
attrs = {
"label" => page.label,
"layout" => page.layout.try(:identifier),
- "parent" => page.parent && (page.parent.slug.present?? page.parent.slug : 'index'),
"target_page" => page.target_page.try(:full_path),
"categories" => page.categories.map{|c| c.label},
"is_published" => page.is_published,
diff --git a/test/lib/seeds/pages_test.rb b/test/lib/seeds/pages_test.rb
index <HASH>..<HASH> 100644
--- a/test/lib/seeds/pages_test.rb
+++ b/test/lib/seeds/pages_test.rb
@@ -156,7 +156,6 @@ class SeedsPagesTest < ActiveSupport::TestCase
---
label: Default Page
layout: default
- parent:\s
target_page: "/child-page"
categories:
- Default
@@ -181,7 +180,6 @@ class SeedsPagesTest < ActiveSupport::TestCase
---
label: Child Page
layout: default
- parent: index
target_page:\s
categories: []
is_published: true | we dont export page parent data. thats folders | comfy_comfortable-mexican-sofa | train | rb,rb |
7aa06ce3657f11ed14868a320989c5aca637d5a2 | diff --git a/app/models/foreman_tasks/recurring_logic.rb b/app/models/foreman_tasks/recurring_logic.rb
index <HASH>..<HASH> 100644
--- a/app/models/foreman_tasks/recurring_logic.rb
+++ b/app/models/foreman_tasks/recurring_logic.rb
@@ -31,12 +31,12 @@ module ForemanTasks
if value
task.update!(:start_at => next_occurrence_time) if task.start_at < Time.zone.now
update(:state => 'active')
- else
- update(:state => 'disabled')
end
- else
+ elsif value
raise RecurringLogicCancelledException
end
+
+ update(:state => 'disabled') unless value
end
def enabled?
diff --git a/test/unit/recurring_logic_test.rb b/test/unit/recurring_logic_test.rb
index <HASH>..<HASH> 100644
--- a/test/unit/recurring_logic_test.rb
+++ b/test/unit/recurring_logic_test.rb
@@ -148,6 +148,12 @@ class RecurringLogicsTest < ActiveSupport::TestCase
assert ForemanTasks.dynflow.world.persistence.load_delayed_plan(task.execution_plan.id).frozen
end
+ it 'handles if the task has been deleted' do
+ logic.tasks.find_by(:state => 'scheduled').destroy
+ logic.update!(:enabled => false)
+ assert_equal 'disabled', logic.state
+ end
+
it 'properly re-enables on disable' do
logic.update!(:enabled => false)
logic.update!(:enabled => true) | Fixes #<I> - fix disable on rec logic with deleted task | theforeman_foreman-tasks | train | rb,rb |
d5005ba9d804f2d19a7f747d4f917a9797dc90cb | diff --git a/test/resharding.py b/test/resharding.py
index <HASH>..<HASH> 100755
--- a/test/resharding.py
+++ b/test/resharding.py
@@ -561,6 +561,13 @@ primary key (name)
# check the binlog players are running and exporting vars
self.check_destination_master(shard_2_master, ['test_keyspace/80-'])
self.check_destination_master(shard_3_master, ['test_keyspace/80-'])
+ # When the binlog players/filtered replication is turned on, the query
+ # service must be turned off on the destination masters.
+ # The tested behavior is a safeguard to prevent that somebody can
+ # accidentally modify data on the destination masters while they are not
+ # migrated yet and the source shards are still the source of truth.
+ shard_2_master.wait_for_vttablet_state('NOT_SERVING')
+ shard_3_master.wait_for_vttablet_state('NOT_SERVING')
# check that binlog server exported the stats vars
self.check_binlog_server_vars(shard_1_slave1, horizontal=True) | test/resharding.py: Add check that query service is turned off after filtered replication was turned on.
The tested behavior is a safeguard to prevent that somebody can accidentally modify data on the destination masters while they are not migrated yet and the source shards are still the source of truth. | vitessio_vitess | train | py |
1f59af800b0b394c7299e3027b892da0aab4f532 | diff --git a/tests/contrib/openstack/test_neutron_utils.py b/tests/contrib/openstack/test_neutron_utils.py
index <HASH>..<HASH> 100644
--- a/tests/contrib/openstack/test_neutron_utils.py
+++ b/tests/contrib/openstack/test_neutron_utils.py
@@ -86,6 +86,7 @@ class NeutronTests(unittest.TestCase):
'neutron.plugins.midonet.plugin.MidonetPluginV2')
self.os_release.return_value = 'liberty'
+ self.config.return_value = 'mem-1.9'
plugins = neutron.neutron_plugins()
self.assertEquals(plugins['midonet']['driver'],
'midonet.neutron.plugin_v1.MidonetPluginV2') | fix lack of midonet-origin for liberty specific behavior | juju_charm-helpers | train | py |
8b33e1f5aa38b7bc2f805f80403aa0be52991bec | diff --git a/tensorflow_datasets/video/moving_mnist.py b/tensorflow_datasets/video/moving_mnist.py
index <HASH>..<HASH> 100644
--- a/tensorflow_datasets/video/moving_mnist.py
+++ b/tensorflow_datasets/video/moving_mnist.py
@@ -82,7 +82,6 @@ class MovingMnist(tfds.core.GeneratorBasedBuilder):
return [
tfds.core.SplitGenerator(
name=tfds.Split.TEST,
- num_shards=5,
gen_kwargs=dict(data_path=data_path)),
]
@@ -99,5 +98,5 @@ class MovingMnist(tfds.core.GeneratorBasedBuilder):
images = np.load(fp)
images = np.transpose(images, (1, 0, 2, 3))
images = np.expand_dims(images, axis=-1)
- for sequence in images:
- yield dict(image_sequence=sequence)
+ for i, sequence in enumerate(images):
+ yield i, dict(image_sequence=sequence) | Fixing moving-mnist that was broken after S3 migration.
PiperOrigin-RevId: <I> | tensorflow_datasets | train | py |
6d99fe0245d6f42127b8f1fa871019e6b389c76c | diff --git a/salt/cloud/__init__.py b/salt/cloud/__init__.py
index <HASH>..<HASH> 100644
--- a/salt/cloud/__init__.py
+++ b/salt/cloud/__init__.py
@@ -231,7 +231,7 @@ class CloudClient(object):
if a.get('provider', '')]
if providers:
_providers = opts.get('providers', {})
- for provider in _providers:
+ for provider in list(_providers):
if provider not in providers:
_providers.pop(provider)
return opts | use list on providers
This is needed because we are modifying the size of the dictionary
inside the loop. | saltstack_salt | train | py |
d23809fc7940c80ae9765124adc9ef4c9110313c | diff --git a/packages/aws-lambda-create-request-response/src/index.js b/packages/aws-lambda-create-request-response/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/aws-lambda-create-request-response/src/index.js
+++ b/packages/aws-lambda-create-request-response/src/index.js
@@ -4,9 +4,10 @@ const Stream = require('stream')
const queryString = require('querystring')
module.exports = (event, callback) => {
+ const base64Support = process.env.BINARY_SUPPORT !== 'no'
const response = {
body: Buffer.from(''),
- isBase64Encoded: true,
+ isBase64Encoded: base64Support,
statusCode: 200,
headers: {}
}
@@ -61,7 +62,9 @@ module.exports = (event, callback) => {
}
res.end = text => {
if (text) res.write(text)
- response.body = Buffer.from(response.body).toString('base64')
+ response.body = Buffer.from(response.body).toString(
+ base64Support ? 'base64' : undefined
+ )
response.headers = res.headers || {}
callback(null, response)
} | added binary support config process.env.BINARY_SUPPORT | JamesKyburz_aws-lambda-http-server | train | js |
f444e6abb8278de3654a767a0a4130898fc3cb85 | diff --git a/src/org/opencms/i18n/A_CmsMessageBundle.java b/src/org/opencms/i18n/A_CmsMessageBundle.java
index <HASH>..<HASH> 100644
--- a/src/org/opencms/i18n/A_CmsMessageBundle.java
+++ b/src/org/opencms/i18n/A_CmsMessageBundle.java
@@ -1,7 +1,7 @@
/*
* File : $Source: /alkacon/cvs/opencms/src/org/opencms/i18n/A_CmsMessageBundle.java,v $
- * Date : $Date: 2005/05/02 15:13:40 $
- * Version: $Revision: 1.16 $
+ * Date : $Date: 2005/05/03 13:02:44 $
+ * Version: $Revision: 1.17 $
*
* This library is part of OpenCms -
* the Open Source Content Mananagement System
@@ -54,6 +54,7 @@ public abstract class A_CmsMessageBundle implements I_CmsMessageBundle {
org.opencms.file.collectors.Messages.get(),
org.opencms.flex.Messages.get(),
org.opencms.importexport.Messages.get(),
+ org.opencms.jsp.Messages.get(),
org.opencms.loader.Messages.get(),
org.opencms.lock.Messages.get(),
org.opencms.mail.Messages.get(), | Added org.opencms.jsp.messages bundle test. | alkacon_opencms-core | train | java |
a2a96f1a9718fffc2101467112919157a0082170 | diff --git a/opf.py b/opf.py
index <HASH>..<HASH> 100644
--- a/opf.py
+++ b/opf.py
@@ -2,11 +2,17 @@ import os
import os.path
import utils
import dublincore
+from xml.dom.minidom import getDOMImplementation
+
+class contentOPF(object):
+ '''A class to represent the OPF document.'''
+
+ def __init__(self):
+ pass
def generateOPF(article, dirname):
'''Creates the content.opf document from an Article instance issued as
input'''
- from xml.dom.minidom import getDOMImplementation
#Initiate a DOMImplementation for the OPF
impl = getDOMImplementation() | Beginnings of new contentOPF class | SavinaRoja_OpenAccess_EPUB | train | py |
84fd62e59986b83c9122700cbfbf6d8d546870a9 | diff --git a/js/okcoinusd.js b/js/okcoinusd.js
index <HASH>..<HASH> 100644
--- a/js/okcoinusd.js
+++ b/js/okcoinusd.js
@@ -282,8 +282,10 @@ module.exports = class okcoinusd extends Exchange {
let tickers_result = {};
for (let i = 0; i < tickers.length; i++) {
let market = undefined;
- if (('symbol' in tickers[i]) && (tickers[i]['symbol'] in this.markets_by_id)) {
- market = this.markets_by_id[tickers[i]['symbol']];
+ if ('symbol' in tickers[i]) {
+ if (tickers[i]['symbol'] in this.markets_by_id) {
+ market = this.markets_by_id[tickers[i]['symbol']];
+ }
}
let ticker = this.extend (tickers[i], { 'timestamp': timestamp });
tickers_result[market['symbol']] = this.parseTicker (ticker, market); | yet another attempt to fix PHP transpile
separated if (A && B) into if(A) if(B) | ccxt_ccxt | train | js |
045ece0e2d3e6b8e9abe62d82a53f4c15def7444 | diff --git a/src/Blueprint.php b/src/Blueprint.php
index <HASH>..<HASH> 100644
--- a/src/Blueprint.php
+++ b/src/Blueprint.php
@@ -2,11 +2,12 @@
namespace Rougin\Blueprint;
-use Auryn\InjectionException;
use Auryn\Injector;
-use Symfony\Component\Console\Application;
+use ReflectionClass;
use Twig_Environment;
use Twig_Loader_Filesystem;
+use Auryn\InjectionException;
+use Symfony\Component\Console\Application;
/**
* Blueprint
@@ -122,12 +123,16 @@ class Blueprint
substr($file, $commandPath)
);
+ $className = $this->paths['namespace'] . '\\' . $className;
+
try {
- $command = $this->injector->make(
- $this->paths['namespace'] . '\\' . $className
- );
+ $reflection = new ReflectionClass($className);
+
+ if ( ! $reflection->isAbstract()) {
+ $command = $this->injector->make($className);
- $this->console->add($command);
+ $this->console->add($command);
+ }
} catch (InjectionException $exception) {
echo $exception->getMessage() . PHP_EOL; | Fixed issue if class is abstract in Blueprint.php | rougin_blueprint | train | php |
50783b941af3f5761f664b14cbe32f10cd24f31d | diff --git a/certinfo/certinfo.go b/certinfo/certinfo.go
index <HASH>..<HASH> 100644
--- a/certinfo/certinfo.go
+++ b/certinfo/certinfo.go
@@ -100,7 +100,7 @@ func ParseCertificatePEM(certPEM []byte) (*Certificate, error) {
return ParseCertificate(cert), nil
}
-// Uses the helper to parse an x509 CSR PEM.
+// ParseCSRPEM uses the helper to parse an x509 CSR PEM.
func ParseCSRPEM(csrPEM []byte) (*x509.CertificateRequest, error) {
csrObject, err := helpers.ParseCSRPEM(csrPEM)
if err != nil {
@@ -110,7 +110,7 @@ func ParseCSRPEM(csrPEM []byte) (*x509.CertificateRequest, error) {
return csrObject, nil
}
-// Uses the helper to parse an x509 CSR PEM file.
+// ParseCSRFile uses the helper to parse an x509 CSR PEM file.
func ParseCSRFile(csrFile string) (*x509.CertificateRequest, error) {
csrPEM, err := ioutil.ReadFile(csrFile)
if err != nil { | Correct comments to be godoc-compliant. | cloudflare_cfssl | train | go |
35a2dbcabb1e50c04bafcf19832aaaba4a0eb7ee | diff --git a/healthcheck/healthcheck.go b/healthcheck/healthcheck.go
index <HASH>..<HASH> 100644
--- a/healthcheck/healthcheck.go
+++ b/healthcheck/healthcheck.go
@@ -215,7 +215,7 @@ func (o *Observation) retryCheck(quit chan struct{}, shutdown shutdownFunc) {
return
}
- log.Debugf("Health check: %v, call: %v failed with: %v, "+
+ log.Infof("Health check: %v, call: %v failed with: %v, "+
"backing off for: %v", o, count, err, o.Backoff)
// If we are still within the number of calls allowed for this | healthcheck: bump logging for failed healthchecks to info
In this commit, we bump up the logging for failed healthchecks from
`debug` to `info`. This should help us get to the bottom of the current
set of reported false positives that are causing `lnd` nodes to
erroneously shutdown. | lightningnetwork_lnd | train | go |
3e02a38a9ae52603f620a7969ce532b61de531d7 | diff --git a/libgreader/__init__.py b/libgreader/__init__.py
index <HASH>..<HASH> 100644
--- a/libgreader/__init__.py
+++ b/libgreader/__init__.py
@@ -8,7 +8,13 @@ __author__ = "Matt Behrens <askedrelic@gmail.com>"
__version__ = "0.8.0"
__copyright__ = "Copyright (C) 2012 Matt Behrens"
-from .googlereader import GoogleReader
-from .auth import AuthenticationMethod, ClientAuthMethod, OAuthMethod, OAuth2Method
-from .items import *
-from .url import ReaderUrl
+try:
+ import requests
+except ImportError:
+ # Will occur during setup.py install
+ pass
+else:
+ from .googlereader import GoogleReader
+ from .auth import AuthenticationMethod, ClientAuthMethod, OAuthMethod, OAuth2Method
+ from .items import *
+ from .url import ReaderUrl | Fix import error during setup.py install | askedrelic_libgreader | train | py |
a48dfb7dc1baffb8d0501fad704b605a2b6c85d8 | diff --git a/lib/editor.js b/lib/editor.js
index <HASH>..<HASH> 100644
--- a/lib/editor.js
+++ b/lib/editor.js
@@ -394,6 +394,7 @@ Editor.prototype._initHandlers = function () {
var self = this;
self.on('keypress', function (ch, key) {
+ if (key.name !== 'mouse') { self.data.mouseDown = false; }
var selection = self.select();
var binding = util.getBinding(self.options.bindings, key); | Keypresses disable mouse bugfix | slap-editor_slap | train | js |
85377a37bb31a3e03816f886754d570e83f3b918 | diff --git a/src/core/utils_old.py b/src/core/utils_old.py
index <HASH>..<HASH> 100644
--- a/src/core/utils_old.py
+++ b/src/core/utils_old.py
@@ -843,7 +843,7 @@ from src.widgets.matplotlibwidget import MatplotlibWidget
def test():
import sys
- from PyQt4.QtGui import QMainWindow, QApplication
+ from src.qt.QtGui import QMainWindow, QApplication
class ApplicationWindow(QMainWindow):
def __init__(self):
diff --git a/src/parametres/paramData.py b/src/parametres/paramData.py
index <HASH>..<HASH> 100644
--- a/src/parametres/paramData.py
+++ b/src/parametres/paramData.py
@@ -23,11 +23,11 @@ This file is part of openFisca.
from xml.etree.ElementTree import ElementTree, SubElement, Element
from xml.dom import minidom
-from src.core.utils_old import Bareme
-from datetime import datetime
+from src.qt.compat import from_qvariant
from src.core.config import CONF
+from datetime import datetime
-from src.qt.compat import from_qvariant
+from src.core.utils_old import Bareme
class Tree2Object(object): | Strange bug solved by inversing imports in paramData | openfisca_openfisca-core | train | py,py |
7eaae256bbd3c193c21fbd2e840ab8300860afa4 | diff --git a/cdm/src/test/java/thredds/crawlabledataset/TestAllCrawlableDataset.java b/cdm/src/test/java/thredds/crawlabledataset/TestAllCrawlableDataset.java
index <HASH>..<HASH> 100644
--- a/cdm/src/test/java/thredds/crawlabledataset/TestAllCrawlableDataset.java
+++ b/cdm/src/test/java/thredds/crawlabledataset/TestAllCrawlableDataset.java
@@ -26,6 +26,7 @@ public class TestAllCrawlableDataset extends TestCase
suite.addTestSuite( thredds.crawlabledataset.TestCrawlableDatasetFilter.class );
suite.addTestSuite( thredds.crawlabledataset.filter.TestRegExpMatchOnNameFilter.class );
suite.addTestSuite( thredds.crawlabledataset.filter.TestWildcardMatchOnNameFilter.class );
+ suite.addTestSuite( thredds.crawlabledataset.filter.TestLogicalCompFilterFactory.class );
return suite;
} | More work on logical composition of filters. | Unidata_thredds | train | java |
acac31dd1823ed21bb0a629a8f09088e547f1d02 | diff --git a/lib/hirb/helpers/table.rb b/lib/hirb/helpers/table.rb
index <HASH>..<HASH> 100644
--- a/lib/hirb/helpers/table.rb
+++ b/lib/hirb/helpers/table.rb
@@ -147,7 +147,8 @@ module Hirb
end
rows = filter_values(rows)
rows.each_with_index {|e,i| e[:hirb_number] = (i + 1).to_s} if @options[:number]
- methods.grep(/_callback$/).sort.each do |meth|
+ deleted_callbacks = Array(@options[:delete_callbacks]).map {|e| "#{e}_callback" }
+ (methods.grep(/_callback$/) - deleted_callbacks).sort.each do |meth|
rows = send(meth, rows, @options.dup)
end
validate_values(rows) | delete callbacks option for boson | cldwalker_hirb | train | rb |
e9636a10310b2ab81671ba107e81b4c278e50a82 | diff --git a/lib/adminable/resource.rb b/lib/adminable/resource.rb
index <HASH>..<HASH> 100644
--- a/lib/adminable/resource.rb
+++ b/lib/adminable/resource.rb
@@ -1,5 +1,7 @@
module Adminable
class Resource
+ include Comparable
+
attr_reader :name, :model, :attributes
# @param name [String] resource name, usually same as the model name
@@ -27,8 +29,8 @@ module Adminable
@attributes ||= Adminable::Attributes::Collection.new(@model)
end
- def ==(other)
- other.is_a?(Adminable::Resource) && name == other.name
+ def <=>(other)
+ other.is_a?(Adminable::Resource) && name <=> other.name
end
end
end | Replace resource == method with <=> and Comparable module | droptheplot_adminable | train | rb |
6b0fffe17a9f6f0db5e2928879a75bdd9546d2de | diff --git a/v1/tsdb/config.go b/v1/tsdb/config.go
index <HASH>..<HASH> 100644
--- a/v1/tsdb/config.go
+++ b/v1/tsdb/config.go
@@ -14,7 +14,7 @@ const (
DefaultEngine = "tsm1"
// DefaultIndex is the default index for new shards
- DefaultIndex = InmemIndexName
+ DefaultIndex = TSI1IndexName
// tsdb/engine/wal configuration options | fix: Default to TSI1 index for new shards | influxdata_influxdb | train | go |
5c89f0648fdc8ac05ed84c5d5db8be53653bd0f1 | diff --git a/src/Session/Timer.php b/src/Session/Timer.php
index <HASH>..<HASH> 100644
--- a/src/Session/Timer.php
+++ b/src/Session/Timer.php
@@ -94,7 +94,7 @@ class Timer
public function setIdleTtl($idle_ttl)
{
if ($this->ini_gc_maxlifetime < $idle_ttl) {
- throw new Exception('session.gc_maxlifetime less than idle time');
+ throw new Exception("session.gc_maxlifetime $this->ini_gc_maxlifetime less than idle time $idle_ttl");
}
$this->idle_ttl = $idle_ttl;
} | Impoved Exception message string.
This message helps pinpoint the problem and localize it as to its cause. | auraphp_Aura.Auth | train | php |
d200ca6d31ee92b4bc835ff3907e2b32efbc7add | diff --git a/tests/test_init.py b/tests/test_init.py
index <HASH>..<HASH> 100644
--- a/tests/test_init.py
+++ b/tests/test_init.py
@@ -126,6 +126,9 @@ class InitTests(unittest.TestCase):
else:
modname = '%s.%s' % (module.__name__, modname)
+ if sys.version_info < (3,) and sys.platform == 'win32' and b'\r\n' in full_code:
+ full_code = full_code.replace(b'\r\n', b'\n')
+
imports = set([])
module_node = ast.parse(full_code, filename=full_path)
walk_ast(module_node, modname, imports) | Handle test environments on Windows with Python 2.x using git autocrlf | wbond_oscrypto | train | py |
8d5e903a29b8c168afc41051c142734ed4b9f306 | diff --git a/blockstore/lib/operations/nameimport.py b/blockstore/lib/operations/nameimport.py
index <HASH>..<HASH> 100644
--- a/blockstore/lib/operations/nameimport.py
+++ b/blockstore/lib/operations/nameimport.py
@@ -128,8 +128,11 @@ def make_outputs( data, inputs, recipient_address, sender_address, update_hash_b
]
-def broadcast(name, recipient_address, update_hash, private_key, blockchain_client, testset=False):
+def broadcast(name, recipient_address, update_hash, private_key, blockchain_client, blockchain_broadcaster=None, testset=False):
+ if blockchain_broadcaster is None:
+ blockchain_broadcaster = blockchain_client
+
nulldata = build(name, testset=testset)
# get inputs and from address
@@ -142,7 +145,7 @@ def broadcast(name, recipient_address, update_hash, private_key, blockchain_clie
outputs = make_outputs(nulldata, inputs, recipient_address, from_address, update_hash_b58, format='hex')
# serialize, sign, and broadcast the tx
- response = serialize_sign_and_broadcast(inputs, outputs, private_key_obj, blockchain_client)
+ response = serialize_sign_and_broadcast(inputs, outputs, private_key_obj, blockchain_broadcaster)
# response = {'success': True }
response.update({'data': nulldata}) | TEST: Separate broadcaster from utxo provider for imports | blockstack_blockstack-core | train | py |
d0a07fb32811c649185ee99d71373cc7cab8791e | diff --git a/allennlp/modules/elmo.py b/allennlp/modules/elmo.py
index <HASH>..<HASH> 100644
--- a/allennlp/modules/elmo.py
+++ b/allennlp/modules/elmo.py
@@ -440,7 +440,7 @@ class _ElmoCharacterEncoder(torch.nn.Module):
# create the layers, and load the weights
self._highways = Highway(n_filters, n_highway, activation=torch.nn.functional.relu)
for k in range(n_highway):
- # The AllenNLP highway is one matrix multplication with concatenation of
+ # The AllenNLP highway is one matrix multiplication with concatenation of
# transform and carry weights.
with h5py.File(cached_path(self._weight_file), "r") as fin:
# The weights are transposed due to multiplication order assumptions in tf | docs: fix simple typo, multplication -> multiplication (#<I>)
There is a small typo in allennlp/modules/elmo.py.
Should read `multiplication` rather than `multplication`. | allenai_allennlp | train | py |
6e0e4eef4202d6f02a4883b249199953b874af7f | diff --git a/test/unit/helpers/builders.js b/test/unit/helpers/builders.js
index <HASH>..<HASH> 100644
--- a/test/unit/helpers/builders.js
+++ b/test/unit/helpers/builders.js
@@ -35,6 +35,25 @@ export function buildField(textFieldClass, options) {
}
}
+ // This is necessary because of a Chrome "feature" where it won't do any focusing
+ // or blurring if the browser window not in focus itself. Otherwise running Karma
+ // testing in the background is impossible.
+ if (field) {
+ let hasFocus = false;
+
+ field.hasFocus = () => hasFocus;
+
+ field.element.focus = function () {
+ hasFocus = true;
+ field.element.dispatchEvent(new UIEvent('focus'));
+ }
+
+ field.element.blur = function () {
+ hasFocus = false;
+ field.element.dispatchEvent(new UIEvent('blur'));
+ }
+ }
+
return field;
} | Fixes focus/blur issues with Chrome. | square_field-kit | train | js |
cd25740884eb0aa62e5cf81af1dd52d1cb1f9d28 | diff --git a/tests/unit/utf8Test.php b/tests/unit/utf8Test.php
index <HASH>..<HASH> 100644
--- a/tests/unit/utf8Test.php
+++ b/tests/unit/utf8Test.php
@@ -1428,7 +1428,7 @@ class Unit_utf8Test extends OxidTestCase
{
$sValue = 'agentūЛитовfür';
- $aFields = array( 'oxuser__oxusername', 'oxuser__oxpassword',
+ $aFields = array( 'oxuser__oxusername',
'oxuser__oxustid', 'oxuser__oxcompany', 'oxuser__oxfname',
'oxuser__oxlname', 'oxuser__oxstreet', 'oxuser__oxstreetnr',
'oxuser__oxaddinfo', 'oxuser__oxcity', 'oxuser__oxzip', | <I>: Login doesn't work with Mysql <I> and iUtfMode=1 unified default collation with salt field | OXID-eSales_oxideshop_ce | train | php |
9a6b3bd20102f1fabea6405d5e0220d330279f87 | diff --git a/ontrack-extension-github/src/main/resources/static/extension/github/module.js b/ontrack-extension-github/src/main/resources/static/extension/github/module.js
index <HASH>..<HASH> 100644
--- a/ontrack-extension-github/src/main/resources/static/extension/github/module.js
+++ b/ontrack-extension-github/src/main/resources/static/extension/github/module.js
@@ -105,11 +105,12 @@ angular.module('ontrack.extension.github', [
$scope.toggleAutoReload = () => {
$scope.autoReload = !$scope.autoReload;
if ($scope.autoReload) {
+ localStorage.setItem(autoReloadKey, $scope.autoReload);
registerReload();
} else {
+ localStorage.removeItem(autoReloadKey);
otTaskService.stop(taskName);
}
- localStorage.setItem(autoReloadKey, $scope.autoReload);
};
$scope.topPayloads = () => { | #<I> Persistence of the auto reload being disabled | nemerosa_ontrack | train | js |
635617973b702f08fe92b898ba9cd0a3eb2f6332 | diff --git a/libtmux/server.py b/libtmux/server.py
index <HASH>..<HASH> 100644
--- a/libtmux/server.py
+++ b/libtmux/server.py
@@ -264,7 +264,13 @@ class Server(TmuxRelationalObject, EnvironmentMixin):
# clear up empty dict
panes = [
- dict((k, v) for k, v in window.items() if v) for window in panes
+ dict(
+ (k, v) for k, v in window.items()
+ if v or
+ k == 'pane_current_path'
+ ) # preserve pane_current_path, in case it entered a new process
+ # where we may not get a cwd from.
+ for window in panes
]
if self._panes: | don't empty pane_current_path if new one is empty
sometimes even repeated polling for a new pane path over 1,
3, 5 seconds won't return anything in some instances.
In older cases, we'd remove the pane_current_path from the pane's
_info, now we'll keep the last non-empty result libtmux found until
a new one fills it. | tmux-python_libtmux | train | py |
79f170d6baef438681b7c30e873df84e3ba205a0 | diff --git a/Swat/SwatApplication.php b/Swat/SwatApplication.php
index <HASH>..<HASH> 100644
--- a/Swat/SwatApplication.php
+++ b/Swat/SwatApplication.php
@@ -1,7 +1,6 @@
<?php
require_once 'Swat/SwatObject.php';
-require_once 'Swat/SwatLayout.php';
require_once 'Swat/SwatApplicationModule.php';
/**
diff --git a/Swat/SwatPage.php b/Swat/SwatPage.php
index <HASH>..<HASH> 100644
--- a/Swat/SwatPage.php
+++ b/Swat/SwatPage.php
@@ -1,6 +1,7 @@
<?php
require_once 'Swat/SwatObject.php';
+require_once 'Swat/SwatLayout.php';
/**
* Base class for a page | Move require SwatLayout to page from application.
svn commit r<I> | silverorange_swat | train | php,php |
8a09aba0058c03bbb6799cbaea2d0a3d6711e32f | diff --git a/web/src/main/webapp/resources/js/jquery.arrayExpress-autocomplete-1.1.0.130305.js b/web/src/main/webapp/resources/js/jquery.arrayExpress-autocomplete-1.1.0.130305.js
index <HASH>..<HASH> 100644
--- a/web/src/main/webapp/resources/js/jquery.arrayExpress-autocomplete-1.1.0.130305.js
+++ b/web/src/main/webapp/resources/js/jquery.arrayExpress-autocomplete-1.1.0.130305.js
@@ -595,7 +595,7 @@ $.Autocompleter.defaults = {
if ("f" == data.data[1]) {
value = value + "<span class=\"ac_field\">Filter " + data.data[2] + "</span>";
} else if ("o" == data.data[1]) {
- value = value + "<span class=\"ac_efo\">EFO</span>";
+ //value = value + "<span class=\"ac_efo\">EFO</span>";
if (null != data.treeLevel) {
if (data.treeId) { | Removed EFO term from autocomplete suggestions | ebi-gene-expression-group_atlas | train | js |
f9ea37bf47907b314891bb4029dd7bc6aea80883 | diff --git a/includes/common/list-table-base.php b/includes/common/list-table-base.php
index <HASH>..<HASH> 100644
--- a/includes/common/list-table-base.php
+++ b/includes/common/list-table-base.php
@@ -162,6 +162,15 @@ class WP_Event_Calendar_List_Table extends WP_List_Table {
protected $item_end = '';
/**
+ * Number of days item is for
+ *
+ * @since 0.1.5
+ *
+ * @var bool
+ */
+ protected $item_days = '';
+
+ /**
* The main constructor method
*/
public function __construct( $args = array() ) {
@@ -595,6 +604,7 @@ class WP_Event_Calendar_List_Table extends WP_List_Table {
$this->item_all_day = (bool) get_post_meta( $post->ID, 'wp_event_calendar_all_day', true );
$this->item_start = get_post_meta( $post->ID, 'wp_event_calendar_date_time', true );
$this->item_end = get_post_meta( $post->ID, 'wp_event_calendar_end_date_time', true );
+ $this->item_days = intval( ( $this->item_end - $this->item_start ) / DAY_IN_SECONDS );
// Format start
if ( ! empty( $this->item_start ) ) { | Add support for item_days & multi-day row. | stuttter_wp-event-calendar | train | php |
050c8c8f9231c49172f4026b8780261a480a3d86 | diff --git a/authentise_services/model.py b/authentise_services/model.py
index <HASH>..<HASH> 100644
--- a/authentise_services/model.py
+++ b/authentise_services/model.py
@@ -18,7 +18,7 @@ class Model(object):
if path:
self.upload_model(path)
elif model_uri:
- self.get_model_status()
+ self._get_model_status()
else:
self.name = ""
self.model_uri = "" | fix a call to an old method | DoWhileGeek_authentise-services | train | py |
514da5b58b8247e41de30622d8a98a66e909e829 | diff --git a/cluster/manager.go b/cluster/manager.go
index <HASH>..<HASH> 100644
--- a/cluster/manager.go
+++ b/cluster/manager.go
@@ -392,8 +392,8 @@ func (c *ClusterManager) initNodeInCluster(
}
if nodeInitialized {
- dlog.Errorf(ErrNodeDecommissioned.Error())
- return ErrNodeDecommissioned
+ dlog.Errorf(ErrInitNodeNotFound.Error())
+ return ErrInitNodeNotFound
}
// Alert all listeners that we are a new node and we are initializing. | If node is initialized already, return appropriate error. | libopenstorage_openstorage | train | go |
9c225d0f19b19657b86a153f93562881048510b4 | diff --git a/lib/xpi.js b/lib/xpi.js
index <HASH>..<HASH> 100644
--- a/lib/xpi.js
+++ b/lib/xpi.js
@@ -22,7 +22,6 @@ function xpi (manifest, options) {
var cwd = process.cwd();
var xpiName = (manifest.name || "jetpack") + ".xpi";
var xpiPath = join(cwd, xpiName);
- var buildOptions = createBuildOptions(options);
return doFinalZip(cwd, xpiPath);
} | Remove extra createBuildOptions for now | mozilla-jetpack_jpm | train | js |
7aa150d95956fd265864e04c184abd5796c4eea9 | diff --git a/blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/RollupService.java b/blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/RollupService.java
index <HASH>..<HASH> 100644
--- a/blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/RollupService.java
+++ b/blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/RollupService.java
@@ -131,7 +131,7 @@ public class RollupService implements Runnable, RollupServiceMBean {
// NOTE: higher locatorFetchConcurrency means that the queue used in rollupReadExecutors needs to be correspondingly
// higher.
Configuration config = Configuration.getInstance();
- rollupDelayMillis = config.getLongProperty("rollupDelayMillis");
+ rollupDelayMillis = config.getLongProperty("ROLLUP_DELAY_MILLIS");
final int locatorFetchConcurrency = config.getIntegerProperty(CoreConfig.MAX_LOCATOR_FETCH_THREADS);
locatorFetchExecutors = new InstrumentedThreadPoolExecutor(
"LocatorFetchThreadPool", | fix refactor typo in property name. | rackerlabs_blueflood | train | java |
e7b7ad8fa0f081dfd5baac3252f775cc6db076e0 | diff --git a/blockstack/lib/nameset/virtualchain_hooks.py b/blockstack/lib/nameset/virtualchain_hooks.py
index <HASH>..<HASH> 100644
--- a/blockstack/lib/nameset/virtualchain_hooks.py
+++ b/blockstack/lib/nameset/virtualchain_hooks.py
@@ -175,6 +175,7 @@ def get_db_state( disposition=DISPOSITION_RO ):
log.error("FATAL: no such file or directory: %s" % lastblock_filename )
os.abort()
+ # verify that it is well-formed, if it exists
elif os.path.exists( lastblock_filename ):
try:
with open(lastblock_filename, "r") as f: | justify why we check lastblock when we open the db | blockstack_blockstack-core | train | py |
6f7a27c913f525419b11750d4123bac80fd06a67 | diff --git a/cellbase-mongodb/src/main/java/org/opencb/cellbase/mongodb/loader/MongoDBCellBaseLoader.java b/cellbase-mongodb/src/main/java/org/opencb/cellbase/mongodb/loader/MongoDBCellBaseLoader.java
index <HASH>..<HASH> 100644
--- a/cellbase-mongodb/src/main/java/org/opencb/cellbase/mongodb/loader/MongoDBCellBaseLoader.java
+++ b/cellbase-mongodb/src/main/java/org/opencb/cellbase/mongodb/loader/MongoDBCellBaseLoader.java
@@ -262,6 +262,8 @@ public class MongoDBCellBaseLoader extends CellBaseLoader {
protected boolean runCreateIndexProcess(Path indexFilePath) throws IOException, InterruptedException {
List<String> args = new ArrayList<>();
args.add("mongo");
+ args.add("--host");
+ args.add(cellBaseConfiguration.getDatabase().getHost());
if(cellBaseConfiguration.getDatabase().getUser() != null && !cellBaseConfiguration.getDatabase().getUser().equals("")) {
args.addAll(Arrays.asList(
"-u", cellBaseConfiguration.getDatabase().getUser(), | Load now reads database 'host' from configuration file | opencb_cellbase | train | java |
9f91b95b6613ac66d0d7642d19df620045864607 | diff --git a/import_export/widgets.py b/import_export/widgets.py
index <HASH>..<HASH> 100644
--- a/import_export/widgets.py
+++ b/import_export/widgets.py
@@ -295,7 +295,7 @@ class JSONWidget(Widget):
class ForeignKeyWidget(Widget):
"""
Widget for a ``ForeignKey`` field which looks up a related model using
- "natural keys" in both export an import.
+ "natural keys" in both export and import.
The lookup field defaults to using the primary key (``pk``) as lookup
criterion but can be customised to use any field on the related model. | Typo fix in widgets.py | django-import-export_django-import-export | train | py |
f44bad7c95ea7f809abe1212626e5650ef5bab68 | diff --git a/test/test_object_dispatch.py b/test/test_object_dispatch.py
index <HASH>..<HASH> 100644
--- a/test/test_object_dispatch.py
+++ b/test/test_object_dispatch.py
@@ -2,11 +2,31 @@
from __future__ import unicode_literals
-from sample import function # , Simple, CallableShallow, CallableDeep, CallableMixed
+from collections import deque
from web.dispatch.object import ObjectDispatch
+from sample import function # , Simple, CallableShallow, CallableDeep, CallableMixed
+
+
+# We pre-create these for the sake of convienence.
+# In ordinary usage frameworks should try to avoid excessive reinstantiation where possible.
+dispatch = ObjectDispatch()
+promiscuous = ObjectDispatch(protect=False)
+
+
+def path(path):
+ return deque(path.split('/')[1:])
+
+
-def test_foo():
- ObjectDispatch
- function
+class TestFunctionDispatch(object):
+ def test_root_path_resolves_to_function(self):
+ result = list(dispatch(None, function, path('/')))
+ assert len(result) == 1
+ assert result == [(None, function, True)]
+
+ def test_deep_path_resolves_to_function(self):
+ result = list(dispatch(None, function, path('/foo/bar/baz')))
+ assert len(result) == 1
+ assert result == [(None, function, True)] | Stub tests that actually test things. | marrow_web.dispatch.object | train | py |
4cb08688fc58967f03fc64664cb12068660328fc | diff --git a/src/main/java/eu/hansolo/tilesfx/skins/StockTileSkin.java b/src/main/java/eu/hansolo/tilesfx/skins/StockTileSkin.java
index <HASH>..<HASH> 100644
--- a/src/main/java/eu/hansolo/tilesfx/skins/StockTileSkin.java
+++ b/src/main/java/eu/hansolo/tilesfx/skins/StockTileSkin.java
@@ -417,10 +417,10 @@ public class StockTileSkin extends TileSkin {
handleCurrentValue(tile.getValue());
if (tile.getAveragingPeriod() < 500) {
- sparkLine.setStrokeWidth(size * 0.001);
+ sparkLine.setStrokeWidth(size * 0.005);
dot.setRadius(size * 0.014);
} else {
- sparkLine.setStrokeWidth(size * 0.005);
+ sparkLine.setStrokeWidth(size * 0.001);
dot.setRadius(size * 0.007);
} | Fixed minor problem related to linewidth in StockTileSkin | HanSolo_tilesfx | train | java |
61345bccedd42c570d4ad96ccdc9d99b65c03bf4 | diff --git a/config/routes.rb b/config/routes.rb
index <HASH>..<HASH> 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,7 +1,10 @@
ClientManager::Engine.routes.draw do
root to: 'users#index'
get 'login', to: 'sessions#login'
+ get 'logout', to: 'sessions#logout'
post 'login_attempt', to: 'sessions#login_attempt'
+ get 'change_password', to: 'passwords#change'
+ post 'change_password_attempt', to: 'passwords#change_password_attempt'
get 'clients', to: 'clients#index'
resources :users, only: [:index, :new, :create]
end | Add routes for password change and logging out | timigod_client_manager | train | rb |
18510395ff5049190756b447a58bbd2e4f9097d7 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@ sentence_end = readme_contents.find('.', parastart)
setup(
name='cluster',
- version='1.2.2',
+ version=open('cluster/version.txt').read().strip(),
author='Michel Albert',
author_email='michel@albert.lu',
url='https://github.com/exhuma/python-cluster', | Aligning version in setup.py with package version. | exhuma_python-cluster | train | py |
c1490eaf65d74023390c07e9c7f0a9a00b66042a | diff --git a/lib/stupidedi/config.rb b/lib/stupidedi/config.rb
index <HASH>..<HASH> 100644
--- a/lib/stupidedi/config.rb
+++ b/lib/stupidedi/config.rb
@@ -109,6 +109,7 @@ module Stupidedi
x.register("005010X220", "BE", "834") { Stupidedi::Guides::FiftyTen::X220::BE834 }
x.register("005010X221", "HP", "835") { Stupidedi::Guides::FiftyTen::X221::HP835 }
x.register("005010X222", "HC", "837") { Stupidedi::Guides::FiftyTen::X222::HC837P }
+ x.register("005010X223", "HC", "837") { Stupidedi::Guides::FiftyTen::X223::HC837I }
x.register("005010X231", "FA", "999") { Stupidedi::Guides::FiftyTen::X231::FA999 }
x.register("005010X220A1", "BE", "834") { Stupidedi::Guides::FiftyTen::X220A1::BE834 }
x.register("005010X221A1", "HP", "835") { Stupidedi::Guides::FiftyTen::X221A1::HP835 } | Add HC<I>I reference to Configuration.hippa constructor | irobayna_stupidedi | train | rb |
a549e73df91a7749f1c946318ff82795d6f230f7 | diff --git a/psamm/commands/tmfa.py b/psamm/commands/tmfa.py
index <HASH>..<HASH> 100644
--- a/psamm/commands/tmfa.py
+++ b/psamm/commands/tmfa.py
@@ -336,9 +336,7 @@ def make_tmfa_problem(mm_irreversible, solver):
solver: linear programming library to use.
"""
prob = solver.create_problem()
- prob.cplex.parameters.threads.set(1)
prob.integrality_tolerance.value = 0
- prob.cplex.parameters.emphasis.numerical.value = 1
v = prob.namespace(name='flux')
zi = prob.namespace(name='zi') | Removed obsolete solver settings in tmfa.py | zhanglab_psamm | train | py |
3bb7d6753daa519c656ffb3a89d01abf1084c1f5 | diff --git a/collector/suite_test.go b/collector/suite_test.go
index <HASH>..<HASH> 100644
--- a/collector/suite_test.go
+++ b/collector/suite_test.go
@@ -43,4 +43,5 @@ func (s *S) TearDownSuite(c *C) {
func (s *S) TearDownTest(c *C) {
_, err := db.Session.Apps().RemoveAll(nil)
c.Assert(err, IsNil)
+ s.provisioner.Reset()
} | collector/tests: Reset FakeProvisioner on TearDownTest | tsuru_tsuru | train | go |
582686fb02286627fc28ded6effac35a405838af | diff --git a/src/com/opencms/workplace/CmsXmlLanguageFileContent.java b/src/com/opencms/workplace/CmsXmlLanguageFileContent.java
index <HASH>..<HASH> 100644
--- a/src/com/opencms/workplace/CmsXmlLanguageFileContent.java
+++ b/src/com/opencms/workplace/CmsXmlLanguageFileContent.java
@@ -159,10 +159,9 @@ public class CmsXmlLanguageFileContent extends A_CmsXmlContent {
if(! file.getName().toLowerCase().endsWith(".txt") && file.getState() != I_CmsConstants.C_STATE_DELETED) {
try {
init(cms, file.getAbsolutePath());
- readIncludeFile(file.getAbsolutePath());
} catch(Exception exc) {
if(C_LOGGING && A_OpenCms.isLogging(C_OPENCMS_CRITICAL) ) {
- A_OpenCms.log(C_OPENCMS_CRITICAL, "[" + this.getClass().getName() + ".mergeLanguageFiles/3] Error merging language file: " + file.getAbsolutePath() + ", " + exc.toString() );
+ A_OpenCms.log(C_OPENCMS_CRITICAL, "[" + this.getClass().getName() + ".mergeLanguageFiles/3] Error merging language file: " + file.getAbsolutePath());
}
}
} | Removed unnecessary call of readIncludeFile that caused InstantiationExceptions. | alkacon_opencms-core | train | java |
dff89e192742a01e8230866e43b363b9b9d7ee9f | diff --git a/sixpack/sixpack-web.py b/sixpack/sixpack-web.py
index <HASH>..<HASH> 100644
--- a/sixpack/sixpack-web.py
+++ b/sixpack/sixpack-web.py
@@ -1,7 +1,7 @@
from flask import Flask, render_template, abort, request, url_for, redirect
from flask.ext.seasurf import SeaSurf
-import db
+from db import REDIS
from models import Experiment
from models import Alternative
@@ -12,7 +12,7 @@ csrf = SeaSurf(app)
# List of experiments
@app.route("/")
def hello():
- experiments = Experiment.all(db.REDIS)
+ experiments = Experiment.all(REDIS)
return render_template('dashboard.html', experiments=experiments)
@@ -87,7 +87,7 @@ def favicon():
def find_or_404(experiment_name):
try:
- return Experiment.find(experiment_name, db.REDIS)
+ return Experiment.find(experiment_name, REDIS)
except:
abort(404) | only need REDIS from db | sixpack_sixpack | train | py |
f156025c18362cd3263329dd57675f0914d99f28 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,10 +1,10 @@
+# -*- coding: utf-8 -*-
from distutils.core import setup
setup(
name='hepdata-converter',
version='0.1',
- install_requires=['pyyaml'],
- tests_requires=[],
+ requires=['pyyaml'],
packages=['hepdata_converter', 'hepdata_converter.parsers', 'hepdata_converter.writers', 'hepdata_converter.testsuite'],
url='',
license='', | Fixed setup.py, now works correctly | HEPData_hepdata-converter | train | py |
cae1758ed421df87ac1fb9c42576e92901ed5553 | diff --git a/DrdPlus/Tests/RollsOn/QualityAndSuccess/SimpleRollOnSuccessTest.php b/DrdPlus/Tests/RollsOn/QualityAndSuccess/SimpleRollOnSuccessTest.php
index <HASH>..<HASH> 100644
--- a/DrdPlus/Tests/RollsOn/QualityAndSuccess/SimpleRollOnSuccessTest.php
+++ b/DrdPlus/Tests/RollsOn/QualityAndSuccess/SimpleRollOnSuccessTest.php
@@ -57,7 +57,7 @@ class SimpleRollOnSuccessTest extends TestWithMockery
* @param $value
* @return \Mockery\MockInterface|Roll
*/
- private function createRoll($value)
+ protected function createRoll($value): Roll
{
$roll = $this->mockery(Roll::class);
$roll->shouldReceive('getValue') | An inner test method can be accessed by its descendants | drdplusinfo_drdplus-rolls-on | train | php |
3bfc0a047e3d6d2ba197226df5adb1cbd5367907 | diff --git a/troposphere/cloudwatch.py b/troposphere/cloudwatch.py
index <HASH>..<HASH> 100644
--- a/troposphere/cloudwatch.py
+++ b/troposphere/cloudwatch.py
@@ -108,3 +108,29 @@ class Dashboard(AWSObject):
if name in self.properties:
dashboard_body = self.properties.get(name)
self.properties[name] = json_checker(dashboard_body)
+
+
+class Range(AWSProperty):
+ props = {
+ 'EndTime': (basestring, True),
+ 'StartTime': (basestring, True),
+ }
+
+
+class Configuration(AWSProperty):
+ props = {
+ 'ExcludedTimeRanges': ([Range], False),
+ 'MetricTimeZone': (basestring, False),
+ }
+
+
+class AnomalyDetector(AWSObject):
+ resource_type = "AWS::CloudWatch::AnomalyDetector"
+
+ props = {
+ 'Configuration': (Configuration, False),
+ 'Dimensions': ([MetricDimension], False),
+ 'MetricName': (basestring, True),
+ 'Namespace': (basestring, True),
+ 'Stat': (basestring, True)
+ } | Add Cloudwatch AnomalyDetector resource (#<I>) | cloudtools_troposphere | train | py |
ab8dc97e7918798f2a09300e1cdebdbd797b2b31 | diff --git a/fluent_blogs/base_models.py b/fluent_blogs/base_models.py
index <HASH>..<HASH> 100644
--- a/fluent_blogs/base_models.py
+++ b/fluent_blogs/base_models.py
@@ -11,7 +11,7 @@ from fluent_blogs.urlresolvers import blog_reverse
from fluent_blogs.models.managers import EntryManager, TranslatableEntryManager
from fluent_blogs.utils.compat import get_user_model_name
from fluent_blogs import appsettings
-from fluent_contents.models import PlaceholderField
+from fluent_contents.models import PlaceholderField, ContentItemRelation
__all__ = (
@@ -200,6 +200,9 @@ class ContentsEntryMixin(models.Model):
"""
contents = PlaceholderField("blog_contents")
+ # Adding the ContentItemRelation makes sure the admin can find all deleted objects too.
+ contentitem_set = ContentItemRelation()
+
class Meta:
abstract = True | Added the ContentItemRelation() to the blog entry.
This makes sure all deleted ContentItem objects are also visible in the admin page. | django-fluent_django-fluent-blogs | train | py |
b70db4ada2d349a2de9e4ff3b56a859f0b42dbd3 | diff --git a/src/style_manager/index.js b/src/style_manager/index.js
index <HASH>..<HASH> 100644
--- a/src/style_manager/index.js
+++ b/src/style_manager/index.js
@@ -281,8 +281,6 @@ module.exports = () => {
if (!rule) {
rule = cssC.add(valid, state, deviceW);
- rule.setStyle(model.getStyle());
- model.setStyle({});
}
} else if (config.avoidInlineStyle) {
rule = cssC.getIdRule(id, opts); | Avoid moving styles from Component to Rules. Fixes #<I> | artf_grapesjs | train | js |
7654c5152c41c2c375e70127eb2a412052023189 | diff --git a/src/Shell/Task/TemplateTask.php b/src/Shell/Task/TemplateTask.php
index <HASH>..<HASH> 100644
--- a/src/Shell/Task/TemplateTask.php
+++ b/src/Shell/Task/TemplateTask.php
@@ -47,9 +47,7 @@ class TemplateTask extends Shell {
/**
* Get view instance
*
- * @param string $viewClass View class name or null to use $viewClass
* @return \Cake\View\View
- * @throws \Cake\View\Exception\MissingViewException If view class was not found.
*/
public function getView() {
if ($this->View) { | remove unused params
the exception isn't thrown either by this method | cakephp_cakephp | train | php |
81c37e1dbc2044d1bdcd4f5a8c1a9fe08e5e0813 | diff --git a/laravel/config/filesystems.php b/laravel/config/filesystems.php
index <HASH>..<HASH> 100644
--- a/laravel/config/filesystems.php
+++ b/laravel/config/filesystems.php
@@ -61,7 +61,7 @@ return [
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
- 'url' => env('AWS_URL'),
+ 'endpoint' => env('AWS_URL'),
],
], | Update endpoint for aws configuration. | orchestral_testbench-dusk | train | php |
7f8eb7c2a31c145b5bec6afbf424cff76305e47d | diff --git a/lib/emcee/document.rb b/lib/emcee/document.rb
index <HASH>..<HASH> 100644
--- a/lib/emcee/document.rb
+++ b/lib/emcee/document.rb
@@ -16,8 +16,8 @@ module Emcee
end
def to_s
- output = @doc.at("body").children
- output.to_s.lstrip
+ body = @doc.at("body").children
+ body.to_s.lstrip
end
def html_imports | Rename variable in `to_s` method of Document | ahuth_emcee | train | rb |
77297cf3865349fa3fc4ca3f8d6fb08e9d6f0b69 | diff --git a/lib/pdk/util.rb b/lib/pdk/util.rb
index <HASH>..<HASH> 100644
--- a/lib/pdk/util.rb
+++ b/lib/pdk/util.rb
@@ -32,7 +32,9 @@ module PDK
#
# @return [String] The temporary directory path.
def make_tmpdir_name(base)
- Dir::Tmpname.make_tmpname(File.join(Dir.tmpdir, base), nil)
+ t = Time.now.strftime('%Y%m%d')
+ name = "#{base}#{t}-#{Process.pid}-#{rand(0x100000000).to_s(36)}"
+ File.join(Dir.tmpdir, name)
end
module_function :make_tmpdir_name | (PDK-<I>) Make PDK compatible with Ruby <I> | puppetlabs_pdk | train | rb |
8d97d5f2965707da6379f8d83914a5e461fde58e | diff --git a/lib/rb-kqueue/native/flags.rb b/lib/rb-kqueue/native/flags.rb
index <HASH>..<HASH> 100644
--- a/lib/rb-kqueue/native/flags.rb
+++ b/lib/rb-kqueue/native/flags.rb
@@ -48,6 +48,13 @@ module KQueue
NOTE_RENAME = 0x00000020 # Vnode was renamed
NOTE_REVOKE = 0x00000040 # Vnode access was revoked
+ # For `EVFILT_PROC`
+ NOTE_EXIT = 0x80000000 # Process exited
+ NOTE_FORK = 0x40000000 # Process forked
+ NOTE_EXEC = 0x20000000 # Process exec'd
+ NOTE_REAP = 0x10000000 # Process reaped
+ NOTE_SIGNAL = 0x08000000 # Received signal
+
# Converts a list of flags to the bitmask that the C API expects.
# | Add flags for process-watching. | mat813_rb-kqueue | train | rb |
e8db7d944d5f769c156909f203df30bd00024362 | diff --git a/runner/steps.js b/runner/steps.js
index <HASH>..<HASH> 100644
--- a/runner/steps.js
+++ b/runner/steps.js
@@ -29,9 +29,9 @@ var browsers = require('./browsers');
// We prefer serving local assets over bower assets.
var PACKAGE_ROOT = path.resolve(__dirname, '..');
-var SERVE_STATIC = {
- '/web-component-tester/browser.js': path.join(PACKAGE_ROOT, 'browser.js'),
- '/web-component-tester/environment.js': path.join(PACKAGE_ROOT, 'environment.js'),
+var SERVE_STATIC = { // Keys are regexps.
+ '^.*\/web-component-tester\/browser\.js$': path.join(PACKAGE_ROOT, 'browser.js'),
+ '^.*\/web-component-tester\/environment\.js$': path.join(PACKAGE_ROOT, 'environment.js'),
};
// Steps
@@ -119,7 +119,7 @@ function startStaticServer(options, emitter, done) {
});
_.each(SERVE_STATIC, function(file, url) {
- app.get(url, function(request, response) {
+ app.get(new RegExp(url), function(request, response) {
send(request, file).pipe(response);
});
}); | Match anything that looks like browser.js or environment.js | Polymer_web-component-tester | train | js |
e4b76edd965cd9ad79cc7c455f841c9a7b8083d9 | diff --git a/cmd/server/main.go b/cmd/server/main.go
index <HASH>..<HASH> 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -149,6 +149,13 @@ func main() {
return err
}
+ cf := &logrus.TextFormatter{
+ TimestampFormat: "2006-01-02 15:04:05.000000000Z07:00",
+ FullTimestamp: true,
+ }
+
+ logrus.SetFormatter(cf)
+
if c.GlobalBool("debug") {
logrus.SetLevel(logrus.DebugLevel)
} | Add timestamps to logs | cri-o_cri-o | train | go |
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.