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
|
---|---|---|---|---|---|
8fc2ccd3e0ee5bd8df06ea856c657bf0139f04d4
|
diff --git a/slave/__init__.py b/slave/__init__.py
index <HASH>..<HASH> 100644
--- a/slave/__init__.py
+++ b/slave/__init__.py
@@ -5,7 +5,7 @@
import warnings
-__version__ = '0.4.0'
+__version__ = '0.4.1'
# Test if ipythons autocall feature is enabled. It can cause serious problems,
# because attributes are executed twice. This means commands are send twice and
|
Bumped version number to <I>
|
p3trus_slave
|
train
|
py
|
3f3d2c8dc5a6b0fe313845499521376505c2745b
|
diff --git a/features/support/http_lib_filters.rb b/features/support/http_lib_filters.rb
index <HASH>..<HASH> 100644
--- a/features/support/http_lib_filters.rb
+++ b/features/support/http_lib_filters.rb
@@ -5,10 +5,17 @@ Cucumber::Ast::OutlineTable::ExampleRow.class_eval do
end
end
-if RUBY_VERSION == '1.9.2' || defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
+if RUBY_VERSION == '1.9.2'
# For some reason, the local sinatra server locks up and never exits
# when using patron on 1.9.2, even though it exits fine during the specs.
UNSUPPORTED_HTTP_LIBS = %w[ patron ]
+elsif defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
+ # Patron is freezing up the cukes (as it does on 1.9.2)
+ # I'm not sure why em-http-request isn't working on rbx,
+ # but considering the fact that VCR works with all the other
+ # libs just fine and doesn't do anything for em-http-request,
+ # it's probably a bug in it or rbx...so ignore it, for now.
+ UNSUPPORTED_HTTP_LIBS = %w[ patron em-http-request ]
elsif RUBY_PLATFORM == 'java'
# These gems have C extensions and can't install on JRuby.
UNSUPPORTED_HTTP_LIBS = %w[ typhoeus patron curb em-http-request ]
|
Ignore em-http-request cukes on rubinius since they are failing and it's not likely a bug in VCR.
|
vcr_vcr
|
train
|
rb
|
2c5a3da4fdd7d0369bf79b89e61a80409124d7ce
|
diff --git a/ayrton/execute.py b/ayrton/execute.py
index <HASH>..<HASH> 100644
--- a/ayrton/execute.py
+++ b/ayrton/execute.py
@@ -19,6 +19,7 @@ import os
import sys
import io
from collections.abc import Iterable
+import signal
# import logging
@@ -259,6 +260,10 @@ class Command:
os.dup2 (w, 2)
os.close (r)
+ # restore some signals
+ for i in (signal.SIGPIPE, ):
+ signal.signal (i, signal.SIG_DFL)
+
try:
os.execvpe (self.exe, self.args, self.options['_env'])
except FileNotFoundError:
|
[+] restore some signals before executing the new process; python ignores it.
|
StyXman_ayrton
|
train
|
py
|
def0de28c738b3a8d8a5d05cf5ee0567c42fed8a
|
diff --git a/spec/platform/extension_cache_spec.rb b/spec/platform/extension_cache_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/platform/extension_cache_spec.rb
+++ b/spec/platform/extension_cache_spec.rb
@@ -6,7 +6,9 @@ require 'spec_helper'
describe Platform::ExtensionCache do
before(:all) do
Platform.load_overlays(overlay_cache_path)
+ end
+ before(:each) do
@cache = Platform::ExtensionCache.new
end
@@ -17,6 +19,18 @@ describe Platform::ExtensionCache do
ext.name.should == 'test'
end
+ it "should determine if an extension was loaded" do
+ @cache['test']
+ @cache.has?('test').should == true
+ end
+
+ it "should select extensions with specific attributes" do
+ test = @cache['test']
+ random = @cache['random']
+
+ @cache.with { |ext| ext.name == 'test' }.should == [test]
+ end
+
it "should provide transparent caching of extensions" do
ext = @cache['test']
ext.should_not be_nil
|
Added specs for ExtensionCache#has? and ExtensionCache#with.
|
ronin-ruby_ronin
|
train
|
rb
|
e6f672a68995b81514f565c51d46c107d5d4d9c7
|
diff --git a/lib/how_is/sources/github/issues.rb b/lib/how_is/sources/github/issues.rb
index <HASH>..<HASH> 100644
--- a/lib/how_is/sources/github/issues.rb
+++ b/lib/how_is/sources/github/issues.rb
@@ -155,10 +155,12 @@ module HowIs::Sources
@data = []
last_cursor = fetch_last_cursor
return @data if last_cursor.nil?
+ after = nil
- begin
- after = fetch_issues(after, last_cursor)
- end until after.nil?
+ loop do
+ after = fetch_issues(after)
+ break if after == last_cursor
+ end
@data.select! { |issue|
if !issue["closedAt"].nil? && date_le(issue["closedAt"], @start_date)
@@ -196,7 +198,7 @@ module HowIs::Sources
end
end
- def fetch_issues(after, last_cursor)
+ def fetch_issues(after)
chunk_size = 100
after_str = ", after: #{after.inspect}" unless after.nil?
@@ -239,11 +241,7 @@ module HowIs::Sources
@data += new_data
end
- if current_last_cursor == last_cursor
- nil
- else
- current_last_cursor
- end
+ current_last_cursor
end
def date_le(left, right)
|
Refactor Sources::Github::Issues.
|
duckinator_inq
|
train
|
rb
|
db72d172d66be2ab59a697d3de608cf947857111
|
diff --git a/lib/dynamic_sitemaps/generator.rb b/lib/dynamic_sitemaps/generator.rb
index <HASH>..<HASH> 100644
--- a/lib/dynamic_sitemaps/generator.rb
+++ b/lib/dynamic_sitemaps/generator.rb
@@ -37,7 +37,10 @@ module DynamicSitemaps
@folder = args.first
raise ArgumentError, "Folder can't be blank." if @folder.blank?
- FileUtils.rm_rf "#{DynamicSitemaps.path}/#{folder}"
+ path = "#{DynamicSitemaps.path}/#{folder}"
+ if Dir.exists?(path)
+ FileUtils.rm_rf "#{path}/*"
+ end
else
# Ensure that the default folder is set and cleaned.
folder DynamicSitemaps.folder if @folder.blank?
|
Only delete folder contents
To ensure that a /sitemap symlink isn't accidentally deleted.
|
lassebunk_dynamic_sitemaps
|
train
|
rb
|
0091373695a7e10c82cb28fd860f5881c45a08e6
|
diff --git a/goless/backends.py b/goless/backends.py
index <HASH>..<HASH> 100644
--- a/goless/backends.py
+++ b/goless/backends.py
@@ -3,6 +3,10 @@ import platform
class Backend(object):
+
+ def shortname(self):
+ return type(self).__name__
+
def start(self, func, *args, **kwargs):
"""Starts a tasklet/greenlet."""
raise NotImplementedError()
@@ -35,6 +39,9 @@ def _make_stackless(): # pragma: no cover
import stackless
class StacklessBackend(Backend):
+ def shortname(self):
+ return 'stackless'
+
def start(self, func, *args, **kwargs):
return stackless.tasklet(func)(*args, **kwargs)
@@ -70,6 +77,9 @@ def _make_gevent():
return self.get()
class GeventBackend(Backend):
+ def shortname(self):
+ return 'gevent'
+
def start(self, func, *args, **kwargs):
greenlet = gevent.spawn(func, *args, **kwargs)
return greenlet
|
Added shortname attribute to backends for better ID when benchmarking
|
rgalanakis_goless
|
train
|
py
|
db6036aadb1537f841ddc01477b5b0099e84dada
|
diff --git a/lib/metaforce/job/retrieve.rb b/lib/metaforce/job/retrieve.rb
index <HASH>..<HASH> 100644
--- a/lib/metaforce/job/retrieve.rb
+++ b/lib/metaforce/job/retrieve.rb
@@ -81,6 +81,7 @@ module Metaforce
def tmp_zip_file
@tmp_zip_file ||= begin
file = Tempfile.new('retrieve')
+ file.binmode
file.write(zip_file)
path = file.path
file.close
|
Added a line file.binmode to tmp_zip_file method to fix Ascii8bit to utf8 conversion
|
ejholmes_metaforce
|
train
|
rb
|
be88468e627ab0e0a0fef711356bd7daf446a0cf
|
diff --git a/spec/model/has_license_spec.rb b/spec/model/has_license_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/model/has_license_spec.rb
+++ b/spec/model/has_license_spec.rb
@@ -8,6 +8,13 @@ describe Model::HasLicense do
LicensedModel.auto_migrate!
end
+ it "should define a license relationship" do
+ relationship = LicensedModel.relationships['license']
+
+ relationship.should_not be_nil
+ relationship.parent_model.should == License
+ end
+
it "should define relationships with License" do
relationship = License.relationships['licensed_models']
|
Added another spec for Model::HasLicense.
|
ronin-ruby_ronin
|
train
|
rb
|
c0ad1cb8b5366704979afea0ae06c6355482182d
|
diff --git a/src/trumbowyg.js b/src/trumbowyg.js
index <HASH>..<HASH> 100644
--- a/src/trumbowyg.js
+++ b/src/trumbowyg.js
@@ -1255,7 +1255,10 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
const VALID_LINK_PREFIX = /^([a-z][-+.a-z0-9]*:|\/|#)/i;
if(VALID_LINK_PREFIX.test(url)) { return url; }
- return url.includes("@") ? `mailto:${url}` : `http://${url}`;
+ const SIMPLE_EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
+ if(SIMPLE_EMAIL_REGEX.test(url)) { return "mailto:" + url; }
+
+ return "http://" + url;
},
unlink: function () {
var t = this,
|
Allow URLs to contain '@'; remove ES6 code.
Simple regex used for testing whether link input is an email rather than a url.
|
Alex-D_Trumbowyg
|
train
|
js
|
40dae37bedbe7667844430f3275cc29068c3c6c1
|
diff --git a/library/src/com/actionbarsherlock/internal/nineoldandroids/view/animation/AnimatorProxy.java b/library/src/com/actionbarsherlock/internal/nineoldandroids/view/animation/AnimatorProxy.java
index <HASH>..<HASH> 100644
--- a/library/src/com/actionbarsherlock/internal/nineoldandroids/view/animation/AnimatorProxy.java
+++ b/library/src/com/actionbarsherlock/internal/nineoldandroids/view/animation/AnimatorProxy.java
@@ -140,6 +140,8 @@ public final class AnimatorProxy extends Animation {
return;
}
+ view.setAnimation(this);
+
final RectF after = mAfter;
computeRect(after, view);
after.union(mBefore);
@@ -202,4 +204,9 @@ public final class AnimatorProxy extends Animation {
transformMatrix(t.getMatrix(), view);
}
}
+
+ @Override
+ public void reset() {
+ /* Do nothing. */
+ }
}
|
Ensure our animation proxy is always set on its view. Closes #<I>.
|
JakeWharton_ActionBarSherlock
|
train
|
java
|
b2189a524fa71789a9079f1f241ff59e8fc4d2a1
|
diff --git a/render/hyperscript.js b/render/hyperscript.js
index <HASH>..<HASH> 100644
--- a/render/hyperscript.js
+++ b/render/hyperscript.js
@@ -5,6 +5,10 @@ var Vnode = require("../render/vnode")
var selectorParser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g
var selectorCache = {}
function hyperscript(selector) {
+ if (selector == null || typeof selector !== "string" && !selector.view) {
+ throw Error("The selector must be either a string or a component.");
+ }
+
if (typeof selector === "string") {
if (selectorCache[selector] === undefined) {
var match, tag, classes = [], attributes = {}
|
proper selector check (#<I>)
|
MithrilJS_mithril.js
|
train
|
js
|
d30ec7296559d89d3f7645f8a1f75447e0343c4e
|
diff --git a/psamm/lpsolver/lp.py b/psamm/lpsolver/lp.py
index <HASH>..<HASH> 100644
--- a/psamm/lpsolver/lp.py
+++ b/psamm/lpsolver/lp.py
@@ -337,11 +337,11 @@ class Problem(object):
@abc.abstractmethod
def add_linear_constraints(self, *relations):
- """Add constraints to the problem
+ """Add constraints to the problem.
Each constraint is given as a :class:`.Relation`, and the expression
in that relation can be a set expression. Returns a sequence of
- :class:`.Constraint`s.
+ :class:`Constraints <.Constraint>`.
"""
@abc.abstractmethod
|
lpsolver: Fix warning about docstring from Sphinx
|
zhanglab_psamm
|
train
|
py
|
40590739ab33c37851944bbd485284797dc6358c
|
diff --git a/core/renderMiddleware.js b/core/renderMiddleware.js
index <HASH>..<HASH> 100644
--- a/core/renderMiddleware.js
+++ b/core/renderMiddleware.js
@@ -235,10 +235,10 @@ function setupLateArrivals(req, res, context, start) {
function getNonInternalConfigs() {
var nonInternal = {};
- var config = config();
- Object.keys(config).forEach( configKey => {
+ var fullConfig = config();
+ Object.keys(fullConfig).forEach( configKey => {
if (configKey !== 'internal') {
- nonInternal[configKey] = config[configKey];
+ nonInternal[configKey] = fullConfig[configKey];
}
});
return nonInternal;
|
Fixing two dumb bugs I introduced in refactoring config to be a function
|
redfin_react-server
|
train
|
js
|
829f563d5dc6cb5e88b10795e999935528790008
|
diff --git a/events.js b/events.js
index <HASH>..<HASH> 100644
--- a/events.js
+++ b/events.js
@@ -292,7 +292,7 @@ function onceWrapper() {
}
function _onceWrap(target, type, listener) {
- var state = { fired: false, wrapFn: undefined, target, type, listener };
+ var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
var wrapped = onceWrapper.bind(state);
wrapped.listener = listener;
state.wrapFn = wrapped;
|
Rewrote an ES6 object literal to ES5
|
Gozala_events
|
train
|
js
|
abb5100a6dc4ff9dfe0c7671d1fbfb66ad9ad713
|
diff --git a/mailmerge/__main__.py b/mailmerge/__main__.py
index <HASH>..<HASH> 100644
--- a/mailmerge/__main__.py
+++ b/mailmerge/__main__.py
@@ -5,7 +5,6 @@ Andrew DeOrio <[email protected]>
"""
from __future__ import print_function
import sys
-import csv
import socket
import configparser
import smtplib
@@ -17,6 +16,13 @@ from .sendmail_client import SendmailClient
from .utils import MailmergeError
+# Python 2 UTF8 support requires csv backport
+try:
+ from backports import csv
+except ImportError:
+ import csv
+
+
@click.command(context_settings={"help_option_names": ['-h', '--help']})
@click.version_option() # Auto detect version from setup.py
@click.option(
diff --git a/tests/test_template_message.py b/tests/test_template_message.py
index <HASH>..<HASH> 100644
--- a/tests/test_template_message.py
+++ b/tests/test_template_message.py
@@ -10,7 +10,7 @@ import markdown
import mailmerge.template_message
from . import utils
-# Python 2.x UTF8 support requires csv backport
+# Python 2 UTF8 support requires csv backport
try:
from backports import csv
except ImportError:
|
bug fix: CSV library UTF8 import
|
awdeorio_mailmerge
|
train
|
py,py
|
ab8433d5138c0b39030b706d1bd4cb07d897a937
|
diff --git a/lib/fbgraph/version.rb b/lib/fbgraph/version.rb
index <HASH>..<HASH> 100644
--- a/lib/fbgraph/version.rb
+++ b/lib/fbgraph/version.rb
@@ -1,3 +1,3 @@
module FBGraph
- VERSION = '1.10.0'
+ VERSION = '1.10.1'
end
|
Version bump to <I>.
|
nsanta_fbgraph
|
train
|
rb
|
d3d3674adbb941885605de4eca40cb7f91aac574
|
diff --git a/tests/app/rdev/cache/RedisBridgeTest.php b/tests/app/rdev/cache/RedisBridgeTest.php
index <HASH>..<HASH> 100644
--- a/tests/app/rdev/cache/RedisBridgeTest.php
+++ b/tests/app/rdev/cache/RedisBridgeTest.php
@@ -9,6 +9,12 @@ use RDev\Redis\Server;
use RDev\Redis\TypeMapper;
use RDev\Tests\Redis\Mocks\RDevPHPRedis;
+// To get around having to install Redis just to run tests, include a mock Redis class
+if(!class_exists("Redis"))
+{
+ require_once __DIR__ . "/../redis/mocks/redis.php";
+}
+
class RedisBridgeTest extends \PHPUnit_Framework_TestCase
{
/** @var RedisBridge The bridge to use in tests */
|
Included a Redis mock file to pass tests in HHVM
|
opulencephp_Opulence
|
train
|
php
|
b0a89e64708632d11980df72ee4ceb09f3e49c7c
|
diff --git a/src/AbstractSitemap.php b/src/AbstractSitemap.php
index <HASH>..<HASH> 100644
--- a/src/AbstractSitemap.php
+++ b/src/AbstractSitemap.php
@@ -103,8 +103,8 @@ abstract class AbstractSitemap implements SitemapInterface
}
/**
- * @param $filePath
- * @param $fileName
+ * @param string $filePath
+ * @param string $fileName
*/
protected function prepareOutputFile($filePath, $fileName)
{
@@ -153,7 +153,7 @@ abstract class AbstractSitemap implements SitemapInterface
}
/**
- * @return string
+ * @return integer
*/
protected function getCurrentFileSize()
{
|
Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on <URL>
|
nilportugues_php-sitemap
|
train
|
php
|
a638c6bae8663ce46116d252fb72fd3d80c801a4
|
diff --git a/gsshapy/grid/grid_to_gssha.py b/gsshapy/grid/grid_to_gssha.py
index <HASH>..<HASH> 100644
--- a/gsshapy/grid/grid_to_gssha.py
+++ b/gsshapy/grid/grid_to_gssha.py
@@ -19,9 +19,8 @@ from shutil import copy
import xarray as xr
import xarray.ufuncs as xu
-from gazar.grid import ArrayGrid, gdal_reproject
+from gazar.grid import ArrayGrid
from ..lib import db_tools as dbt
-from ..orm import ProjectFile
log = logging.getLogger(__name__)
@@ -580,12 +579,7 @@ class GRIDtoGSSHA(object):
# STEP 1: Get extent from GSSHA Grid in LSM coordinates
####
# reproject GSSHA grid and get bounds
- lsm_proj = self.xd.lsm.projection
- ggrid = gdal_reproject(self.gssha_grid.dataset,
- src_srs=self.gssha_grid.projection,
- dst_srs=lsm_proj,
- as_gdal_grid=True)
- min_x, max_x, min_y, max_y = ggrid.bounds()
+ min_x, max_x, min_y, max_y = ggrid.bounds(as_projection=self.xd.lsm.projection)
# set subset indices
self._set_subset_indices(min_y,
|
modified to use gazars internal projection
|
CI-WATER_gsshapy
|
train
|
py
|
4b4d420dac162a07f0ae57d88d563e4e41b290ad
|
diff --git a/ez_setup.py b/ez_setup.py
index <HASH>..<HASH> 100644
--- a/ez_setup.py
+++ b/ez_setup.py
@@ -36,7 +36,7 @@ try:
except ImportError:
USER_SITE = None
-DEFAULT_VERSION = "8.0.4"
+DEFAULT_VERSION = "8.0.5"
DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/"
def _python_cmd(*args):
diff --git a/setuptools/version.py b/setuptools/version.py
index <HASH>..<HASH> 100644
--- a/setuptools/version.py
+++ b/setuptools/version.py
@@ -1 +1 @@
-__version__ = '8.0.4'
+__version__ = '8.0.5'
|
Bumped to <I> in preparation for next release.
|
pypa_setuptools
|
train
|
py,py
|
58669e47c9dce872162c08f79deb2027a9bc5e39
|
diff --git a/src/bundle.js b/src/bundle.js
index <HASH>..<HASH> 100644
--- a/src/bundle.js
+++ b/src/bundle.js
@@ -3,7 +3,14 @@ var utils = require("belty");
function Bundle(name, options, main) {
this.name = name;
- this.main = !!main;
+
+ Object.defineProperties(this, {
+ "isMain": {
+ value: !!main,
+ writable: false
+ }
+ });
+
configurator.configure(this, options);
}
|
added readonly property isMain to Bundle to stop relying on the isMain argument in bundle visitors
|
MiguelCastillo_bit-bundler
|
train
|
js
|
cec782ad71678208a10f1e1b7a87f9c1e309b516
|
diff --git a/lib/ark/utility.rb b/lib/ark/utility.rb
index <HASH>..<HASH> 100644
--- a/lib/ark/utility.rb
+++ b/lib/ark/utility.rb
@@ -71,7 +71,7 @@ module Ark
end
end
- class Line
+ class TextBuilder
def initialize()
@lines = [[]]
@line = 0
|
Renamed the Line class to TextBuilder
|
aetherised_ark-util
|
train
|
rb
|
363c7e0ae488d128da6ea879386e8cc45d2fa6c3
|
diff --git a/tests/calculators/hazard/event_based/core_next_test.py b/tests/calculators/hazard/event_based/core_next_test.py
index <HASH>..<HASH> 100644
--- a/tests/calculators/hazard/event_based/core_next_test.py
+++ b/tests/calculators/hazard/event_based/core_next_test.py
@@ -187,7 +187,7 @@ class EventBasedHazardCalculatorTestCase(unittest.TestCase):
hc = self.job.hazard_calculation
rlz1, rlz2 = models.LtRealization.objects.filter(
- hazard_calculation=hc.id)
+ hazard_calculation=hc.id).order_by('ordinal')
progress = dict(total=0, computed=0)
|
tests/calcs/hazard/event_based/core_next_test:
Stabilized a test (it was intermittently failing due to ordering
of db query results).
|
gem_oq-engine
|
train
|
py
|
03bc2ccb9dfe4af966d9e8ca0f2e1801b36c489b
|
diff --git a/repo/fsrepo/fsrepo.go b/repo/fsrepo/fsrepo.go
index <HASH>..<HASH> 100644
--- a/repo/fsrepo/fsrepo.go
+++ b/repo/fsrepo/fsrepo.go
@@ -87,6 +87,18 @@ func open(repoPath string) (repo.Repo, error) {
path: expPath,
}
+ r.lockfile, err = lockfile.Lock(r.path)
+ if err != nil {
+ return nil, err
+ }
+ keepLocked := false
+ defer func() {
+ // unlock on error, leave it locked on success
+ if !keepLocked {
+ r.lockfile.Close()
+ }
+ }()
+
if !isInitializedUnsynced(r.path) {
return nil, debugerror.New("ipfs not initialized, please run 'ipfs init'")
}
@@ -108,11 +120,7 @@ func open(repoPath string) (repo.Repo, error) {
// log.Debugf("writing eventlogs to ...", c.path)
configureEventLoggerAtRepoPath(r.config, r.path)
- closer, err := lockfile.Lock(r.path)
- if err != nil {
- return nil, err
- }
- r.lockfile = closer
+ keepLocked = true
return r, nil
}
|
Take FSRepo lock way earlier
There is no way this was safe before.
Be careful to unlock on the error paths.
|
ipfs_go-ipfs
|
train
|
go
|
89d60f796d3c4047a37b839e8527e96e91445423
|
diff --git a/pkg/workloads/containerd/watcher.go b/pkg/workloads/containerd/watcher.go
index <HASH>..<HASH> 100644
--- a/pkg/workloads/containerd/watcher.go
+++ b/pkg/workloads/containerd/watcher.go
@@ -31,6 +31,7 @@ import (
"github.com/cilium/cilium/pkg/ipam"
"github.com/cilium/cilium/pkg/k8s"
"github.com/cilium/cilium/pkg/labels"
+ "github.com/cilium/cilium/pkg/lock"
"github.com/cilium/cilium/pkg/logfields"
"github.com/cilium/cilium/pkg/nodeaddress"
"github.com/cilium/cilium/pkg/workloads"
@@ -54,7 +55,7 @@ const (
// containerEvents holds per-container queues for events
type containerEvents struct {
- sync.Mutex
+ lock.Mutex
events map[string]chan dTypesEvents.Message
}
|
containerd: Use pkg/lock for Mutex
Allows to use lockdebug
|
cilium_cilium
|
train
|
go
|
5b0318aa01b74399f72057986831fa453a6f34ab
|
diff --git a/lib/tenacity/orm_ext/mongo_mapper.rb b/lib/tenacity/orm_ext/mongo_mapper.rb
index <HASH>..<HASH> 100644
--- a/lib/tenacity/orm_ext/mongo_mapper.rb
+++ b/lib/tenacity/orm_ext/mongo_mapper.rb
@@ -99,6 +99,7 @@ module TenacityPluginAddition #:nodoc:
end
begin
+ require 'mongo_mapper'
MongoMapper::Document.append_inclusions(TenacityPluginAddition)
rescue
# MongoMapper not available
|
Require mongo_mapper in the mongo mapper orm extension
|
jwood_tenacity
|
train
|
rb
|
db83f9ac9c60a2a02441e6110ded213d4e1e6e03
|
diff --git a/code/GridFieldBetterButtonsItemRequest.php b/code/GridFieldBetterButtonsItemRequest.php
index <HASH>..<HASH> 100755
--- a/code/GridFieldBetterButtonsItemRequest.php
+++ b/code/GridFieldBetterButtonsItemRequest.php
@@ -282,7 +282,9 @@ class GridFieldBetterButtonsItemRequest extends DataExtension {
$form->saveInto($this->owner->record);
$this->owner->record->write();
$list->add($this->owner->record, $extraData);
+ $this->owner->record->invokeWithExtensions('onBeforePublish', $this->owner->record);
$this->owner->record->publish('Stage', 'Live');
+ $this->owner->record->invokeWithExtensions('onAfterPublish', $this->owner->record);
} catch (ValidationException $e) {
$form->sessionMessage($e->getResult()->message(), 'bad');
$responseNegotiator = new PjaxResponseNegotiator(array(
|
Fixed onBeforePublish and onAfterPublish exensions
If these are not present some extensions like staticpublishqueue stop working on SiteTree.
|
unclecheese_silverstripe-gridfield-betterbuttons
|
train
|
php
|
c29157ace0df4951674ae1a3714107dfcb18b244
|
diff --git a/dev/com.ibm.ws.jdbc_fat/fat/src/com/ibm/ws/jdbc/fat/tests/ConfigTest.java b/dev/com.ibm.ws.jdbc_fat/fat/src/com/ibm/ws/jdbc/fat/tests/ConfigTest.java
index <HASH>..<HASH> 100644
--- a/dev/com.ibm.ws.jdbc_fat/fat/src/com/ibm/ws/jdbc/fat/tests/ConfigTest.java
+++ b/dev/com.ibm.ws.jdbc_fat/fat/src/com/ibm/ws/jdbc/fat/tests/ConfigTest.java
@@ -379,7 +379,7 @@ public class ConfigTest extends FATServletClient {
try {
updateServerConfig(config, EMPTY_EXPR_LIST);
- // Behavior should now reflect the new setting of 1 for maxPoolSize
+ // Behavior should now reflect the new setting of 2 for maxPoolSize
runTest(basicfat, "testMaxPoolSize2");
} catch (Throwable x) {
System.out.println("Failure during " + method + " with the following config:");
|
Issue #<I> code review fix
|
OpenLiberty_open-liberty
|
train
|
java
|
5f21f27f76a519d4aca87f7ab025f62230221d79
|
diff --git a/lib/svtplay_dl/service/services.py b/lib/svtplay_dl/service/services.py
index <HASH>..<HASH> 100644
--- a/lib/svtplay_dl/service/services.py
+++ b/lib/svtplay_dl/service/services.py
@@ -7,6 +7,7 @@ from svtplay_dl.service.disney import Disney
from svtplay_dl.service.dplay import Dplay
from svtplay_dl.service.dr import Dr
from svtplay_dl.service.efn import Efn
+from svtplay_dl.service.eurosport import Eurosport
from svtplay_dl.service.expressen import Expressen
from svtplay_dl.service.facebook import Facebook
from svtplay_dl.service.filmarkivet import Filmarkivet
@@ -50,6 +51,7 @@ sites = [
Dplay,
Dr,
Efn,
+ Eurosport,
Expressen,
Facebook,
Filmarkivet,
|
service. readd the service to the list of services.
|
spaam_svtplay-dl
|
train
|
py
|
8d15b895779172ca19d1edd524f66247aaa4d155
|
diff --git a/lib/bibtex/entry/rdf_converter.rb b/lib/bibtex/entry/rdf_converter.rb
index <HASH>..<HASH> 100644
--- a/lib/bibtex/entry/rdf_converter.rb
+++ b/lib/bibtex/entry/rdf_converter.rb
@@ -234,10 +234,7 @@ class BibTeX::Entry::RDFConverter
org = agent(bibtex[:organization]) { create_agent(bibtex[:organization].to_s, :Organization) }
graph << [entry, RDF::DC.contributor, org]
- if [:proceedings, :inproceedings, :conference].any?(bibtex.type)
- event = RDF::Vocabulary.new('http://purl.org/NET/c4dm/event.owl')
- graph << [entry, event[:hasAgent], org]
- end
+ graph << [entry, bibo[:organizer], org] if [:proceedings, :inproceedings, :conference].any?(bibtex.type)
end
def pages
|
Replace event:hasAgent with bibo:organizer in #organization
|
inukshuk_bibtex-ruby
|
train
|
rb
|
841c2dc2f3af7d6a5ff80cb8d43f4e13834d13f9
|
diff --git a/bika/lims/browser/publish.py b/bika/lims/browser/publish.py
index <HASH>..<HASH> 100644
--- a/bika/lims/browser/publish.py
+++ b/bika/lims/browser/publish.py
@@ -52,7 +52,7 @@ class doPublish(BrowserView):
brains = bsc(UID=spec_uid)
if brains:
obj = brains[0].getObject()
- if not obj:
+ if hasattr(self.context, 'getSpecification') and not obj:
if self.context.getSpecification():
obj = self.context.getSpecification()
return obj
|
Fix bug when publishing multiple ARs from the list view
|
senaite_senaite.core
|
train
|
py
|
273287b13a9350a6dc6ff6654c612edfe9b719e8
|
diff --git a/lib/kafka/consumer_group.rb b/lib/kafka/consumer_group.rb
index <HASH>..<HASH> 100644
--- a/lib/kafka/consumer_group.rb
+++ b/lib/kafka/consumer_group.rb
@@ -89,6 +89,11 @@ module Kafka
rescue ConnectionError, UnknownMemberId, RebalanceInProgress, IllegalGeneration => e
@logger.error "Error sending heartbeat: #{e}"
raise HeartbeatError, e
+ rescue NotCoordinatorForGroup
+ @logger.error "Failed to find coordinator for group `#{@group_id}`; retrying..."
+ sleep 1
+ @coordinator = nil
+ retry
end
private
|
Rescue NotCoordinatorForGroup during heartbeats
It is possible for a group coordinator after a group rebalance to send
a group to another group coordinator. This results in NotCoordinatorForGroup
error in the next heartbeat attempt and the consumer crashes.
This commit gracefully handles this problem by getting the new group
coordinator from the cluster and retrying the heartbeat.
|
zendesk_ruby-kafka
|
train
|
rb
|
616ec7626a479c8e8ee3bb0d5f19d67194331ab6
|
diff --git a/lib/cli.js b/lib/cli.js
index <HASH>..<HASH> 100644
--- a/lib/cli.js
+++ b/lib/cli.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
-if (process.getuid() === 0) {
+if (process.getuid && process.getuid() === 0) {
global.console.error("Sinopia doesn't need superuser privileges. Don't run it under root.")
}
|
process.getuid doesn't always exist (fixes #<I>)
|
verdaccio_verdaccio
|
train
|
js
|
318f12244dbeb47af45d911419fb8e37b57efb2c
|
diff --git a/camel-talendjob/src/main/java/org/talend/camel/Activator.java b/camel-talendjob/src/main/java/org/talend/camel/Activator.java
index <HASH>..<HASH> 100644
--- a/camel-talendjob/src/main/java/org/talend/camel/Activator.java
+++ b/camel-talendjob/src/main/java/org/talend/camel/Activator.java
@@ -56,7 +56,12 @@ public class Activator implements BundleActivator {
}
if (null != serviceReferences) {
- return clazz.cast(context.getService(serviceReferences[0]));
+ for( ServiceReference serviceRef : serviceReferences ){
+ Object service = context.getService(serviceRef);
+ if(jobType.isInstance(service)){
+ return clazz.cast(service);
+ }
+ }
}
} catch (InvalidSyntaxException e) {
}
|
TESB-<I> Camel TalendJob can't create correct job instance when
multiple job bundle exist with the same name.
<URL>
|
Talend_tesb-rt-se
|
train
|
java
|
3c97e6faf6458f0045f27fadd0c4c41dabf7db09
|
diff --git a/src/WP_CLI/CommandWithUpgrade.php b/src/WP_CLI/CommandWithUpgrade.php
index <HASH>..<HASH> 100755
--- a/src/WP_CLI/CommandWithUpgrade.php
+++ b/src/WP_CLI/CommandWithUpgrade.php
@@ -346,7 +346,9 @@ abstract class CommandWithUpgrade extends \WP_CLI_Command {
\WP_CLI\Utils\format_items( $format, $status, array( 'name', 'old_version', 'new_version', 'status' ) );
}
}
- Utils\report_batch_operation_results( $this->item_type, 'update', $num_to_update, $num_updated, $errors );
+
+ $total_updated = Utils\get_flag_value( $assoc_args, 'all' ) ? $num_to_update : count( $args );
+ Utils\report_batch_operation_results( $this->item_type, 'update', $total_updated, $num_updated, $errors );
}
protected function _list( $_, $assoc_args ) {
|
Only use `$num_to_update` when `--all` is set
When specific plugins or themes are supplied, `$args` is the accurate
count.
|
wp-cli_extension-command
|
train
|
php
|
1d4499503e188e973f49604b21e1678d8380c7fd
|
diff --git a/lib/Client.js b/lib/Client.js
index <HASH>..<HASH> 100644
--- a/lib/Client.js
+++ b/lib/Client.js
@@ -332,14 +332,17 @@ Client.prototype.prepare = function(query) {
};
Client.prototype._format_value = function (v) {
- if (Buffer.isBuffer(v)) return "'" + addon.escape(v.toString('utf8')) + "'";
+ if (Buffer.isBuffer(v))
+ return "'" + addon.escape(v.toString('utf8')) + "'";
else if (Array.isArray(v)) {
var r = [];
- for (var i = 0; i < v.length; i++) r.push(this._format_value(v[i]));
+ for (var i = 0, len = v.length; i < len; ++i)
+ r.push(this._format_value(v[i]));
return r.join(',');
- }
- else if (v !== null) return "'" + addon.escape(v + '') + "'";
- else return 'NULL';
+ } else if (v !== null && v !== undefined)
+ return "'" + addon.escape(v + '') + "'";
+
+ return 'NULL';
};
Client.prototype._reset = function() {
|
Client: use NULL for undefined too in prepare()
|
mscdex_node-mariasql
|
train
|
js
|
86d41d4ba43c8da893e306acd4989146653694b7
|
diff --git a/app/controllers/authic_client/sessions_controller.rb b/app/controllers/authic_client/sessions_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/authic_client/sessions_controller.rb
+++ b/app/controllers/authic_client/sessions_controller.rb
@@ -3,7 +3,9 @@ class AuthicClient::SessionsController < ApplicationController
user = User.find_for_authic_oauth(request.env["omniauth.auth"], current_user)
if user.persisted?
session[:authic_user_id] = user.id
- redirect_path ||= session.delete(:authic_return_to_this_url) ||= root_url
+ redirect_path ||= session[:authic_return_to_this_url] ||= root_url
+ # make sure the return to session variable is nil so it cant accidently get re-used
+ session[:authic_return_to_this_url] = nil
redirect_to redirect_path, :notice => "You have been successfully signed in"
else
redirect_to root_url
|
Cleared session return to url after use
|
authic_authic_client
|
train
|
rb
|
e7add63e733d79969a43ea5a93f3ccff5a722c60
|
diff --git a/package-scripts.js b/package-scripts.js
index <HASH>..<HASH> 100644
--- a/package-scripts.js
+++ b/package-scripts.js
@@ -267,7 +267,7 @@ module.exports = {
},
linkcheck: {
script:
- 'hyperlink -ri --canonicalroot https://mochajs.org --skip ".js.html#line" docs/_site/index.html'
+ 'hyperlink -ri --canonicalroot https://mochajs.org --skip ".js.html#line" docs/_site/index.html --todo "HTTP 429 Too Many Requests"'
},
postbuild: {
script:
|
Mark HTTP <I> responses as allowed failures in hyperlink check. We sometimes get these from unpkg and it shouldnt block out builds (#<I>)
|
mochajs_mocha
|
train
|
js
|
c291195a6d955dd11eb16f6363db3cb7d3ff3557
|
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index <HASH>..<HASH> 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -14,15 +14,15 @@ module ActionMailer #:nodoc:
#
# $ rails generate mailer Notifier
#
- # The generated model inherits from <tt>ActionMailer::Base</tt>. Emails are defined by creating methods
- # within the model which are then used to set variables to be used in the mail template, to
- # change options on the mail, or to add attachments.
+ # The generated model inherits from <tt>ActionMailer::Base</tt>. A mailer model defines methods
+ # used to generate an email message. In these methods, you can setup variables to be used in
+ # the mailer views, options on the mail itself such as the <tt>:from</tt> address, and attachments.
#
# Examples:
#
# class Notifier < ActionMailer::Base
# default :from => '[email protected]',
- # :return_path => '[email protected]'
+ # :return_path => '[email protected]'
#
# def welcome(recipient)
# @account = recipient
|
Updates ActionMailer Base summary and fixes space in code example.
|
rails_rails
|
train
|
rb
|
bf3ae9d7c3b25df0accb0c86b8c370c9c3e95563
|
diff --git a/bqplot/nbextension/bqplot/MarketMap.js b/bqplot/nbextension/bqplot/MarketMap.js
index <HASH>..<HASH> 100644
--- a/bqplot/nbextension/bqplot/MarketMap.js
+++ b/bqplot/nbextension/bqplot/MarketMap.js
@@ -481,7 +481,7 @@ define(["widgets/js/manager", "widgets/js/widget", "d3", "./Figure", "base/js/ut
show_tooltip: function(event, data) {
var mouse_pos = d3.mouse(this.el);
var that = this;
- var tooltip_div = d3.select("body")
+ var tooltip_div = d3.select(this.el.parentNode)
.select("#map_tooltip");
tooltip_div.transition()
.style("opacity", .9);
@@ -509,7 +509,7 @@ define(["widgets/js/manager", "widgets/js/widget", "d3", "./Figure", "base/js/ut
this.send({event: "hover", data: data["name"], ref_data: data.ref_data});
},
hide_tooltip: function() {
- var tooltip_div = d3.select("body")
+ var tooltip_div = d3.select(this.el.parentNode)
.select("#map_tooltip");
tooltip_div.transition()
.style("opacity", 0);
|
market map tool tip, selecting the correct element on show and hide
|
bloomberg_bqplot
|
train
|
js
|
18a55badac8c42b63c2fcf46215095705ced6d1c
|
diff --git a/isort/settings.py b/isort/settings.py
index <HASH>..<HASH> 100644
--- a/isort/settings.py
+++ b/isort/settings.py
@@ -35,7 +35,7 @@ try:
import appdirs
if appdirs.system == "darwin":
- appdirs.system = "linux2"
+ appdirs.system = "linux2" # pragma: no cover
except ImportError:
appdirs = None
@@ -164,7 +164,7 @@ class _Config:
def __post_init__(self):
py_version = self.py_version
- if py_version == "auto":
+ if py_version == "auto": # pragma: no cover
if sys.version_info.major == 2 and sys.version_info.minor <= 6:
py_version = "2"
elif sys.version_info.major == 3 and (
diff --git a/tests/test_isort.py b/tests/test_isort.py
index <HASH>..<HASH> 100644
--- a/tests/test_isort.py
+++ b/tests/test_isort.py
@@ -4993,5 +4993,9 @@ from future import *, something
# my future comment
from future import *
+from future import something
"""
- assert api.sort_code_string(input_text, combine_star=True) == expected_output
+ assert (
+ api.sort_code_string(input_text, combine_star=False, ensure_newline_before_comments=True, force_single_line=True)
+ == expected_output
+ )
|
Pragramatically ignore coverage for environment specific lines
|
timothycrosley_isort
|
train
|
py,py
|
b0fc66fa686b574dda757aaaa08e66bd52e5e3c6
|
diff --git a/salt/transport/zeromq.py b/salt/transport/zeromq.py
index <HASH>..<HASH> 100644
--- a/salt/transport/zeromq.py
+++ b/salt/transport/zeromq.py
@@ -312,6 +312,8 @@ class AsyncZeroMQPubChannel(salt.transport.mixins.auth.AESPubClientMixin, salt.t
# TODO: Optionally call stream.close() on newer pyzmq? Its broken on some
self._stream.io_loop.remove_handler(self._stream.socket)
self._stream.socket.close(0)
+ elif hasattr(self, '_socket'):
+ self._socket.close(0)
if hasattr(self, 'context'):
self.context.term()
|
Always close socket even if there is no stream.
|
saltstack_salt
|
train
|
py
|
a3585812dbe314e65609bf64c94bcad70f5655f7
|
diff --git a/convert.go b/convert.go
index <HASH>..<HASH> 100644
--- a/convert.go
+++ b/convert.go
@@ -42,6 +42,10 @@ func hilMapstructureWeakDecode(m interface{}, rawVal interface{}) error {
}
func InterfaceToVariable(input interface{}) (ast.Variable, error) {
+ if inputVariable, ok := input.(ast.Variable); ok {
+ return inputVariable, nil
+ }
+
var stringVal string
if err := hilMapstructureWeakDecode(input, &stringVal); err == nil {
return ast.Variable{
diff --git a/convert_test.go b/convert_test.go
index <HASH>..<HASH> 100644
--- a/convert_test.go
+++ b/convert_test.go
@@ -7,6 +7,17 @@ import (
"github.com/hashicorp/hil/ast"
)
+func TestInterfaceToVariable_variableInput(t *testing.T) {
+ _, err := InterfaceToVariable(ast.Variable{
+ Type: ast.TypeString,
+ Value: "Hello world",
+ })
+
+ if err != nil {
+ t.Fatalf("Bad: %s", err)
+ }
+}
+
func TestInterfaceToVariable(t *testing.T) {
testCases := []struct {
name string
|
Test input for ast.Variable in InterfaceToVariable
This commit adds a check to the InterfaceToVariable helper to ensure
that the input is not already wrapped with the HIL type annotations. If
it is, the input is returned unmodified.
|
hashicorp_hil
|
train
|
go,go
|
2109de8980322c9157699bf8b518cbc10b373a61
|
diff --git a/area4/__init__.py b/area4/__init__.py
index <HASH>..<HASH> 100644
--- a/area4/__init__.py
+++ b/area4/__init__.py
@@ -19,6 +19,7 @@ divider9 = str("************************")
divider10 = str(",,,,,,,,,,,,,,,,,,,,,,,,")
divider11 = str("////////////////////////")
divider12 = str("||||||||||||||||||||||||")
+divider17 = str("r(`,,,`)r r(`,,,`)r r(`,,,`)r ")
custom_div = str("")
# Functions:
@@ -57,7 +58,10 @@ def div11():
def div12():
return divider12
-
+
+def div12():
+ return divider17
+
def customdiv():
return custom_div
|
cthulhu divider added
|
area4lib_area4
|
train
|
py
|
6e15b1cd203b7a0c8d11322cdf3aa98407ee6298
|
diff --git a/test/res.status.js b/test/res.status.js
index <HASH>..<HASH> 100644
--- a/test/res.status.js
+++ b/test/res.status.js
@@ -1,13 +1,22 @@
var express = require('../')
- , res = require('http').ServerResponse.prototype;
+ , request = require('./support/http');
describe('res', function(){
describe('.status()', function(){
- it('should set the response .statusCode', function(){
- var obj = {};
- res.status.call(obj, 200).should.equal(obj);
- obj.statusCode.should.equal(200);
+ it('should set the response .statusCode', function(done){
+ var app = express();
+
+ app.use(function(req, res){
+ res.status(201).end('Created');
+ });
+
+ request(app)
+ .get('/')
+ .end(function(res){
+ res.statusCode.should.equal(201);
+ done();
+ })
})
})
})
|
Removed mock from res.status() test, mocks are lame
|
expressjs_express
|
train
|
js
|
f3dfc4e22601b5a1712b6a1c99f8bab707daa38e
|
diff --git a/motion/ruby_motion_query/actions.rb b/motion/ruby_motion_query/actions.rb
index <HASH>..<HASH> 100644
--- a/motion/ruby_motion_query/actions.rb
+++ b/motion/ruby_motion_query/actions.rb
@@ -61,5 +61,25 @@ module RubyMotionQuery
self
end
+ def enable
+ selected.each { |view| view.enabled = true }
+ self
+ end
+
+ def disable
+ selected.each { |view| view.enabled = false }
+ self
+ end
+
+ def enable_interaction
+ selected.each { |view| view.userInteractionEnabled = true }
+ self
+ end
+
+ def disable_interaction
+ selected.each { |view| view.userInteractionEnabled = false }
+ self
+ end
+
end
end
diff --git a/motion/ruby_motion_query/stylers/ui_view_styler.rb b/motion/ruby_motion_query/stylers/ui_view_styler.rb
index <HASH>..<HASH> 100644
--- a/motion/ruby_motion_query/stylers/ui_view_styler.rb
+++ b/motion/ruby_motion_query/stylers/ui_view_styler.rb
@@ -259,6 +259,14 @@ module RubyMotionQuery
@view.contentMode
end
+ def clips_to_bounds=(value)
+ @view.clipsToBounds = value
+ end
+
+ def clips_to_bounds
+ @view.clipsToBounds
+ end
+
end
end
end
|
Added to actions: enable, disable interactions. Enable, disable. Added clip_to_bounds to view styler
|
infinitered_rmq
|
train
|
rb,rb
|
888c51dfac82017ac40f5a59e42326a4eaf75fa6
|
diff --git a/lib/wrong/version.rb b/lib/wrong/version.rb
index <HASH>..<HASH> 100644
--- a/lib/wrong/version.rb
+++ b/lib/wrong/version.rb
@@ -1,3 +1,3 @@
module Wrong
- VERSION = "0.5.5" unless defined?(Wrong::VERSION)
+ VERSION = "0.5.6" unless defined?(Wrong::VERSION)
end
|
bump to <I> to test possible 'gem push' bug
|
sconover_wrong
|
train
|
rb
|
1d0c71105c4eb841150f4fee5865b2e9f81a8e71
|
diff --git a/concrete/src/Updater/Migrations/Migrations/Version20190509205043.php b/concrete/src/Updater/Migrations/Migrations/Version20190509205043.php
index <HASH>..<HASH> 100644
--- a/concrete/src/Updater/Migrations/Migrations/Version20190509205043.php
+++ b/concrete/src/Updater/Migrations/Migrations/Version20190509205043.php
@@ -27,7 +27,7 @@ class Version20190509205043 extends AbstractMigration implements RepeatableMigra
// Now we have to populate this. Let's bust out of the entity manager for performance purposes.
$connection = $this->connection;
$this->connection->transactional(function() use ($connection, $generator) {
- $r = $connection->executeQuery('select exEntryID from ExpressEntityEntries');
+ $r = $connection->executeQuery('select exEntryID from ExpressEntityEntries where publicIdentifier is null');
while ($row = $r->fetch()) {
$identifier = $generator->generate();
$connection->update(
|
Fix ExpressEntityEntries.publicIdentifier migration
This is a repeatable migration, so we should be sure we don't wipe out
previous data
|
concrete5_concrete5
|
train
|
php
|
2186c6ef0122016d3535f779549340300756055e
|
diff --git a/media/boom/js/boom/chunk/chunk.js b/media/boom/js/boom/chunk/chunk.js
index <HASH>..<HASH> 100755
--- a/media/boom/js/boom/chunk/chunk.js
+++ b/media/boom/js/boom/chunk/chunk.js
@@ -98,19 +98,6 @@ $.widget('ui.chunk',
},
/**
- Bring the slot UI forward, above all other page elements.
- @function
- */
- _bring_forward : function() {
-
- this.element.css( {
- 'z-index' : 1000,
- 'position' : 'relative'
- });
- top.$( 'body' ).prepend( '<div class="overlay"></div>' );
-
- },
- /**
Drop the slot UI back into its natural place in the page z-index stack.
@function
*/
|
Removed unused JS function chunk._bring_forward()
|
boomcms_boom-core
|
train
|
js
|
0c54a50395d96cfa3f80a731fb7e336ea0cdc883
|
diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js
index <HASH>..<HASH> 100644
--- a/src/interaction/InteractionManager.js
+++ b/src/interaction/InteractionManager.js
@@ -793,5 +793,47 @@ InteractionManager.prototype.returnTouchData = function ( touchData )
this.interactiveDataPool.push( touchData );
};
+/**
+ * Destroys the interaction manager
+ */
+InteractionManager.prototype.destroy = function () {
+ this.renderer = null;
+
+ this.mouse = null;
+
+ this.eventData = null;
+
+ this.interactiveDataPool = null;
+
+ this.interactionDOMElement = null;
+
+ this.onMouseUp = null;
+ this.processMouseUp = null;
+
+
+ this.onMouseDown = null;
+ this.processMouseDown = null;
+
+ this.onMouseMove = null;
+ this.processMouseMove = null;
+
+ this.onMouseOut = null;
+ this.processMouseOverOut = null;
+
+
+ this.onTouchStart = null;
+ this.processTouchStart = null;
+
+ this.onTouchEnd = null;
+ this.processTouchEnd = null;
+
+ this.onTouchMove = null;
+ this.processTouchMove = null;
+
+ this._tempPoint = null;
+
+ this.updateBound = null;
+};
+
core.WebGLRenderer.registerPlugin('interaction', InteractionManager);
core.CanvasRenderer.registerPlugin('interaction', InteractionManager);
|
fix #<I>; add destroy method to InteractionManager
|
pixijs_pixi.js
|
train
|
js
|
c30dcef101e640ef0d40e5482e9e113eca87100a
|
diff --git a/bin/cli.js b/bin/cli.js
index <HASH>..<HASH> 100755
--- a/bin/cli.js
+++ b/bin/cli.js
@@ -54,10 +54,10 @@ function toArray(value) {
function toNumber(value) {
if (!value || value === "false") {
- return 0;
+ return false;
}
else if (value === "true") {
- return 1;
+ return true;
}
else {
return Number(value);
|
changed the coercion of multiprocess in the cli to convert to boolean or number
|
MiguelCastillo_bit-bundler
|
train
|
js
|
3be28c760e905eeb60cdccacab5996aaeb949cf4
|
diff --git a/tags/raw.js b/tags/raw.js
index <HASH>..<HASH> 100644
--- a/tags/raw.js
+++ b/tags/raw.js
@@ -5,7 +5,7 @@ var Raw = x.createClass({
html: x.type.string
},
init: function() {
- x.event.on(this, "update", this.updateHTML);
+ x.event.on(this, "updated", this.updateHTML);
},
updateHTML: function() {
this.root.innerHTML = this.props.html;
|
follow react style: update dom manually after "updated" event instead of "update".
|
x-view_x-view
|
train
|
js
|
c313bbb76696b5c906deb8305189f07cae10f601
|
diff --git a/eval.go b/eval.go
index <HASH>..<HASH> 100644
--- a/eval.go
+++ b/eval.go
@@ -650,7 +650,14 @@ func notNil(v reflect.Value) bool {
}
}
-func (st *Runtime) isSet(node Node) bool {
+func (st *Runtime) isSet(node Node) (ok bool) {
+ defer func() {
+ if r := recover(); r != nil {
+ // something panicked while evaluating node
+ ok = false
+ }
+ }()
+
nodeType := node.Type()
switch nodeType {
|
recover from panics that happen when evaluating an expression inside isset()
|
CloudyKit_jet
|
train
|
go
|
3317899440419b313807b62113fbd09c3037a368
|
diff --git a/app/templates/entry/client-prefetch.js b/app/templates/entry/client-prefetch.js
index <HASH>..<HASH> 100644
--- a/app/templates/entry/client-prefetch.js
+++ b/app/templates/entry/client-prefetch.js
@@ -104,8 +104,8 @@ export function addPreFetchHooks (router<%= store ? ', store' : '' %>, publicPat
preFetchList.reduce(
(promise, preFetch) => promise.then(() => hasRedirected === false && preFetch({
<% if (store) { %>store,<% } %>
- currentRoute: to.value,
- previousRoute: from.value,
+ currentRoute: to,
+ previousRoute: from,
redirect,
urlPath,
publicPath
|
fix(app): preFetch's currentRoute is a ref instead of the actual value #<I>
|
quasarframework_quasar
|
train
|
js
|
b6f36a48fc65aab41f46afb6a163b217433d56cb
|
diff --git a/src/FelixOnline/Core/Issue.php b/src/FelixOnline/Core/Issue.php
index <HASH>..<HASH> 100644
--- a/src/FelixOnline/Core/Issue.php
+++ b/src/FelixOnline/Core/Issue.php
@@ -177,7 +177,9 @@ class Issue {
'issue_no' => $this->issueno,
'pub_no' => $this->pubno,
'description' => $this->description,
- 'year' => $this->year);
+ 'year' => $this->year,
+ 'url' => $this->getURL(),
+ 'download_url' => $this->getDownloadURL());
}
}
|
Add more fields to the issue class outputter by default as they
dont require a JOIN to the files table.
|
FelixOnline_BaseApp
|
train
|
php
|
4f015f063e79e972ba7c21f446e8d5ef1746a6bc
|
diff --git a/src/main/java/com/cloudbees/jenkins/support/impl/GCLogs.java b/src/main/java/com/cloudbees/jenkins/support/impl/GCLogs.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/cloudbees/jenkins/support/impl/GCLogs.java
+++ b/src/main/java/com/cloudbees/jenkins/support/impl/GCLogs.java
@@ -66,17 +66,11 @@ public class GCLogs extends Component {
}
@Override
- public boolean isEnabled() {
- boolean gcLogsConfigured = getGcLogFileLocation() != null;
- LOGGER.fine("GC logs configured: " + gcLogsConfigured);
- return super.isEnabled() && gcLogsConfigured;
- }
-
- @Override
public void addContents(@NonNull Container result) {
LOGGER.fine("Trying to gather GC logs for support bundle");
String gcLogFileLocation = getGcLogFileLocation();
if (gcLogFileLocation == null) {
+ LOGGER.config("No GC logging enabled, nothing about it will be retrieved for support bundle.");
return;
}
|
Simply ignore if the GC logging options are not enabled
isEnabled() was actually designed for security. So it shows a crossed
line for that Component currently, ugly.
|
jenkinsci_support-core-plugin
|
train
|
java
|
6030d30998cbdc08570b8837c99e29fe67ae8091
|
diff --git a/framer.py b/framer.py
index <HASH>..<HASH> 100644
--- a/framer.py
+++ b/framer.py
@@ -33,8 +33,6 @@ class Framer:
:param message: a list of bytes to send
:return: None
"""
- self._port.write([self._START_OF_FRAME])
-
message = message if isinstance(message, list) else [message]
length = len(message)
@@ -47,14 +45,18 @@ class Framer:
message_with_length.append(sum1)
message_with_length.append(sum2)
+ message = [self._START_OF_FRAME]
+
for b in message_with_length:
if b in [self._START_OF_FRAME, self._END_OF_FRAME, self._ESC]:
- self._port.write([self._ESC])
- self._port.write([b ^ self._ESC_XOR])
+ message.append(self._ESC)
+ message.append(b ^ self._ESC_XOR)
else:
- self._port.write([b])
+ message.append(b)
+
+ message.append(self._END_OF_FRAME)
- self._port.write([self._END_OF_FRAME])
+ self._port.write(message)
def rx(self):
"""
|
Optimized pyserial transmission
|
slightlynybbled_booty
|
train
|
py
|
914542ac9a50d36919eeb8d198c09bd4d6680707
|
diff --git a/lib/moory/version.rb b/lib/moory/version.rb
index <HASH>..<HASH> 100644
--- a/lib/moory/version.rb
+++ b/lib/moory/version.rb
@@ -1,3 +1,3 @@
module Moory
- VERSION = "0.3.1"
+ VERSION = "0.3.2"
end
|
Bump moory to <I>
|
elclavijero_moory
|
train
|
rb
|
8f0fba5ce0377a697067333610e882dfe95130a5
|
diff --git a/lib/wiki_to_markdown.php b/lib/wiki_to_markdown.php
index <HASH>..<HASH> 100644
--- a/lib/wiki_to_markdown.php
+++ b/lib/wiki_to_markdown.php
@@ -396,4 +396,3 @@ class WikiToMarkdown {
}
}
?>
-
|
nasty empty line at the end of file ....
|
moodle_moodle
|
train
|
php
|
76e395a7428193ce4b5bb986add9bbd43bc17b86
|
diff --git a/spec/unit/lib/infrataster/resources/server_resource_spec.rb b/spec/unit/lib/infrataster/resources/server_resource_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/lib/infrataster/resources/server_resource_spec.rb
+++ b/spec/unit/lib/infrataster/resources/server_resource_spec.rb
@@ -3,10 +3,11 @@ require 'unit/spec_helper'
module Infrataster
module Resources
describe ServerResource do
- context "when address invoked" do
- it "returns address" do
- app_server = Server.new('name', '127.0.0.2')
- expect(app_server.address).to eq('127.0.0.2')
+ context 'when invoked address' do
+ it 'returns an address' do
+ Server.define(:app, '127.0.0.1')
+ i = described_class.new(:app)
+ expect(i.address).to eq('127.0.0.1')
end
end
end
|
bugfix: test the described_class, not Server instance
|
ryotarai_infrataster
|
train
|
rb
|
a534d29daf628fc82a1b393ec2b8f37ee53f4e8c
|
diff --git a/app/inputs/rich_picker_input.rb b/app/inputs/rich_picker_input.rb
index <HASH>..<HASH> 100644
--- a/app/inputs/rich_picker_input.rb
+++ b/app/inputs/rich_picker_input.rb
@@ -16,14 +16,13 @@ if (Object.const_defined?("Formtastic") && Gem.loaded_specs["formtastic"].versio
if scope_id
rich_file = Rich::RichFile.find(scope_id)
img_path = rich_file.rich_file(editor_options[:preview_size])
+ if editor_options[:preview_size]
+ img_width = rich_file.set_styles[editor_options[:preview_size]].split('x').first
+ end
else
img_path = editor_options[:placeholder_image]
end
- if editor_options[:preview_size]
- img_width = rich_file.set_styles[editor_options[:preview_size]].split('x').first
- end
-
label_html <<
if editor_options[:hidden_input] == true
field = builder.hidden_field(method, local_input_options.merge(input_html_options))
|
method called on nil, fixed
|
kreativgebiet_rich
|
train
|
rb
|
3f7d40303f73264d72be0f0e68a71c57e7c4c76d
|
diff --git a/src/sap.m/src/sap/m/P13nConditionPanel.js b/src/sap.m/src/sap/m/P13nConditionPanel.js
index <HASH>..<HASH> 100644
--- a/src/sap.m/src/sap/m/P13nConditionPanel.js
+++ b/src/sap.m/src/sap/m/P13nConditionPanel.js
@@ -1771,7 +1771,6 @@ sap.ui.define([
this._enableCondition(oConditionGrid, true);
sValue = this._getFormatedConditionText(sOperation, sValue1, sValue2, bExclude, sKeyField, bShowIfGrouped);
- window.console.log(sValue);
var oConditionData = {
"value": sValue,
|
[INTERNAL][FIX] P<I>nConditionPanel: log removed which fails on IE9
testes
Change-Id: I<I>f<I>dd<I>a<I>a<I>dcf8e<I>e<I>a<I>e<I>
|
SAP_openui5
|
train
|
js
|
36c46b2618646af8c7ffb7d68ecaed783af25c35
|
diff --git a/src/main/java/com/aoindustries/sql/AOConnectionPool.java b/src/main/java/com/aoindustries/sql/AOConnectionPool.java
index <HASH>..<HASH> 100755
--- a/src/main/java/com/aoindustries/sql/AOConnectionPool.java
+++ b/src/main/java/com/aoindustries/sql/AOConnectionPool.java
@@ -1,6 +1,6 @@
/*
* aocode-public - Reusable Java library of general tools with minimal external dependencies.
- * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2015, 2016 AO Industries, Inc.
+ * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2015, 2016, 2018 AO Industries, Inc.
* [email protected]
* 7262 Bull Pen Cir
* Mobile, AL 36695
@@ -142,6 +142,7 @@ final public class AOConnectionPool extends AOPool<Connection,SQLException,SQLEx
boolean successful = false;
try {
if(Thread.interrupted()) throw new SQLException("Thread interrupted");
+ // TODO: This hides the PgConnection, which prevents registering PGobject. Find another way or don't worry about this and deprecate
if(conn.getClass().getName().startsWith("org.postgresql.")) {
// getTransactionIsolation causes a round-trip to the database, this wrapper caches the value and avoids unnecessary sets
// to eliminate unnecessary round-trips and improve performance over high-latency links.
|
Noted that wrapper blocks use of PGobject.
|
aoindustries_aocode-public
|
train
|
java
|
1be42a7d48bf96596734bd353c38de7d1d440c4c
|
diff --git a/driver/src/main/java/org/kaazing/k3po/driver/internal/behavior/handler/event/AbstractEventHandler.java b/driver/src/main/java/org/kaazing/k3po/driver/internal/behavior/handler/event/AbstractEventHandler.java
index <HASH>..<HASH> 100644
--- a/driver/src/main/java/org/kaazing/k3po/driver/internal/behavior/handler/event/AbstractEventHandler.java
+++ b/driver/src/main/java/org/kaazing/k3po/driver/internal/behavior/handler/event/AbstractEventHandler.java
@@ -106,8 +106,7 @@ public abstract class AbstractEventHandler extends ExecutionHandler {
handleUpstream1(ctx, evt);
}
});
- }
- if (!pipelineFuture.isSuccess()) {
+ } else if (!pipelineFuture.isSuccess()) {
// expected event arrived too early
Exception exception = new ScriptProgressException(getRegionInfo(), format("%s", this));
handlerFuture.setFailure(exception.fillInStackTrace());
|
Fixed if else statements to be inclusive
|
k3po_k3po
|
train
|
java
|
fac4bca4f49c3dc34ff57851d59fba64790d1e31
|
diff --git a/tests/test_request_timeout.py b/tests/test_request_timeout.py
index <HASH>..<HASH> 100644
--- a/tests/test_request_timeout.py
+++ b/tests/test_request_timeout.py
@@ -12,7 +12,7 @@ request_timeout_default_app = Sanic('test_request_timeout_default')
@request_timeout_app.route('/1')
async def handler_1(request):
- await asyncio.sleep(1)
+ await asyncio.sleep(2)
return text('OK')
@@ -29,7 +29,7 @@ def test_server_error_request_timeout():
@request_timeout_default_app.route('/1')
async def handler_2(request):
- await asyncio.sleep(1)
+ await asyncio.sleep(2)
return text('OK')
|
Fix test_request_timeout.py
This increases sleep time, Because sometimes timeout error does not occur.
|
huge-success_sanic
|
train
|
py
|
ce181cee5b764ccb1c1f01af5861a1118841ae2b
|
diff --git a/src/main/java/javax/time/calendar/Year.java b/src/main/java/javax/time/calendar/Year.java
index <HASH>..<HASH> 100644
--- a/src/main/java/javax/time/calendar/Year.java
+++ b/src/main/java/javax/time/calendar/Year.java
@@ -706,7 +706,7 @@ public final class Year
*/
@Override
public String toString() {
- return "Year=" + Integer.toString(year);
+ return Integer.toString(year);
}
}
diff --git a/src/test/java/javax/time/calendar/TestYear.java b/src/test/java/javax/time/calendar/TestYear.java
index <HASH>..<HASH> 100644
--- a/src/test/java/javax/time/calendar/TestYear.java
+++ b/src/test/java/javax/time/calendar/TestYear.java
@@ -899,7 +899,7 @@ public class TestYear {
public void test_toString() {
for (int i = -4; i <= 2104; i++) {
Year a = Year.of(i);
- assertEquals(a.toString(), "Year=" + i);
+ assertEquals(a.toString(), "" + i);
}
}
|
Year.toString() simplification, ISO in line with YearMonth and MonthDay
|
ThreeTen_threetenbp
|
train
|
java,java
|
b2dfe38640bd77e72b22a83c158c8c945d853d1b
|
diff --git a/opal/clearwater/component.rb b/opal/clearwater/component.rb
index <HASH>..<HASH> 100644
--- a/opal/clearwater/component.rb
+++ b/opal/clearwater/component.rb
@@ -1,6 +1,5 @@
require 'clearwater/virtual_dom'
require 'browser'
-require 'set'
module Clearwater
module Component
|
Remove unnecessary require
We used to use a Set here, but we don't anymore.
|
clearwater-rb_clearwater
|
train
|
rb
|
1438967875322462d5500ec56918e6390338c26f
|
diff --git a/dictmixin/__init__.py b/dictmixin/__init__.py
index <HASH>..<HASH> 100644
--- a/dictmixin/__init__.py
+++ b/dictmixin/__init__.py
@@ -13,7 +13,7 @@ except ImportError:
pass
__title__ = 'dictmixin'
-__version__ = '1.0.0a2'
+__version__ = '1.0.0b1'
__author__ = 'tadashi-aikawa'
__license__ = 'MIT'
|
:package: version <I>b1
|
tadashi-aikawa_owlmixin
|
train
|
py
|
f08b30d6ba0b62aaab2e0e4efe5187b233305b7e
|
diff --git a/sql/postgres.go b/sql/postgres.go
index <HASH>..<HASH> 100644
--- a/sql/postgres.go
+++ b/sql/postgres.go
@@ -55,8 +55,14 @@ func (this *Postgres) Open() error {
// bootstrap the system schema
err1 := postgres_schema.Initialize(db)
glog.Infoln("Initialized system schema:", err1)
+ if err1 != nil {
+ panic(err1)
+ }
err2 := postgres_schema.PrepareStatements(db)
glog.Infoln("Prepared statements:", err2)
+ if err2 != nil {
+ panic(err2)
+ }
})
err = sync_schemas(this.conn, this.Schemas, this.DoCreateSchemas, this.DoUpdateSchemas)
if err != nil {
|
Panic when failed to initialize db
|
qorio_omni
|
train
|
go
|
565e8c2d3681cecb6a79c7293ea54376e577410f
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -77,11 +77,13 @@ module.exports.unbind = function (element, fn) {
if (attachEvent) {
element.detachEvent('onresize', resizeListener)
} else if (element.__resizeTrigger__) {
- element.__resizeTrigger__.contentDocument.defaultView.removeEventListener(
- 'resize',
- resizeListener
- )
- delete element.__resizeTrigger__.contentDocument.defaultView.__resizeTrigger__
+ if (element.__resizeTrigger__.contentDocument && element.__resizeTrigger__.contentDocument.defaultView) {
+ element.__resizeTrigger__.contentDocument.defaultView.removeEventListener(
+ 'resize',
+ resizeListener
+ )
+ delete element.__resizeTrigger__.contentDocument.defaultView.__resizeTrigger__
+ }
element.__resizeTrigger__ = !element.removeChild(
element.__resizeTrigger__
)
|
Fix accessing contentDocument on unbind when it is null
|
KyleAMathews_element-resize-event
|
train
|
js
|
ad7a87f471366a08ab8ec2bf78fc3c3eeadd8912
|
diff --git a/lib/IDS/Monitor.php b/lib/IDS/Monitor.php
index <HASH>..<HASH> 100644
--- a/lib/IDS/Monitor.php
+++ b/lib/IDS/Monitor.php
@@ -284,7 +284,7 @@ class IDS_Monitor
// to increase performance, only start detection if value
// isn't alphanumeric
- if (!(preg_match('/[^\w\s\/@!?,]+/ims', $value) && $value)) {
+ if (!$value || !preg_match('/[^\w\s\/@!?,]+/', $value)) {
return false;
}
|
changed the pre-check for the string to check slightly for better performance and readability
|
PHPIDS_PHPIDS
|
train
|
php
|
1d120b6b3aefe6efaa3f7d9254edb7c906a034b0
|
diff --git a/packages/button/src/Button.js b/packages/button/src/Button.js
index <HASH>..<HASH> 100644
--- a/packages/button/src/Button.js
+++ b/packages/button/src/Button.js
@@ -160,6 +160,10 @@ const buttonStyles = props => {
// vertically align correctly without setting the lineHeight equal to the
// smallest fontSize (or smaller).
lineHeight: theme.ButtonContent_fontSize_small,
+ // if the user puts in a small icon in a large button
+ // we want to force the button to be round/square
+ // (really just pertinent on icon-only buttons)
+ minWidth: theme[`Button_size_${size}`],
// Because we use boxSizing: 'border-box', we need to substract the borderWidth
// from the padding to have the fixed height of Root and Content be correct.
padding: `${parseFloat(theme[`Button_padding_${size}`]) -
@@ -247,8 +251,10 @@ const contentStyles = props => {
};
const innerStyles = {
+ alignItems: 'center',
display: 'inline-flex',
justifyContent: 'center',
+ maxHeight: '100%',
width: '100%'
};
|
fix(button): Fix vertical alignment
|
mineral-ui_mineral-ui
|
train
|
js
|
3b52faab0bd7e7ae332c7133f84134332cf0586f
|
diff --git a/src/livestreamer_cli/utils.py b/src/livestreamer_cli/utils.py
index <HASH>..<HASH> 100644
--- a/src/livestreamer_cli/utils.py
+++ b/src/livestreamer_cli/utils.py
@@ -174,7 +174,7 @@ def ignored(*exceptions):
def check_paths(exes, paths):
for path in paths:
for exe in exes:
- path = os.path.join(path, exe)
+ path = os.path.expanduser(os.path.join(path, exe))
if os.path.isfile(path):
return path
|
cli: Expand ~ in default player paths.
Resolves #<I>.
|
streamlink_streamlink
|
train
|
py
|
56f26248ddc0c3dd16ad1c3420410a0faa9b9751
|
diff --git a/holoviews/element/raster.py b/holoviews/element/raster.py
index <HASH>..<HASH> 100644
--- a/holoviews/element/raster.py
+++ b/holoviews/element/raster.py
@@ -569,8 +569,13 @@ class QuadMesh(Raster):
def _process_data(self, data):
- data = tuple(np.array(el) for el in data)
- x, y, zarray = data
+ if isinstance(data, Image):
+ x = data.dimension_values(0, expanded=False)
+ y = data.dimension_values(1, expanded=False)
+ zarray = data.dimension_values(2, flat=False)
+ else:
+ data = tuple(np.array(el) for el in data)
+ x, y, zarray = data
ys, xs = zarray.shape
if x.ndim == 1 and len(x) == xs:
x = compute_edges(x)
|
Allow casting Image to QuadMesh
|
pyviz_holoviews
|
train
|
py
|
002f41ed28e687ef954b5837c66f27c32f34634e
|
diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py
index <HASH>..<HASH> 100755
--- a/tools/run_tests/run_interop_tests.py
+++ b/tools/run_tests/run_interop_tests.py
@@ -89,10 +89,10 @@ class CXXLanguage:
return {}
def unimplemented_test_cases(self):
- return []
+ return _SKIP_ADVANCED
def unimplemented_test_cases_server(self):
- return []
+ return _SKIP_ADVANCED
def __str__(self):
return 'c++'
|
reverted changes to interop test driver to avoid clashes with mark roths pull req
|
grpc_grpc
|
train
|
py
|
9b6f8b69a7449fbf620d261dcfe0b2097949c17e
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -180,7 +180,7 @@ let extractByExtractor = function (data, extractor, {
} else if (["website"].includes(extractor)) {
let websites = data.match(websiteRegex)
-
+
if (websites && websites.length > 0) {
websites = websites.map(function (x) {
return x.substr(1, x.length) // remove first character
@@ -205,7 +205,12 @@ let extractByExtractor = function (data, extractor, {
result = data.match(emailRegex) !== null ? data.match(emailRegex)[0] : ""
}
} else if (["date", "d"].includes(extractor)) {
- result = chrono.casual.parseDate(data).toString()
+ let date = chrono.casual.parseDate(data)
+ if (date) {
+ result = chrono.casual.parseDate(data).toString()
+ } else {
+ result = ""
+ }
} else if (["fullName", "prenom", "firstName", "nom", "lastName", "initials", "suffix", "salutation"].includes(extractor)) {
// compact data before to parse it
result = humanname.parse(filterData(data, "cmp"))
@@ -340,7 +345,7 @@ module.exports = function ($) {
multiple: multiple
})
- if(_.isArray(r) && r.length === 1){
+ if (_.isArray(r) && r.length === 1) {
r = r[0]
}
|
Fix when no date to extract with < date
|
gahabeen_jsonframe-cheerio
|
train
|
js
|
25f88793e2b0c28ba3dc7cedf55d12d60a95d44c
|
diff --git a/embed_video/tests/tests_fields.py b/embed_video/tests/tests_fields.py
index <HASH>..<HASH> 100644
--- a/embed_video/tests/tests_fields.py
+++ b/embed_video/tests/tests_fields.py
@@ -45,3 +45,10 @@ class EmbedVideoFormFieldTestCase(TestCase):
with patch('embed_video.fields.detect_backend') as mock_detect_backend:
mock_detect_backend.return_value = True
self.assertEqual(url, self.formfield.validate(url))
+
+ def test_validation_super(self):
+ self.assertRaises(ValidationError, self.formfield.validate, '')
+
+ def test_validation_allowed_empty(self):
+ formfield = EmbedVideoFormField(required=False)
+ self.assertIsNone(formfield.validate(''))
|
Add tests for embed_video.fields
|
jazzband_django-embed-video
|
train
|
py
|
99d2fea3417ebd4f863fdc76061ef12f23469ee6
|
diff --git a/src/aiosmtplib/protocol.py b/src/aiosmtplib/protocol.py
index <HASH>..<HASH> 100644
--- a/src/aiosmtplib/protocol.py
+++ b/src/aiosmtplib/protocol.py
@@ -264,11 +264,7 @@ class SMTPProtocol(asyncio.Protocol):
"""
if self._over_ssl:
raise RuntimeError("Already using TLS.")
- if (
- self.transport is None
- or self.transport.is_closing()
- or self._command_lock is None
- ):
+ if self._command_lock is None:
raise SMTPServerDisconnected("Not connected")
async with self._command_lock:
@@ -277,6 +273,10 @@ class SMTPProtocol(asyncio.Protocol):
if response.code != SMTPStatus.ready:
raise SMTPResponseException(response.code, response.message)
+ # Check for disconnect after response
+ if self.transport is None or self.transport.is_closing():
+ raise SMTPServerDisconnected("Not connected")
+
try:
tls_transport = await start_tls(
self._loop,
|
Check for disconnection between STARTTLS and handshake
|
cole_aiosmtplib
|
train
|
py
|
cc703ed5b68688c064675262abcd12ea6b9eea8d
|
diff --git a/server/irc/connection.js b/server/irc/connection.js
index <HASH>..<HASH> 100644
--- a/server/irc/connection.js
+++ b/server/irc/connection.js
@@ -651,7 +651,7 @@ var parse = function (data) {
// If we have an incomplete line held from the previous chunk of data
// merge it with the first line from this chunk of data
if (this.hold_last && this.held_data !== null) {
- bufs[0] = Buffer.concat([this.held_data, bufs[0]]);
+ bufs[0] = Buffer.concat([this.held_data, bufs[0]], this.held_data.length + bufs[0].length);
this.hold_last = false;
this.held_data = null;
}
|
Pass new buffer length to Buffer.concat (it's faster)
As per <URL>
|
prawnsalad_KiwiIRC
|
train
|
js
|
395dc2e37881d9021bb6211055888e8e6c86ffef
|
diff --git a/app/element/elementBuilder.js b/app/element/elementBuilder.js
index <HASH>..<HASH> 100644
--- a/app/element/elementBuilder.js
+++ b/app/element/elementBuilder.js
@@ -91,6 +91,7 @@ _.extend(ElementBuilder.prototype, /** @lends ElementBuilder.prototype */ {
var propertyMetadata = metadata[propertyName];
var element = params.element;
var lowerCasePropertyName = propertyName.toLowerCase();
+ var converter;
if(!propertyMetadata || typeof propertyMetadata != 'object'){
if(propertyMetadata !== undefined){
@@ -109,11 +110,15 @@ _.extend(ElementBuilder.prototype, /** @lends ElementBuilder.prototype */ {
if(isBooleanBinding){
dataBinding.setMode(BindingModes.toElement);
- dataBinding.setConverter({
- toElement: function (context, args) {
- return !!args.value;
- }
- });
+
+ converter = dataBinding.getConverter();
+ if(!converter || _.size(converter) == 0){
+ dataBinding.setConverter({
+ toElement: function (context, args) {
+ return !!args.value;
+ }
+ });
+ }
}
dataBinding.bindElement(element, lowerCasePropertyName);
|
prevent setting converter if some one already setted
|
InfinniPlatform_InfinniUI
|
train
|
js
|
89331d2558d9c94566d08cdce2026d8898e12c62
|
diff --git a/lib/boletosimples/version.rb b/lib/boletosimples/version.rb
index <HASH>..<HASH> 100644
--- a/lib/boletosimples/version.rb
+++ b/lib/boletosimples/version.rb
@@ -1,3 +1,3 @@
module BoletoSimples
- VERSION = '0.0.4'
+ VERSION = '0.0.5'
end
|
bump up version to <I>
|
BoletoSimples_boletosimples-ruby
|
train
|
rb
|
e187266de6db1c8ffd1426272b7b42448657c70e
|
diff --git a/buffer/pool.go b/buffer/pool.go
index <HASH>..<HASH> 100644
--- a/buffer/pool.go
+++ b/buffer/pool.go
@@ -252,6 +252,8 @@ func (r *readCloser) Close() error {
for _, buf := range r.bufs {
putBuf(buf)
}
+ // In case Close gets called multiple times.
+ r.bufs = nil
return nil
}
|
Prevent bugs caused by multiple Close
See: <URL>
|
mailru_easyjson
|
train
|
go
|
48060c87511ef4e50e643fa0877817982e859225
|
diff --git a/ws-fallback.js b/ws-fallback.js
index <HASH>..<HASH> 100644
--- a/ws-fallback.js
+++ b/ws-fallback.js
@@ -1 +1 @@
-module.exports = window.WebSocket || window.MozWebSocket
+module.exports = WebSocket || MozWebSocket || window.WebSocket || window.MozWebSocket
|
Update ws-fallback.js
this should fix maxogden/websocket-stream/issues/<I>, as it exports WebSocket and MozWebSocket first and if not defined then tries to export from window.
|
maxogden_websocket-stream
|
train
|
js
|
afc5f8cc510e2ce558248a8dc41b9500b806a4b9
|
diff --git a/lib/matchRoutes.js b/lib/matchRoutes.js
index <HASH>..<HASH> 100644
--- a/lib/matchRoutes.js
+++ b/lib/matchRoutes.js
@@ -50,10 +50,9 @@ function matchRoute(route, path) {
if (route.pattern) {
var match = route.pattern.match(path);
- if (match) {
- // so that _ doesn't appear where not needed
- match._ = !match._ || match._[0] === '/' || match._[0] === ''
- ? undefined : match._;
+ if (match
+ && (!match._ || match._[0] === '/' || match._[0] === '')) {
+ delete match._;
}
return match;
|
matchRoutes: fix _: undefined
|
andreypopp_rrouter
|
train
|
js
|
9cbf0dcda25f4dbb515c307bba4e9c86c18ec91e
|
diff --git a/lib/vestal_versions/creation.rb b/lib/vestal_versions/creation.rb
index <HASH>..<HASH> 100644
--- a/lib/vestal_versions/creation.rb
+++ b/lib/vestal_versions/creation.rb
@@ -13,7 +13,7 @@ module VestalVersions
end
def create_version
- versions.create(:changes => version_changes, :number => last_version + 1)
+ versions.create(version_attributes)
reset_version_changes
reset_version
end
@@ -36,5 +36,9 @@ module VestalVersions
else self.class.column_names
end - %w(created_at created_on updated_at updated_on)
end
+
+ def version_attributes
+ {:changes => version_changes, :number => last_version + 1}
+ end
end
end
|
Extracted the attributes hash passed to a created version out to its own method (for easy hijacking).
|
laserlemon_vestal_versions
|
train
|
rb
|
a7395e56032a708480310f4b28f930109e3f5c67
|
diff --git a/validator/sawtooth_validator/journal/journal.py b/validator/sawtooth_validator/journal/journal.py
index <HASH>..<HASH> 100644
--- a/validator/sawtooth_validator/journal/journal.py
+++ b/validator/sawtooth_validator/journal/journal.py
@@ -176,6 +176,7 @@ class Journal(object):
self._batch_queue = queue.Queue()
self._publisher_thread = None
+ self._executor_threadpool = ThreadPoolExecutor(1)
self._chain_controller = None
self._block_queue = queue.Queue()
self._chain_thread = None
@@ -206,7 +207,7 @@ class Journal(object):
block_sender=self._block_sender,
block_cache=self._block_cache,
state_view_factory=self._state_view_factory,
- executor=ThreadPoolExecutor(1),
+ executor=self._executor_threadpool,
transaction_executor=self._transaction_executor,
chain_head_lock=self._block_publisher.chain_head_lock,
on_chain_updated=self._block_publisher.on_chain_updated,
@@ -241,6 +242,8 @@ class Journal(object):
def stop(self):
# time to murder the child threads. First ask politely for
# suicide
+ self._executor_threadpool.shutdown(wait=True)
+
if self._publisher_thread is not None:
self._publisher_thread.stop()
self._publisher_thread = None
|
Make sure that the ChainController executor ThreadPool is shutdown
|
hyperledger_sawtooth-core
|
train
|
py
|
13f0b96aa8bfcd108f5fdd90371b936f3d50501e
|
diff --git a/src/tests/bootstrap.php b/src/tests/bootstrap.php
index <HASH>..<HASH> 100644
--- a/src/tests/bootstrap.php
+++ b/src/tests/bootstrap.php
@@ -1,5 +1,6 @@
<?php
+/** @noinspection PhpIncludeInspection */
$loader = require __DIR__ .'/../vendors/autoload.php';
$loader->add(null, __DIR__);
|
Suppressing expected inspection error.
|
box-project_box2
|
train
|
php
|
91b43898b0ceff3bc2b9f0a163775cc8277046ae
|
diff --git a/lib/hope/source/sub.rb b/lib/hope/source/sub.rb
index <HASH>..<HASH> 100644
--- a/lib/hope/source/sub.rb
+++ b/lib/hope/source/sub.rb
@@ -9,7 +9,7 @@ module Hope
@socket = opts["socket"] || "ipc://hope"
@event_type = opts["event_type"]
@received = { :success => 0, :errors => 0, :latest_error => "" }
- @sub = Hope.ctx.connect ZMQ::SUB, @socket, self
+ @sub = Hope.ctx.bind ZMQ::SUB, @socket, self
@sub.subscribe name
Hope::Source.register self
end
|
Sub source now bind to zmq socket by default (instead of connect)
|
sbellity_hope
|
train
|
rb
|
63eba1da35a80c1df24175ab460db1359a3ddec0
|
diff --git a/tensorflow_probability/python/stats/quantiles.py b/tensorflow_probability/python/stats/quantiles.py
index <HASH>..<HASH> 100644
--- a/tensorflow_probability/python/stats/quantiles.py
+++ b/tensorflow_probability/python/stats/quantiles.py
@@ -552,7 +552,7 @@ def percentile(x,
# Sort (in ascending order) everything which allows multiple calls to sort
# only once (under the hood) and use CSE.
- sorted_y = _sort_tensor(y)
+ sorted_y = tf.sort(y, axis=-1, direction='ASCENDING')
d = tf.cast(tf.shape(y)[-1], tf.float64)
@@ -893,11 +893,3 @@ def _move_dims_to_flat_end(x, axis, x_ndims, right_end=True):
full_shape = tf.concat(
[other_shape, [-1]] if right_end else [[-1], other_shape], axis=0)
return tf.reshape(x_permed, shape=full_shape)
-
-
-def _sort_tensor(tensor):
- """Use `sort` to sort a `Tensor` in ascending order along
- the last dimension."""
- sorted_ = tf.sort(tensor, axis=-1, direction='ASCENDING')
- tensorshape_util.set_shape(sorted_, tensor.shape)
- return sorted_
|
Remove _sort_tensor as can be done in 1 line
As _sort_tensor can be achived with 1 call to tf.sort and _sort_tensor
is used only once in quantile.py then it can be removed and replaced
with a single call to tf.sort isntead with no loss of clarity.
|
tensorflow_probability
|
train
|
py
|
04e251281a4e54629b469d74ed52a00278bc9252
|
diff --git a/pointerplus.php b/pointerplus.php
index <HASH>..<HASH> 100644
--- a/pointerplus.php
+++ b/pointerplus.php
@@ -5,12 +5,8 @@
* @author QueryLoop & Mte90
* @license GPL-3.0+
* @link http://mte90.net
- * @copyright 2014-2016 GPL
+ * @copyright 2014-2018 GPL
*/
-// Exit if accessed directly
-if ( !defined( 'ABSPATH' ) ) {
- exit;
-}
/**
* Super pointer creation for WP Admin
|
remove absinth for better compatibility with composer
|
WPBP_PointerPlus
|
train
|
php
|
e264e6776446ec490c537b0067a3bb73e0a18906
|
diff --git a/tor/onionaddr.go b/tor/onionaddr.go
index <HASH>..<HASH> 100644
--- a/tor/onionaddr.go
+++ b/tor/onionaddr.go
@@ -27,7 +27,7 @@ const (
// V3DecodedLen is the length of a decoded v3 onion service.
V3DecodedLen = 35
- // V3Len is the length of a v2 onion service including the ".onion"
+ // V3Len is the length of a v3 onion service including the ".onion"
// suffix.
V3Len = 62
)
|
Fixed typo in comment
Caught a typo, fixed it.
|
lightningnetwork_lnd
|
train
|
go
|
1841032dbe74f88b6c336bd74c43d39e34490fe9
|
diff --git a/go/libkb/version.go b/go/libkb/version.go
index <HASH>..<HASH> 100644
--- a/go/libkb/version.go
+++ b/go/libkb/version.go
@@ -15,7 +15,7 @@ import (
const Version = "1.0.0"
// Build number
-const Build = "44"
+const Build = "45"
// VersionString returns semantic version string.
func VersionString() string {
|
Bump build number to <I>
|
keybase_client
|
train
|
go
|
92f5d3b7db17fb16603e3bd5263e5057dcae72a7
|
diff --git a/openstack/resource_openstack_compute_secgroup_v2_test.go b/openstack/resource_openstack_compute_secgroup_v2_test.go
index <HASH>..<HASH> 100644
--- a/openstack/resource_openstack_compute_secgroup_v2_test.go
+++ b/openstack/resource_openstack_compute_secgroup_v2_test.go
@@ -137,7 +137,7 @@ func TestAccComputeV2SecGroup_lowerCaseCIDR(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testAccCheckComputeV2SecGroupExists("openstack_compute_secgroup_v2.sg_1", &secgroup),
resource.TestCheckResourceAttr(
- "openstack_compute_secgroup_v2.sg_1", "rule.3862435458.cidr", "2001:558:fc00::/39"),
+ "openstack_compute_secgroup_v2.sg_1", "rule.768649014.cidr", "2001:558:fc00::/39"),
),
},
},
@@ -366,9 +366,9 @@ resource "openstack_compute_secgroup_v2" "sg_1" {
name = "sg_1"
description = "first test security group"
rule {
- from_port = 0
- to_port = 0
- ip_protocol = "icmp"
+ from_port = 22
+ to_port = 22
+ ip_protocol = "tcp"
cidr = "2001:558:FC00::/39"
}
}
|
Acc Tests: Update lowercase security group test (#<I>)
A recent update to Neutron will cause an ipv6 icmp security group rule
to be returned with a protocol of ipv6-icmp.
We can't update the test to use ipv6-icmp since Nova does not allow this
protocol type.
As a workaround, we change the protocol to tcp.
|
terraform-providers_terraform-provider-openstack
|
train
|
go
|
14e8b9e3a8f4292edf30bfe871d0a1bd9218f896
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -55,6 +55,7 @@ package_data_dirs = []
package_path(join(SERVER, 'static'), package_data_dirs)
package_path(join(SERVER, 'templates'), package_data_dirs)
package_path('bokeh/templates', package_data_dirs)
+package_data_dirs.append('server/redis.conf')
suffix_list = ('.csv','.conf','.gz','.json')
##scan sampledata for files with the above extensions and add to pkg_data_dirs
|
accidentally deleted server/redis.conf from setup.py
|
bokeh_bokeh
|
train
|
py
|
43daa69bcb739f193ad4c0b1ad096b181c0d3759
|
diff --git a/spec/origin/selectable_spec.rb b/spec/origin/selectable_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/origin/selectable_spec.rb
+++ b/spec/origin/selectable_spec.rb
@@ -4218,5 +4218,21 @@ describe Origin::Selectable do
end
end
end
+
+ context "when using the strategies via #where" do
+
+ context "when the values are a hash" do
+
+ let(:selection) do
+ query.where(:field.gt => 5, :field.lt => 10, :field.ne => 7)
+ end
+
+ it "merges the strategies on the same field" do
+ selection.selector.should eq(
+ { "field" => { "$gt" => 5, "$lt" => 10, "$ne" => 7 }}
+ )
+ end
+ end
+ end
end
end
|
Adding extra test around merging strategies
|
mongoid_origin
|
train
|
rb
|
2a8056ca1111113ed6ae9dd20adc1e6bddf79a02
|
diff --git a/db/migrate/01_create_cms.rb b/db/migrate/01_create_cms.rb
index <HASH>..<HASH> 100644
--- a/db/migrate/01_create_cms.rb
+++ b/db/migrate/01_create_cms.rb
@@ -11,6 +11,7 @@ class CreateCms < ActiveRecord::Migration[5.2]
t.string :hostname, null: false
t.string :path
t.string :locale, null: false, default: "en"
+ t.timestamps
t.index :hostname
end
|
adding timestamps to Site, because why not? Closes #<I>
|
comfy_comfortable-mexican-sofa
|
train
|
rb
|
22f740afb21dd2385675e3e3e52e10d4ffed7e79
|
diff --git a/src/Creiwork.php b/src/Creiwork.php
index <HASH>..<HASH> 100644
--- a/src/Creiwork.php
+++ b/src/Creiwork.php
@@ -272,11 +272,12 @@ class Creiwork
\PDO::class => function (Config $config) {
$host = $config->get('database.host');
+ $port = $config->get('database.port');
$database = $config->get('database.database');
$user = $config->get('database.user');
$password = $config->get('database.password');
- $dsn = "mysql:dbname={$database};host={$host};charset=UTF8";
+ $dsn = "mysql:dbname={$database};host={$host};port={$port};charset=UTF8";
$pdo = new \PDO($dsn, $user, $password);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
added database port to PDO DI configuration
|
creios_creiwork-framework
|
train
|
php
|
bf8c1a7e27c4aa8aa2740ff4db39f7b5f4d18f3a
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -34,6 +34,8 @@ setup(
'Operating System :: MacOS',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.2',
+ 'Programming Language :: Python :: 3.3',
'Topic :: Documentation',
'Topic :: Software Development :: Documentation',
],
|
Add tag "python <I>" and "<I>" in setup
|
SolutionsCloud_apidoc
|
train
|
py
|
86920ceaf527dbbede88453a9e0f84928017492c
|
diff --git a/dark/__init__.py b/dark/__init__.py
index <HASH>..<HASH> 100644
--- a/dark/__init__.py
+++ b/dark/__init__.py
@@ -5,4 +5,4 @@ if sys.version_info < (2, 7):
# Note that the version string must have the following format, otherwise it
# will not be found by the version() function in ../setup.py
-__version__ = '1.1.15'
+__version__ = '1.1.16'
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -39,6 +39,7 @@ scripts = [
'bin/e-value-to-bit-score.py',
'bin/extract-ORFs.py',
'bin/fasta-base-indices.py',
+ 'bin/fasta-count.py',
'bin/fasta-ids.py',
'bin/fasta-lengths.py',
'bin/fasta-sequences.py',
|
Added bin/fasta-count.py to list of installed bin scripts
|
acorg_dark-matter
|
train
|
py,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.