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
|
---|---|---|---|---|---|
21756bb7f1458c42313dc7c0a2579a4abaf758a7 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -1,6 +1,7 @@
'use strict';
var PrimusError = require('./errors').PrimusError
+ , EventEmitter = require('eventemitter3')
, Transformer = require('./transformer')
, Spark = require('./spark')
, fuse = require('fusing')
@@ -100,7 +101,7 @@ function Primus(server, options) {
// Fuse and spice-up the Primus prototype with EventEmitter and predefine
// awesomeness.
//
-fuse(Primus, require('eventemitter3'));
+fuse(Primus, EventEmitter);
//
// Lazy read the primus.js JavaScript client. | [bug] Adding EventEmitter back to global ns | primus_primus | train | js |
de6aae79af7342be09edd4a8e54d38b1e92d7bba | diff --git a/Search/Adapter/TestAdapter.php b/Search/Adapter/TestAdapter.php
index <HASH>..<HASH> 100644
--- a/Search/Adapter/TestAdapter.php
+++ b/Search/Adapter/TestAdapter.php
@@ -87,7 +87,7 @@ class TestAdapter implements AdapterInterface
public function search(SearchQuery $searchQuery)
{
$hits = array();
- $indexes = $searchQuery->getIndexes() ? : array_keys($this->documents);
+ $indexes = $searchQuery->getIndexes();
foreach ($indexes as $index) {
if (!isset($this->documents[$index])) { | temporarily disabled global search feature of test adapter | massiveart_MassiveSearchBundle | train | php |
4a42f5285d3cc174121d176e37cc84ad79b36fc4 | diff --git a/spec/actors/hyrax/actors/file_set_actor_spec.rb b/spec/actors/hyrax/actors/file_set_actor_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/actors/hyrax/actors/file_set_actor_spec.rb
+++ b/spec/actors/hyrax/actors/file_set_actor_spec.rb
@@ -275,7 +275,7 @@ RSpec.describe Hyrax::Actors::FileSetActor do
actor.attach_to_work(work)
expect(work.representative).to eq(file_set)
expect(work.thumbnail).to eq(file_set)
- expect { work.reload }.not_to change { [work.representative, work.thumbnail] }
+ expect { work.reload }.not_to change { [work.representative.id, work.thumbnail.id] }
end
end | Fix FileSet comparision issue in spec
This test is failing because of a dependency issue(?). It used to reliably
compare `FileSet` instances, but now reliabily treats identical instances
different. Comparing the ids is adequate for test purposes.
Did FileSet equality change? Does it need to change back? | samvera_hyrax | train | rb |
a96d7638b28440c70b169a75d949a8d24920fefe | diff --git a/libraries/legacy/installer/adapters/module.php b/libraries/legacy/installer/adapters/module.php
index <HASH>..<HASH> 100644
--- a/libraries/legacy/installer/adapters/module.php
+++ b/libraries/legacy/installer/adapters/module.php
@@ -466,9 +466,11 @@ class JInstallerModule extends JAdapterInstance
$name = preg_replace('#[\*?]#', '', JText::_($this->get('name')));
$module = JTable::getInstance('module');
$module->set('title', $name);
+ $module->set('content', '');
$module->set('module', $this->get('element'));
$module->set('access', '1');
$module->set('showtitle', '1');
+ $module->set('params', '');
$module->set('client_id', $clientId);
$module->set('language', '*'); | Fix broken module installation in Postgresql because of NULL constraint | joomla_joomla-framework | train | php |
f5b82c76fb2f3dd760ef37e4bf8514ec23442d00 | diff --git a/spyder/plugins/editor/widgets/editor.py b/spyder/plugins/editor/widgets/editor.py
index <HASH>..<HASH> 100644
--- a/spyder/plugins/editor/widgets/editor.py
+++ b/spyder/plugins/editor/widgets/editor.py
@@ -2329,14 +2329,15 @@ class EditorStack(QWidget):
if not osp.isfile(finfo.filename):
# This is an 'untitledX.py' file (newly created)
read_only = False
- try:
- # Try to open the file to see if the permissions allow writing
- # in Windows. For further info, see issue
- # https://github.com/spyder-ide/spyder/issues/10657
- fd = open(finfo.filename, os.O_RDWR)
- fd.close()
- except PermissionError:
- read_only = True
+ elif os.name == 'nt':
+ try:
+ # Try to open the file to see if its permissions allow
+ # to write on it
+ # Fixes spyder-ide/spyder#10657
+ fd = os.open(finfo.filename, os.O_RDWR)
+ os.close(fd)
+ except (IOError, OSError):
+ read_only = True
finfo.editor.setReadOnly(read_only)
self.readonly_changed.emit(read_only) | only check the file if windows and add support to python 2 | spyder-ide_spyder | train | py |
207d43926fb5e41e3da1adfe994ff427cb08da43 | diff --git a/sdl/events.go b/sdl/events.go
index <HASH>..<HASH> 100644
--- a/sdl/events.go
+++ b/sdl/events.go
@@ -546,9 +546,14 @@ func WaitEvent() Event {
}
// PushEvent (https://wiki.libsdl.org/SDL_PushEvent)
-func PushEvent(event Event) int {
+func PushEvent(event Event) (filtered bool, err error) {
_event := (*C.SDL_Event)(unsafe.Pointer(cEvent(event)))
- return int(C.SDL_PushEvent(_event))
+ if ok := int(C.SDL_PushEvent(_event)); ok < 0 {
+ filtered, err = false, GetError()
+ } else if ok == 0 {
+ filtered, err = true, nil
+ }
+ return
}
func (ef eventFilterFunc) FilterEvent(e Event) bool { | Change PushEvent() to return (filtered bool, err error) instead of int | veandco_go-sdl2 | train | go |
ca15ef723bd4933a42d34d36fda8ce2a593a9e60 | diff --git a/mode/yaml-frontmatter/yaml-frontmatter.js b/mode/yaml-frontmatter/yaml-frontmatter.js
index <HASH>..<HASH> 100644
--- a/mode/yaml-frontmatter/yaml-frontmatter.js
+++ b/mode/yaml-frontmatter/yaml-frontmatter.js
@@ -59,6 +59,10 @@
innerMode: function (state) {
return {mode: curMode(state), state: state.inner}
},
+ indent: function(state, a, b) {
+ var mode = curMode(state)
+ return mode.indent ? mode.indent(state.inner, a, b) : CodeMirror.Pass
+ },
blankLine: function (state) {
var mode = curMode(state)
if (mode.blankLine) return mode.blankLine(state.inner) | [yaml-frontmatter mode] Pass through indentation queries to inner modes
Closes #<I> | codemirror_CodeMirror | train | js |
c9a4c09920d18667f08abe72a68242fba374926c | diff --git a/cflib/positioning/__init__.py b/cflib/positioning/__init__.py
index <HASH>..<HASH> 100644
--- a/cflib/positioning/__init__.py
+++ b/cflib/positioning/__init__.py
@@ -21,4 +21,3 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
- | #<I> Fixed Flake8 problem | bitcraze_crazyflie-lib-python | train | py |
0e19b0211fb5699245b2847a45f9a2ff6769df54 | diff --git a/pysnmp/proto/api/v2c.py b/pysnmp/proto/api/v2c.py
index <HASH>..<HASH> 100644
--- a/pysnmp/proto/api/v2c.py
+++ b/pysnmp/proto/api/v2c.py
@@ -58,12 +58,12 @@ class PDUAPI(v1.PDUAPI):
return [ varBinds ]
def setEndOfMibError(self, pdu, errorIndex):
- varBindList = self.apiGetVarBindList(pdu)
- varBindList[errorIndex-1][1] = exval.endOfMib
+ varBindList = self.getVarBindList(pdu)
+ varBindList[errorIndex-1].setComponentByPosition(1, exval.endOfMib)
def setNoSuchInstanceError(self, pdu, errorIndex):
- varBindList = self.apiGetVarBindList(pdu)
- varBindList[errorIndex-1][1] = exval.noSuchInstance
+ varBindList = self.getVarBindList(pdu)
+ varBindList[errorIndex-1].setComponentByPosition(1,exval.noSuchInstance)
apiPDU = PDUAPI() | * switched to setComponentByPosition() at pyasn1 sequences
* syntax typo fixed | etingof_pysnmp | train | py |
a67eaf1ebf8f69f52256b4c681d8009c9539763d | diff --git a/pyamg/strength.py b/pyamg/strength.py
index <HASH>..<HASH> 100644
--- a/pyamg/strength.py
+++ b/pyamg/strength.py
@@ -86,7 +86,6 @@ from scipy.sparse import csr_matrix, isspmatrix_csr, bsr_matrix, isspmatrix_bsr,
import scipy.sparse
from scipy.linalg import pinv2
from pyamg.utils import approximate_spectral_radius, scale_rows
-import time
def ode_strength_of_connection(A, B, epsilon=4.0, k=2, proj_type="l2"):
"""Construct an AMG strength of connection matrix using an ODE based inspiration.
@@ -327,7 +326,7 @@ def ode_strength_of_connection(A, B, epsilon=4.0, k=2, proj_type="l2"):
counter = 0
for i in range(NullDim):
for j in range(i,NullDim):
- BDB[:,counter] = 2.0*asarray(B[:,i])*ravel(asarray(DB[:,j]))
+ BDB[:,counter] = 2.0*ravel(asarray(B[:,i]))*ravel(asarray(DB[:,j]))
counter = counter + 1
# Use constrained min problem to define strength | added a call to ravel at a spot in ode_strenght to fix an occasional error with incorrect array dimensions | pyamg_pyamg | train | py |
0469a8bfd3559f69c5bd0fc040647ce4783288a4 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -43,7 +43,7 @@ requires = ['numpy >=1.13', 'pillow', 'pyresample >=1.11.0', 'trollsift',
'dask[array] >=0.17.1', 'pyproj', 'zarr']
test_requires = ['behave', 'h5py', 'netCDF4', 'pyhdf', 'imageio', 'libtiff',
- 'rasterio', 'geoviews']
+ 'rasterio', 'geoviews', 'pycoast', 'pydecorate']
if sys.version < '3.0':
test_requires.append('mock') | Add pycoast and pydecorate to test requirements | pytroll_satpy | train | py |
40743d449f3d76fa2561b11b6eda590602fde3a9 | diff --git a/lib/scrapper/index.js b/lib/scrapper/index.js
index <HASH>..<HASH> 100644
--- a/lib/scrapper/index.js
+++ b/lib/scrapper/index.js
@@ -50,7 +50,7 @@ var submitLoginForm = function (login, pass) {
//presses "allow access" button on VK permissions page
var confirmPermissions = function () {
try {
- var allowButton = document.getElementById("install_allow");
+ var allowButton = document.querySelector(".flat_button.fl_r.button_indent");
allowButton.click();
} catch (e) {
}
@@ -85,7 +85,6 @@ page.open(authUrl, function (status) {
var pageResponseTimeout;
page.onUrlChanged = function (currentUrl) {
-
clearTimeout(pageResponseTimeout);
if (isPermissionsPage(currentUrl)) { | Fixed issue with markup changes on VK permission screen | DarkXaHTeP_vk-auth | train | js |
0678c431a3525ba258a678dcbd0d9b536f48f0ec | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -11,7 +11,8 @@ L.Marker.prototype.onAdd = function() {
_onAdd.apply(self, arguments);
var iconInstance = self.options.icon;
if (iconInstance && iconInstance._cssIn) {
- iconInstance._cssIn(self._icon, self._shadow);
+ var visible = self._map.getBounds().contains(self.getLatLng());
+ if (visible) iconInstance._cssIn(self._icon, self._shadow);
}
};
@@ -19,11 +20,10 @@ L.Marker.prototype.onRemove = function(map) {
var self = this, args = arguments;
var iconInstance = self.options.icon;
if (iconInstance && iconInstance._cssOut) {
+ var visible = self._map.getBounds().contains(self.getLatLng());
+ if (!visible) return _onRemove.apply(self, args);
iconInstance._cssOut(self._icon, self._shadow, function() {
- self._map = map;
- if (self._icon) {
- _onRemove.apply(self, args);
- }
+ _onRemove.apply(self, args);
});
} else {
_onRemove.apply(self, args); | Don't transition when marker is out of view. | naturalatlas_leaflet-transitionedicon | train | js |
fc0bd9412cbcece8715449916f96fc1ddc51a71f | diff --git a/testing/test_skipping.py b/testing/test_skipping.py
index <HASH>..<HASH> 100644
--- a/testing/test_skipping.py
+++ b/testing/test_skipping.py
@@ -432,7 +432,7 @@ class TestSkip:
""")
result = testdir.runpytest('-rs')
result.stdout.fnmatch_lines([
- "*Skipped instance*",
+ "*unconditional skip*",
"*1 skipped*",
]) | Test that "unconditional skip" is the default reason if none given | vmalloc_dessert | train | py |
b0d3483b38cbea1a95a81e21875c5b11e18f26cd | diff --git a/src/paging/Paging.js b/src/paging/Paging.js
index <HASH>..<HASH> 100644
--- a/src/paging/Paging.js
+++ b/src/paging/Paging.js
@@ -9,6 +9,13 @@ export default class Paging extends Component {
};
this.onPrevOrNext = this.onPrevOrNext.bind(this);
}
+ componentWillReceiveProps(nextProps) {
+ if (nextProps.activePage !== this.props.activePage) {
+ this.setState({
+ activePage: nextProps.activePage,
+ });
+ }
+ }
onPrevOrNext(ty) {
const { total, pageSize, onChange } = this.props;
const { activePage } = this.state; | fix(Paging): fix activePage props is not update. | uiwjs_uiw | train | js |
d53f030b81c028e574cf12477f6b98ac7f75a199 | diff --git a/src/link_finder.php b/src/link_finder.php
index <HASH>..<HASH> 100644
--- a/src/link_finder.php
+++ b/src/link_finder.php
@@ -79,27 +79,67 @@ class LinkFinder{
"za", "zm", "zw",
// Popular ICANN-era generic top-level domains
+ // https://domainnamestat.com/statistics/tldtype/new
// TODO: Add more
+ "adult",
"aero",
+ "app",
"army",
+ "asia",
"bargains",
"bid",
"biz",
"blog",
- "codes",
+ "buzz",
+ "click",
"cloud",
+ "club",
+ "codes",
+ "date",
+ "design",
"dev",
+ "download",
"email",
"estate",
"expert",
+ "fun",
+ "gdn",
+ "host",
+ "icu",
"info",
"jobs",
"kitchen",
+ "kiwi",
+ "life",
+ "link",
+ "live",
+ "loan",
+ "ltd",
+ "men",
"mobi",
"name",
+ "online",
+ "party",
+ "pro",
+ "review",
+ "shop",
+ "site",
+ "space",
+ "store",
+ "stream",
"tech",
"tel",
+ "tokyo",
+ "top",
+ "trade",
"travel",
+ "vip",
+ "wang",
+ "website",
+ "win",
+ "work",
+ "world",
+ "xin",
"xyz",
); | Added some more generic TLDs | yarri_LinkFinder | train | php |
7d9c6cd1a6a4600d0e7d837fe160ba40375914de | diff --git a/lib/server/index.js b/lib/server/index.js
index <HASH>..<HASH> 100644
--- a/lib/server/index.js
+++ b/lib/server/index.js
@@ -198,7 +198,9 @@ module.exports.createProxy = function (options, scripts, bs) {
rules: snippetUtils.getRegex(options.snippet, options.snippetOptions),
ignorePaths: options.snippetOptions.ignorePaths,
middleware: snippetUtils.getProxyMiddleware(scripts, options.scriptPaths.versioned),
- errHandler: function () {}
+ errHandler: function (err) {
+ bs.logger.debug("{red:[proxy error]} %s", err.message);
+ }
}
);
}; | Add debugging logs for proxy | BrowserSync_browser-sync | train | js |
b0689a66924f22efe06ac7ead7ab23e5b1a86dbd | diff --git a/phraseapp/lib.go b/phraseapp/lib.go
index <HASH>..<HASH> 100644
--- a/phraseapp/lib.go
+++ b/phraseapp/lib.go
@@ -26,6 +26,10 @@ type Account struct {
UpdatedAt *time.Time `json:"updated_at"`
}
+type AccountDetails struct {
+ Slug string `json:"slug"`
+}
+
type AffectedCount struct {
RecordsAffected int64 `json:"records_affected"`
}
@@ -211,7 +215,8 @@ type Project struct {
type ProjectDetails struct {
Project
- SharesTranslationMemory bool `json:"shares_translation_memory"`
+ SharesTranslationMemory bool `json:"shares_translation_memory"`
+ Slug string `json:"slug"`
}
type ProjectLocales struct {
@@ -1411,8 +1416,8 @@ func (params *WebhookParams) ApplyValuesFromMap(defaults map[string]interface{})
}
// Get details on a single account.
-func (client *Client) AccountShow(id string) (*Account, error) {
- retVal := new(Account)
+func (client *Client) AccountShow(id string) (*AccountDetails, error) {
+ retVal := new(AccountDetails)
err := func() error {
url := fmt.Sprintf("/v2/accounts/%s", id) | add slug to AccountShow and ProjectShow | phrase_phraseapp-go | train | go |
f6c9012cb9589b37654e6814d353399109b6abe7 | diff --git a/test/pagelet.test.js b/test/pagelet.test.js
index <HASH>..<HASH> 100644
--- a/test/pagelet.test.js
+++ b/test/pagelet.test.js
@@ -14,6 +14,21 @@ describe('Pagelet', function () {
pagelet = null;
});
+ describe('.on', function () {
+ it('sets the pathname', function () {
+ var pagelet = Pagelet.extend({});
+ expect(pagelet.prototype.directory).to.equal('');
+
+ pagelet.prototype.directory = 'foo';
+ expect(pagelet.prototype.directory).to.equal('foo');
+
+ pagelet.on(module);
+
+ expect(pagelet.prototype.directory).to.be.a('string');
+ expect(pagelet.prototype.directory).to.equal(__dirname);
+ });
+ });
+
it('rendering is asynchronously', function (done) {
pagelet.get(pagelet.emits('called'));
// Listening only till after the event is potentially emitted, will ensure | [test] Added test for Pagelet.on() | bigpipe_pagelet | train | js |
40f86590ea2ab307a229e5d27e3b61177bd7711c | diff --git a/src/test/java/net/emaze/dysfunctional/multiplexing/MultiplexingTest.java b/src/test/java/net/emaze/dysfunctional/multiplexing/MultiplexingTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/net/emaze/dysfunctional/multiplexing/MultiplexingTest.java
+++ b/src/test/java/net/emaze/dysfunctional/multiplexing/MultiplexingTest.java
@@ -208,5 +208,26 @@ public class MultiplexingTest {
final Iterable<Iterator<O>> iterable = null;
Multiplexing.roundrobin(iterable);
}
+
+ @Test
+ public void canRoundrobinFromIterable() {
+ final List<Iterator<O>> iterable = Arrays.asList(AN_ITERABLE.iterator());
+ final Iterator<O> rr = Multiplexing.roundrobin(iterable);
+ Assert.assertNotNull(rr);
+ }
+
+ @Test
+ public void canRoundrobinFromIterator() {
+ final List<Iterator<O>> iterable = Arrays.asList(AN_ITERABLE.iterator());
+ final Iterator<O> rr = Multiplexing.roundrobin(iterable.iterator());
+ Assert.assertNotNull(rr);
+ }
+
+ @Test
+ public void canRoundrobinFromArray() {
+ final Iterator<O> rr = Multiplexing.roundrobin(AN_ITERABLE.iterator(), AN_ITERABLE.iterator());
+ Assert.assertNotNull(rr);
+ }
+
}
} | enh: roundrobin tests | cybazeitalia_emaze-dysfunctional | train | java |
8df90f9da07aca982dcb17d53d2fc1e6291709c3 | diff --git a/lib/active_repository/base.rb b/lib/active_repository/base.rb
index <HASH>..<HASH> 100644
--- a/lib/active_repository/base.rb
+++ b/lib/active_repository/base.rb
@@ -273,7 +273,7 @@ module ActiveRepository
private_class_method :set_callback
def execute_callbacks(callbacks)
- callbacks.each do |callback|
+ Array(callbacks).each do |callback|
method = callback[:method]
options = callback[:options] | Forcing type of callbacks to array | efreesen_active_repository | train | rb |
5bb157923f7ff5dff3588e56908466607e4288b5 | diff --git a/cluster/cluster.go b/cluster/cluster.go
index <HASH>..<HASH> 100644
--- a/cluster/cluster.go
+++ b/cluster/cluster.go
@@ -18,6 +18,8 @@ var (
type Config struct {
ClusterId string
NodeId string
+ MgtIface string
+ DataIface string
}
// NodeEntry is used to discover other nodes in the cluster | - add MgtIface and DataIface to cluster Config | libopenstorage_openstorage | train | go |
395b93f34ae94e9107095bfae3209971b63b5486 | diff --git a/generators/docker-base.js b/generators/docker-base.js
index <HASH>..<HASH> 100644
--- a/generators/docker-base.js
+++ b/generators/docker-base.js
@@ -103,10 +103,9 @@ function loadConfigs() {
// Loading configs
this.debug(`Apps folders: ${this.appsFolders}`);
this.appsFolders.forEach(appFolder => {
- const path = this.destinationPath(`${this.directoryPath + appFolder}/.yo-rc.json`);
- const fileData = this.fs.readJSON(path);
- if (fileData) {
- const config = fileData['generator-jhipster'];
+ const path = this.destinationPath(`${this.directoryPath + appFolder}`);
+ if (this.fs.existsSync(`${path}/.yo-rc.json`)) {
+ const config = getAllJhipsterConfig(this, false, path);
if (config.applicationType === 'monolith') {
this.monolithicNb++; | fix: fetch configuration from the blueprints | jhipster_generator-jhipster | train | js |
cb751ce1515feb403102dcbea38d20b4a0d2331f | diff --git a/src/react/svg/svg.js b/src/react/svg/svg.js
index <HASH>..<HASH> 100644
--- a/src/react/svg/svg.js
+++ b/src/react/svg/svg.js
@@ -27,7 +27,7 @@ export class Svg extends React.PureComponent {
svgPathLoader(src) {
try {
- return require(`!!babel-loader?{"presets":["react"]}!react-svg-loader?{"svgo":{"plugins":[{"removeUnknownsAndDefaults":false},{"cleanupNumericValues":false},{"removeUselessStrokeAndFill":false}]}}!../../../../app/svgs/${src}.svg`);
+ return __non_webpack_require__(`!!babel-loader?{"presets":["react"]}!react-svg-loader?{"svgo":{"plugins":[{"removeUnknownsAndDefaults":false},{"cleanupNumericValues":false},{"removeUselessStrokeAndFill":false}]}}!../../../../app/svgs/${src}.svg`);
} catch (e) {}
} | Replace require with __non_webpack_require__ to avoid module not found warning [#<I>] | pivotal-cf_pivotal-ui | train | js |
1bdea24ffcb39912d8e33db8ff3d4384025b2379 | diff --git a/src/server/pachyderm_test.go b/src/server/pachyderm_test.go
index <HASH>..<HASH> 100644
--- a/src/server/pachyderm_test.go
+++ b/src/server/pachyderm_test.go
@@ -4015,7 +4015,6 @@ func TestManyLogs(t *testing.T) {
}
func TestLokiLogs(t *testing.T) {
- // TODO(2.0 required): This test is taking too long to complete due to slow pipelines
if testing.Short() {
t.Skip("Skipping integration tests in short mode")
} | Remove comment about test taking too long. | pachyderm_pachyderm | train | go |
08180bbfeafe7334c7717e3461163f183de85cb8 | diff --git a/src/bundle/Controller/ContentViewController.php b/src/bundle/Controller/ContentViewController.php
index <HASH>..<HASH> 100644
--- a/src/bundle/Controller/ContentViewController.php
+++ b/src/bundle/Controller/ContentViewController.php
@@ -315,7 +315,7 @@ class ContentViewController extends Controller
]);
}
- $isContainer = new IsContainer($this->contentTypeService);
+ $isContainer = new IsContainer();
$hasChildren = new HasChildren($this->locationService);
if ($isContainer->and($hasChildren)->isSatisfiedBy($location)) {
diff --git a/src/lib/Form/Type/Location/LocationTrashContainerType.php b/src/lib/Form/Type/Location/LocationTrashContainerType.php
index <HASH>..<HASH> 100644
--- a/src/lib/Form/Type/Location/LocationTrashContainerType.php
+++ b/src/lib/Form/Type/Location/LocationTrashContainerType.php
@@ -118,7 +118,7 @@ class LocationTrashContainerType extends AbstractType
return;
}
- $isContainer = new IsContainer($this->contentTypeService);
+ $isContainer = new IsContainer();
$hasChildren = new HasChildren($this->locationService);
if (!$isContainer->and($hasChildren)->isSatisfiedBy($location)) { | EZP-<I>: The IsContainer method does not need arguments after the developer has access to ContentType on Content | ezsystems_ezplatform-admin-ui | train | php,php |
5277365cb04c74fc81db44eb8d8a40a31f58ea0b | diff --git a/tests/Sabre/CardDAV/AddressBookTest.php b/tests/Sabre/CardDAV/AddressBookTest.php
index <HASH>..<HASH> 100644
--- a/tests/Sabre/CardDAV/AddressBookTest.php
+++ b/tests/Sabre/CardDAV/AddressBookTest.php
@@ -172,6 +172,9 @@ class AddressBookTest extends \PHPUnit_Framework_TestCase {
function testGetSyncToken() {
+ if (!SABRE_HASSQLITE) {
+ $this->markTestSkipped('Sqlite is required for this test to run');
+ }
$ab = new AddressBook(TestUtil::getBackend(), [ 'id' => 1, '{DAV:}sync-token' => 2]);
$this->assertEquals(2, $ab->getSyncToken());
}
@@ -179,8 +182,10 @@ class AddressBookTest extends \PHPUnit_Framework_TestCase {
function testGetChanges() {
+ if (!SABRE_HASSQLITE) {
+ $this->markTestSkipped('Sqlite is required for this test to run');
+ }
$ab = new AddressBook(TestUtil::getBackend(), [ 'id' => 1, '{DAV:}sync-token' => 2]);
-
$this->assertEquals([
'syncToken' => 2,
'modified' => ['UUID-2345'], | Making sure these tests are skipped if there's no SqLite. | sabre-io_dav | train | php |
dc1369a33eec4b4d0b4a04da5c7c11e2d3e4aaa9 | diff --git a/CaptchaAction.php b/CaptchaAction.php
index <HASH>..<HASH> 100644
--- a/CaptchaAction.php
+++ b/CaptchaAction.php
@@ -122,7 +122,7 @@ class CaptchaAction extends \yii\captcha\CaptchaAction
for ($i = mb_strlen($code); $i >= 0; --$i) {
$char = mb_substr($code, $i, 1, 'UTF-8');
$char = mb_convert_encoding($char, 'UTF-32BE', 'UTF-8');
- $hash += hexdec(bin2hex($char));
+ $hash += (int)hexdec(bin2hex($char));
}
return $hash;
} | casted hexdec value to int | softark_yii2-mb-captcha | train | php |
9324df3c32f151b36e7ed39d5520fff859d715f5 | diff --git a/app/templates/Gruntfile.js b/app/templates/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/app/templates/Gruntfile.js
+++ b/app/templates/Gruntfile.js
@@ -351,6 +351,7 @@ module.exports = function (grunt) {
dist: {
options: {
buildnumber: true,
+ indentSize: 2,
background: {
target: 'scripts/background.js',
exclude: [ | style(manifest): indentation remains unchanged after build | yeoman_generator-chrome-extension | train | js |
dc25ad0b27c8993a7e461abdb540b98c734ec696 | diff --git a/bcbio/rnaseq/arriba.py b/bcbio/rnaseq/arriba.py
index <HASH>..<HASH> 100644
--- a/bcbio/rnaseq/arriba.py
+++ b/bcbio/rnaseq/arriba.py
@@ -8,7 +8,7 @@ from bcbio import utils
from bcbio.distributed.transaction import file_transaction
from bcbio.provenance import do
-SUPPORTED_BUILDS = ("hg38", "GRCh37", "hg19")
+SUPPORTED_BUILDS = ("hg38", "GRCh37", "hg19", "mm10")
def run_arriba(data):
build = dd.get_genome_build(data) | Add mm<I> as a supported fusion caller from arriba. | bcbio_bcbio-nextgen | train | py |
3565957163ce58e2f661f7dfda7fc691f39a778f | diff --git a/classes/Gems/Model/RespondentModel.php b/classes/Gems/Model/RespondentModel.php
index <HASH>..<HASH> 100644
--- a/classes/Gems/Model/RespondentModel.php
+++ b/classes/Gems/Model/RespondentModel.php
@@ -290,6 +290,8 @@ class Gems_Model_RespondentModel extends \Gems_Model_HiddenOrganizationModel
'multiOptions', $dbLookup->getUserConsents()
);
+ $this->refreshGroupSettings();
+
return $this;
}
diff --git a/classes/Gems/User/Mask/MaskerAbstract.php b/classes/Gems/User/Mask/MaskerAbstract.php
index <HASH>..<HASH> 100644
--- a/classes/Gems/User/Mask/MaskerAbstract.php
+++ b/classes/Gems/User/Mask/MaskerAbstract.php
@@ -62,6 +62,7 @@ abstract class MaskerAbstract extends \MUtil_Translate_TranslateableAbstract imp
$output['elementClass'] = 'Exhibitor';
$output['readonly'] = 'readonly';
$output['required'] = false;
+ $output['no_text_search'] = true;
$function = $this->getMaskFunction($type);
if ($function) { | Fixed #<I> Masked fields have been excluded in the text searches | GemsTracker_gemstracker-library | train | php,php |
4889f9041108b7193784c660bc2fb53c20e116e1 | diff --git a/tests/cases/net/http/MediaTest.php b/tests/cases/net/http/MediaTest.php
index <HASH>..<HASH> 100644
--- a/tests/cases/net/http/MediaTest.php
+++ b/tests/cases/net/http/MediaTest.php
@@ -148,7 +148,8 @@ class MediaTest extends \lithium\test\Unit {
$result = Media::asset('this.file.should.not.exist', 'css', array('check' => true));
$this->assertFalse($result);
- $result = Media::asset('debug', 'css', array('check' => 'true', 'library' => 'app'));
+ $this->skipIf(!Libraries::get(true, 'webroot'), "No webroot directory in default library.");
+ $result = Media::asset('debug', 'css', array('check' => 'true', 'library' => true));
$expected = '/css/debug.css';
$this->assertEqual($expected, $result); | Skipping tests in `Media` if no `webroot` directory present in default library. | UnionOfRAD_lithium | train | php |
3d5aa8a4fccaa35e28e716f00988ca4354b03849 | diff --git a/spec/tree/values/nodes/ParagraphSpec.js b/spec/tree/values/nodes/ParagraphSpec.js
index <HASH>..<HASH> 100644
--- a/spec/tree/values/nodes/ParagraphSpec.js
+++ b/spec/tree/values/nodes/ParagraphSpec.js
@@ -20,7 +20,7 @@ describe( "Paragraph tree node", () => {
expect( paragraphElement.endHtml ).toEqual( "</p>" );
} );
- it( "can make a new Text tree node", () => {
+ it( "can make a new Paragraph tree node", () => {
const phrasingElements = [
new FormattingElement( "a", 25, 29 ),
]; | Update spec/tree/values/nodes/ParagraphSpec.js | Yoast_YoastSEO.js | train | js |
ed00b22574a9cf0b119c29c767621223c4107a47 | diff --git a/code/forms/GridFieldSortableRows.php b/code/forms/GridFieldSortableRows.php
index <HASH>..<HASH> 100644
--- a/code/forms/GridFieldSortableRows.php
+++ b/code/forms/GridFieldSortableRows.php
@@ -102,7 +102,7 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
//Detect and correct items with a sort column value of 0 (push to bottom)
- $this->fixSortColumn($dataList);
+ $this->fixSortColumn($gridField, $dataList);
return $dataList->sort($this->sortColumn);
@@ -110,9 +110,10 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
/**
* Detects and corrects items with a sort column value of 0, by appending them to the bottom of the list
+ * @param GridField $gridField Grid Field Reference
* @param SS_List $dataList Data List of items to be checked
*/
- protected function fixSortColumn(SS_List $dataList) {
+ protected function fixSortColumn($gridField, SS_List $dataList) {
$list=clone $dataList;
$list->limit(0);
$max = $list->Max($this->sortColumn); | Fixed undefined variable $gridField which would cascade into a fatal error when correcting sort indexes of 0 on many_many relationships | UndefinedOffset_SortableGridField | train | php |
b65a75c826f32d5f397cd9eb9649ca926923119b | diff --git a/werkzeug/contrib/profiler.py b/werkzeug/contrib/profiler.py
index <HASH>..<HASH> 100644
--- a/werkzeug/contrib/profiler.py
+++ b/werkzeug/contrib/profiler.py
@@ -10,10 +10,14 @@
"""
import sys
try:
- from cProfile import Profile
+ try:
+ from cProfile import Profile
+ except ImportError:
+ from profile import Profile
+ from pstats import Stats
+ available = True
except ImportError:
- from profile import Profile
-from pstats import Stats
+ available = False
class MergeStream(object):
@@ -43,6 +47,9 @@ class ProfilerMiddleware(object):
def __init__(self, app, stream=sys.stdout,
sort_by=('time', 'calls'), restrictions=()):
+ if not available:
+ raise RuntimeError('the profiler is not available because '
+ 'profile or pstat is not installed.')
self._app = app
self._stream = stream
self._sort_by = sort_by | added trap for the profiler
--HG--
branch : trunk | pallets_werkzeug | train | py |
348e151e661cf556d525fee8ac23119bccdddd30 | diff --git a/PHPCompatibility/Sniff.php b/PHPCompatibility/Sniff.php
index <HASH>..<HASH> 100644
--- a/PHPCompatibility/Sniff.php
+++ b/PHPCompatibility/Sniff.php
@@ -1221,27 +1221,6 @@ abstract class Sniff implements PHPCS_Sniff
}
-
- /**
- * Determine whether a ternary is a short ternary, i.e. without "middle".
- *
- * @since 9.2.0
- * @deprecated 10.0.0 Use {@see PHPCSUtils\Utils\Operators::isShortTernary()} instead.
- *
- * @codeCoverageIgnore Method as pulled upstream is accompanied by unit tests.
- *
- * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned.
- * @param int $stackPtr The position of the ternary operator
- * in the stack.
- *
- * @return bool True if short ternary, or false otherwise.
- */
- public function isShortTernary(File $phpcsFile, $stackPtr)
- {
- return Operators::isShortTernary($phpcsFile, $stackPtr);
- }
-
-
/**
* Determine whether a T_OPEN/CLOSE_SHORT_ARRAY token is a list() construct.
* | Sniff::isShortTernary(): remove the function | PHPCompatibility_PHPCompatibility | train | php |
d079b493c7f536ea03499943b7794e93f0c6dad2 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -1,3 +1,3 @@
'use strict';
-module.exports = require('path');
+module.exports = require('./src/formatter'); | updated index.js with correct src path | andreogle_gulp-eslint-teamcity-formatter | train | js |
472b070792b57ac89b8f644062bf2d66d38f0ed1 | diff --git a/troposphere/codecommit.py b/troposphere/codecommit.py
index <HASH>..<HASH> 100644
--- a/troposphere/codecommit.py
+++ b/troposphere/codecommit.py
@@ -3,7 +3,7 @@
#
# See LICENSE file for full license.
-from . import AWSHelperFn, AWSObject, AWSProperty
+from . import AWSHelperFn, AWSObject, AWSProperty, Tags
class S3(AWSProperty):
@@ -53,5 +53,6 @@ class Repository(AWSObject):
'Code': (Code, False),
'RepositoryDescription': (basestring, False),
'RepositoryName': (basestring, True),
+ 'Tags': (Tags, False),
'Triggers': ([Trigger], False),
} | Add Tags to AWS::CodeCommit::Repository | cloudtools_troposphere | train | py |
621caf370344573d754f1b2203a4d42725461104 | diff --git a/backbone-nested.js b/backbone-nested.js
index <HASH>..<HASH> 100644
--- a/backbone-nested.js
+++ b/backbone-nested.js
@@ -95,13 +95,13 @@
// remove the element from the array
val.splice(i, 1);
+ opts.silent = true; // Triggers should only be fired in trigger section below
this.set(aryPath, val, opts);
if (trigger){
attrStr = Backbone.NestedModel.createAttrStr(aryPath);
this.trigger('remove:' + attrStr, this, oldEl);
- this.trigger('change:' + attrStr, this, oldEl);
- for (var aryCount = aryPath.length - 1; aryCount >= 0; aryCount--) {
+ for (var aryCount = aryPath.length; aryCount >= 1; aryCount--) {
attrStr = Backbone.NestedModel.createAttrStr(_.first(aryPath, aryCount));
this.trigger('change:' + attrStr, this, oldEl);
} | Stopped double fire of trigger when removing deeply nested items. | afeld_backbone-nested | train | js |
f901862a9608f9a594dcebec250606834d1941f7 | diff --git a/code/libraries/koowa/controller/default.php b/code/libraries/koowa/controller/default.php
index <HASH>..<HASH> 100644
--- a/code/libraries/koowa/controller/default.php
+++ b/code/libraries/koowa/controller/default.php
@@ -9,13 +9,13 @@
*/
/**
- * Action Controller Class
+ * Default Controller Class
*
* @author Johan Janssens <[email protected]>
* @category Koowa
* @package Koowa_Controller
*/
-class KControllerDefault extends KControllerForm
+class KControllerDefault extends KControllerResource
{
} | KControllerDefault now extends from KControllerResource | joomlatools_joomlatools-framework | train | php |
99e539312bcac8b90c856d1bd7fbe9986b7885d4 | diff --git a/src/display/TilingSprite.js b/src/display/TilingSprite.js
index <HASH>..<HASH> 100644
--- a/src/display/TilingSprite.js
+++ b/src/display/TilingSprite.js
@@ -13,4 +13,14 @@ TilingSprite.prototype = Object.create(PixiTilingSprite.prototype);
TilingSprite.prototype.constructor = TilingSprite;
utils.mixin(TilingSprite, mixin);
+TilingSprite.prototype.setTileScale = function(x,y){
+ this.tileScale.set(x,y);
+ return this;
+};
+
+TilingSprite.prototype.setTilePosition = function(x,y){
+ this.tilePosition.set(x,y);
+ return this;
+};
+
module.exports = TilingSprite;
\ No newline at end of file | Added some methods at TilingSprite | Nazariglez_perenquen | train | js |
261c34c291e0bdd04d60006349b61e1a8f8b6a49 | diff --git a/lib/webinterface_handler.py b/lib/webinterface_handler.py
index <HASH>..<HASH> 100644
--- a/lib/webinterface_handler.py
+++ b/lib/webinterface_handler.py
@@ -49,6 +49,7 @@ from invenio.config import CFG_SITE_LANG, CFG_SITE_URL, CFG_SITE_SECURE_URL, CFG
from invenio.messages import wash_language
from invenio.urlutils import redirect_to_url
from invenio.errorlib import register_exception
+from invenio.webuser import get_preferred_user_language
has_https_support = CFG_SITE_URL != CFG_SITE_SECURE_URL
@@ -188,7 +189,16 @@ class WebInterfaceDirectory(object):
return obj._traverse(req, path)
form = util.FieldStorage(req, keep_blank_values=True)
-
+ try:
+ # The auto recognition will work only with with mod_python-3.3.1
+ if not form.has_key('ln'):
+ ln = get_preferred_user_language(req)
+ form.add_field('ln', ln)
+ except:
+ form = dict(form)
+ if not form.has_key('ln'):
+ ln = get_preferred_user_language(req)
+ form['ln'] = ln
result = obj(req, form)
return _check_result(req, result) | Implemented permanent sessions support - a.k.a Remember Me, automatic
preferred language discovery and language configuration in the user
preferences. | inveniosoftware_invenio-base | train | py |
4c9f90fcf617811fb8a84e5fbad90df7c0a95408 | diff --git a/lib/sass.rb b/lib/sass.rb
index <HASH>..<HASH> 100644
--- a/lib/sass.rb
+++ b/lib/sass.rb
@@ -47,7 +47,7 @@ module Sass
end
options[:filename] = filename
options[:css_filename] = css_filename
- result = compile(File.read(filename), options)
+ result = Sass::Files.tree_for(filename, options).render
if css_filename
open(css_filename,"w") {|css_file| css_file.write(result) }
nil | Use Sass::Files.tree_for to compile files found on disk. | sass_ruby-sass | train | rb |
fafbcc51b52e0fc373b2c2621078d770b5b6d66c | diff --git a/mod/data/edit.php b/mod/data/edit.php
index <HASH>..<HASH> 100755
--- a/mod/data/edit.php
+++ b/mod/data/edit.php
@@ -320,9 +320,11 @@
/// Finish the page
-
+
// Print the stuff that need to come after the form fields.
- $fields = get_records('data_fields', 'dataid', $data->id);
+ if (!$fields = get_records('data_fields', 'dataid', $data->id)) {
+ error(get_string('nofieldindatabase'));
+ }
foreach ($fields as $eachfield) {
$field = data_get_field($eachfield, $data);
$field->print_after_form(); | Merged fix for bug: when a student tries to add an entry and no fields are
defined, the foreach barfs since the value of $fields is false. | moodle_moodle | train | php |
1847ef6bd31ecd38fe5d19e54c47a812cb2ed303 | diff --git a/plugin/file/file.go b/plugin/file/file.go
index <HASH>..<HASH> 100644
--- a/plugin/file/file.go
+++ b/plugin/file/file.go
@@ -121,6 +121,12 @@ func (s *serialErr) Error() string {
// it returns an error indicating nothing was read.
func Parse(f io.Reader, origin, fileName string, serial int64) (*Zone, error) {
tokens := dns.ParseZone(f, dns.Fqdn(origin), fileName)
+ defer func() {
+ // Drain the tokens chan so that large zone files won't
+ // leak goroutines and memory.
+ for range tokens {
+ }
+ }()
z := NewZone(origin, fileName)
seenSOA := false
for x := range tokens { | plugin/file: Fix memory leak in Parse (#<I>)
For zone files with more than <I>,<I> records, the goroutines and memory
pinned by dns.ParseZone won't be released unless the tokens chan is
drained. As Parse is called by (*Zone).Reload very frequently, this
causes memory leaks and OOM conditions.
Updates miekg/dns#<I> | coredns_coredns | train | go |
a7d6af61dd5132dff2678827a14c86b27a64e43a | diff --git a/src/DaGardner/DaContainer/Container.php b/src/DaGardner/DaContainer/Container.php
index <HASH>..<HASH> 100644
--- a/src/DaGardner/DaContainer/Container.php
+++ b/src/DaGardner/DaContainer/Container.php
@@ -209,15 +209,15 @@ class Container implements ArrayAccess
}, false);
}
- public function onResolving(Closure $callback, $silent = true)
+ public function onResolving(Closure $callback, $active = false)
{
- if ($silent) {
+ if ($active) {
- $this->silentCallbacks[] = $callback;
+ $this->callbacks[] = $callback;
} else {
- $this->callbacks[] = $callback;
+ $this->silentCallbacks[] = $callback;
}
} | Switched usage of onResolving event | ChristianGaertner_DaContainer | train | php |
66116dc02b59dbbd9f7827bf09f20e82db4c2fbe | diff --git a/lib/base.js b/lib/base.js
index <HASH>..<HASH> 100644
--- a/lib/base.js
+++ b/lib/base.js
@@ -97,6 +97,7 @@ class Adapter {
const stream = this.createReadStream(fileName)
const writable = new WritableStreamBuffer()
const promise = new Promise((resolve, reject) => {
+ // errors are not forwarded with pipe, so listen on original stream
stream.on('error', err => reject(err))
writable.on('finish', () => {
if (options && options.encoding) {
@@ -124,6 +125,10 @@ class Adapter {
const stream = this.createWriteStream(fileName)
return new Promise((resolve, reject) => {
+ // unfortunately .end(..., cb) only forwards errors generated when
+ // closing, not when writing the final chunk, so we also need to add
+ // an error listener
+ stream.on('error', err => reject(err))
stream.end(data, (options && options.encoding) || 'utf8', err => {
if (err) reject(err)
else resolve() | Add check for stream error in base write() | meyfa_fs-adapters | train | js |
70f6ba6bef59c359f41d9f746976295be7c670cd | diff --git a/lib/octokit/error.rb b/lib/octokit/error.rb
index <HASH>..<HASH> 100644
--- a/lib/octokit/error.rb
+++ b/lib/octokit/error.rb
@@ -35,8 +35,7 @@ module Octokit
end
def build_error_context
- rate_limited_errors = [Octokit::TooManyRequests, Octokit::AbuseDetected]
- if rate_limited_errors.include?(self.class)
+ if RATE_LIMITED_ERRORS.include?(self.class)
@context = Octokit::RateLimit.from_response(@response)
end
end
@@ -323,4 +322,5 @@ module Octokit
# Raised when a repository is created with an invalid format
class InvalidRepository < ArgumentError; end
+ RATE_LIMITED_ERRORS = [Octokit::TooManyRequests, Octokit::AbuseDetected]
end | Refactor rate limited errors to a constant | octokit_octokit.rb | train | rb |
a0816dc32fbdb91a60d4a5f4ff5035e4d0f7aa40 | diff --git a/scapy.py b/scapy.py
index <HASH>..<HASH> 100755
--- a/scapy.py
+++ b/scapy.py
@@ -11735,7 +11735,10 @@ class TFTP_read(Automaton):
# RECEIVED
@ATMT.state()
def RECEIVING(self, pkt):
- recvd = pkt[Raw].load
+ if Raw in pkt:
+ recvd = pkt[Raw].load
+ else:
+ recvd = ""
self.res += recvd
self.awaiting += 1
if len(recvd) == self.blocksize: | Some fixes in TFTP_read | secdev_scapy | train | py |
2836478c728e2c4b08b1c5faad4b101db53f3114 | diff --git a/src/ORM/PolymorphicHasManyList.php b/src/ORM/PolymorphicHasManyList.php
index <HASH>..<HASH> 100644
--- a/src/ORM/PolymorphicHasManyList.php
+++ b/src/ORM/PolymorphicHasManyList.php
@@ -30,6 +30,14 @@ class PolymorphicHasManyList extends HasManyList
}
/**
+ * Gets the field name which holds the related object class.
+ */
+ public function getForeignClassKey(): string
+ {
+ return $this->classForeignKey;
+ }
+
+ /**
* Create a new PolymorphicHasManyList relation list.
*
* @param string $dataClass The class of the DataObjects that this will list. | API Add method to get foreign class key on polymorphic has_many | silverstripe_silverstripe-framework | train | php |
726568bd6d7df7066718e30f6b153f73f6463db8 | diff --git a/src/_internals/set.js b/src/_internals/set.js
index <HASH>..<HASH> 100644
--- a/src/_internals/set.js
+++ b/src/_internals/set.js
@@ -528,10 +528,10 @@ function baseSet(object, path, value, customizer){
}
path = isKey(path, object) ? [ path ] : castPath(path)
- const index = -1,
- { length } = path,
- lastIndex = length - 1,
- nested = object
+ let index = -1
+ let nested = object
+ const { length } = path
+ const lastIndex = length - 1
while (nested != null && ++index < length){
let key = toKey(path[ index ]), | fix: internal set after lint | selfrefactor_rambdax | train | js |
dc62dc5c975f4081a43d9362eb5a26bbd9e4d733 | diff --git a/zpprofile.py b/zpprofile.py
index <HASH>..<HASH> 100644
--- a/zpprofile.py
+++ b/zpprofile.py
@@ -273,7 +273,7 @@ class ZopeMixIn(object):
except KeyError:
return filename
return self._rememberFile(
- script.body().decode('utf-8') + (u'\n## %s\n' % script.id),
+ script.body().decode('utf-8'),
script.id,
'.py',
) | zpprofile: Do not append script id to its body.
Since this was added, file names were changed to closely resemble original
script id. As the id alone is anyway already not enough to identify the
script (ex: when Skinnable magic is involved, multiple homonyms can exist
and be part of the same profiling result), so having it slightly extended
as file name should not matter much. | vpelletier_pprofile | train | py |
e0eed0d986bb0279011dab8bfcd1c1a03e77222a | diff --git a/src/php/wp-cli/wp-cli.php b/src/php/wp-cli/wp-cli.php
index <HASH>..<HASH> 100755
--- a/src/php/wp-cli/wp-cli.php
+++ b/src/php/wp-cli/wp-cli.php
@@ -43,10 +43,12 @@ if ( is_readable( $_SERVER['PWD'] . '/../wp-load.php' ) ) {
if ( !is_readable( WP_ROOT . 'wp-load.php' ) ) {
if ( array( 'core', 'download' ) == $arguments ) {
+ if (isset($assoc_args['path'])) $docroot = $assoc_args['path'];
+ else $docroot = './'
WP_CLI::line('Downloading WordPress...');
exec("curl http://wordpress.org/latest.zip > /tmp/wordpress.zip");
exec("unzip /tmp/wordpress.zip");
- exec("mv wordpress/* ./");
+ exec("mv wordpress/* $docroot");
exec("rm -r wordpress");
WP_CLI::success('WordPress downloaded.');
exit; | add --path flag to allow wordpress installation somewhere other than ./ | wp-cli_export-command | train | php |
cb77784d2ae73c8f85babc5b058eb7524300d050 | diff --git a/src/ol/control/Attribution.js b/src/ol/control/Attribution.js
index <HASH>..<HASH> 100644
--- a/src/ol/control/Attribution.js
+++ b/src/ol/control/Attribution.js
@@ -70,6 +70,12 @@ class Attribution extends Control {
* @private
* @type {boolean}
*/
+ this.userCollapsed_ = this.collapsed_;
+
+ /**
+ * @private
+ * @type {boolean}
+ */
this.overrideCollapsible_ = options.collapsible !== undefined;
/**
@@ -265,6 +271,7 @@ class Attribution extends Control {
handleClick_(event) {
event.preventDefault();
this.handleToggle_();
+ this.userCollapsed_ = this.collapsed_;
}
/**
@@ -300,7 +307,7 @@ class Attribution extends Control {
}
this.collapsible_ = collapsible;
this.element.classList.toggle('ol-uncollapsible');
- if (!collapsible && this.collapsed_) {
+ if (this.userCollapsed_) {
this.handleToggle_();
}
}
@@ -313,6 +320,7 @@ class Attribution extends Control {
* @api
*/
setCollapsed(collapsed) {
+ this.userCollapsed_ = collapsed;
if (!this.collapsible_ || this.collapsed_ === collapsed) {
return;
} | also restore collapsed state to last user setting | openlayers_openlayers | train | js |
00d13f05c48f249ece22d1fd9fca5728b14e71a3 | diff --git a/salt/modules/mysql.py b/salt/modules/mysql.py
index <HASH>..<HASH> 100644
--- a/salt/modules/mysql.py
+++ b/salt/modules/mysql.py
@@ -1622,8 +1622,10 @@ def grant_exists(grant,
if not target_tokens: # Avoid the overhead of re-calc in loop
target_tokens = _grant_to_tokens(target)
grant_tokens = _grant_to_tokens(grant)
+ grant_tokens_database = grant_tokens['database'].replace('"', '').replace('\\', '').replace('`', '')
+ target_tokens_database = target_tokens['database'].replace('"', '').replace('\\', '').replace('`', '')
if grant_tokens['user'] == target_tokens['user'] and \
- grant_tokens['database'] == target_tokens['database'] and \
+ grant_tokens_database == target_tokens_database and \
grant_tokens['host'] == target_tokens['host'] and \
set(grant_tokens['grant']) == set(target_tokens['grant']):
return True | Fix mysql grant comparisons by stripping both of escape characters and quotes. Fixes #<I> | saltstack_salt | train | py |
ce5e93cc72639563bfd8052552712e9b26c6cc9b | diff --git a/public/js/controllers/charts_controller.js b/public/js/controllers/charts_controller.js
index <HASH>..<HASH> 100644
--- a/public/js/controllers/charts_controller.js
+++ b/public/js/controllers/charts_controller.js
@@ -1,4 +1,5 @@
/* global Dygraph */
+/* global Turbolinks */
/* global $ */
import { Controller } from 'stimulus'
@@ -181,6 +182,7 @@ export default class extends Controller {
if (this.chartsView !== undefined) {
this.chartsView.destroy()
}
+ selectedChart = null
}
drawInitialGraph () {
@@ -214,7 +216,7 @@ export default class extends Controller {
plotGraph (chartName, data) {
var d = []
- window.history.pushState({}, chartName, `#${chartName}`)
+ Turbolinks.controller.replaceHistoryWithLocationAndRestorationIdentifier(Turbolinks.Location.wrap(`#${chartName}`), Turbolinks.uuid())
var gOptions = {
rollPeriod: 1
} | back and forward navigation fixed for charts page | decred_dcrdata | train | js |
d7966d22f14375547e263347ec648dcba7b65617 | diff --git a/pandas/core/format.py b/pandas/core/format.py
index <HASH>..<HASH> 100644
--- a/pandas/core/format.py
+++ b/pandas/core/format.py
@@ -672,8 +672,8 @@ def _has_names(index):
# Global formatting options
def set_printoptions(precision=None, column_space=None, max_rows=None,
- max_columns=None, colheader_justify='right',
- max_colwidth=50, notebook_repr_html=None,
+ max_columns=None, colheader_justify=None,
+ max_colwidth=None, notebook_repr_html=None,
date_dayfirst=None, date_yearfirst=None):
"""
Alter default behavior of DataFrame.toString | BUG: colheader_justify/max_colwidth None so don't always reset | pandas-dev_pandas | train | py |
66bb7557515c0d2e6241f74644853a97773ddaef | diff --git a/tests/unit/modules/test_linux_acl.py b/tests/unit/modules/test_linux_acl.py
index <HASH>..<HASH> 100644
--- a/tests/unit/modules/test_linux_acl.py
+++ b/tests/unit/modules/test_linux_acl.py
@@ -63,6 +63,22 @@ class LinuxAclTestCase(TestCase, LoaderModuleMockMixin):
linux_acl.getfacl(*self.files, recursive=True)
self.cmdrun.assert_called_once_with('getfacl --absolute-names -R ' + ' '.join(self.quoted_files), python_shell=False)
+ def test_getfacl__effective_acls(self):
+ line = 'group:webmaster:r-x #effective:---'
+ user = 'root'
+ group = 'root'
+ expected = {
+ 'type': 'acl',
+ 'group': 'webmaster',
+ 'permissions': {
+ 'read': False,
+ 'write': False,
+ 'execute': False
+ },
+ 'octal': 0,
+ }
+ self.assertEqual(linux_acl._parse_acl(line, user, group), expected)
+
def test_wipefacls_wo_args(self):
self.assertRaises(CommandExecutionError, linux_acl.wipefacls) | add test for effective acls | saltstack_salt | train | py |
dcfe1e2f2624a9a92bb0464d4b8f5a6aa5516d86 | diff --git a/test/util/playground.js b/test/util/playground.js
index <HASH>..<HASH> 100755
--- a/test/util/playground.js
+++ b/test/util/playground.js
@@ -107,20 +107,3 @@ vorpal
.delimiter('calc:')
.show()
.parse(process.argv);
-
-// vorpal.exec('foo "bar and" -m "so and so"');
-
-/*
-vorpal.catch('[commands...]')
- .option('-d, --dog')
- .parse(function (str) {
- return str + ' | reverse -c';
- })
- .action(function (args, cb) {
- if (args.commands) {
- console.log(args);
- this.log(args.commands.join(' '));
- }
- cb();
- });
-*/ | fixed #<I> - mid-command inquirer prompt breaks on control + c | dthree_vorpal | train | js |
02fe65a2cddadf386e59d7f889950d51af2bf70a | diff --git a/tests/scripts/examples/sql_coverage/config.py b/tests/scripts/examples/sql_coverage/config.py
index <HASH>..<HASH> 100644
--- a/tests/scripts/examples/sql_coverage/config.py
+++ b/tests/scripts/examples/sql_coverage/config.py
@@ -82,7 +82,7 @@
"ddl": "int-DDL.sql",
"template": "numeric-ints.sql",
"normalizer": "normalizer.py",
- "precision": "10"},
+ "precision": "9"},
# HSQL SEEMS TO HAVE A BAD DEFAULT PRECISION, DISABLING
# "advanced-decimal": {"schema": "decimal-schema.py",
# "ddl": "DDL.sql", | config.py: lowered the 'precision' for the numeric-ints test suite to 9
(just like numeric-decimals), since I’ve now seen that one fail (once)
with <I>, due to round-off errors. | VoltDB_voltdb | train | py |
5cc7ee1bba9d300bf4eb8d8457aa74de36237df9 | diff --git a/lib/transports/mandrill/getRecipientsAndMergeVars.js b/lib/transports/mandrill/getRecipientsAndMergeVars.js
index <HASH>..<HASH> 100644
--- a/lib/transports/mandrill/getRecipientsAndMergeVars.js
+++ b/lib/transports/mandrill/getRecipientsAndMergeVars.js
@@ -17,7 +17,7 @@ function getRecipientsAndMergeVars (to) {
if (typeof i.name === 'string') {
vars.push({ name: 'name', content: i.name });
} else if (typeof i.name === 'object') {
- var fullName = [i.first, i.last].filter(truthy).join(' ');
+ var fullName = [i.name.first, i.name.last].filter(truthy).join(' ');
vars.push({ name: 'name', content: fullName || '' });
vars.push({ name: 'first_name', content: i.name.first || '' });
vars.push({ name: 'last_name', content: i.name.last || '' }); | Fixing name concatenation with { first, last} for Mandrill merge vars | keystonejs_keystone-email | train | js |
50266a63cf4c055c266c9958a88309913a903571 | diff --git a/src/geom/Position.js b/src/geom/Position.js
index <HASH>..<HASH> 100644
--- a/src/geom/Position.js
+++ b/src/geom/Position.js
@@ -196,7 +196,7 @@ define([
*/
Position.prototype.toString = function () {
return "(" + this.latitude.toString() + "\u00b0, " + this.longitude.toString() + "\u00b0, "
- + this.altitude.toString();
+ + this.altitude.toString() + ")";
};
return Position; | Missing closing parenthesis in toString method | NASAWorldWind_WebWorldWind | train | js |
a847a7f0ddb83a8c9e75d82d760a6244171d96ac | diff --git a/girder/api/v1/user.py b/girder/api/v1/user.py
index <HASH>..<HASH> 100644
--- a/girder/api/v1/user.py
+++ b/girder/api/v1/user.py
@@ -63,7 +63,7 @@ class User(Resource):
self.route('PUT', (':id', 'verification'), self.verifyEmail)
self.route('POST', ('verification',), self.sendVerificationEmail)
- @access.public
+ @access.user
@filtermodel(model=UserModel)
@autoDescribeRoute(
Description('List or search for users.') | Only expose user listing endpoint to logged-in users | girder_girder | train | py |
a299b4c2cabf276fd2e32951fcaa1eec4ab167f8 | diff --git a/lib/compiler.js b/lib/compiler.js
index <HASH>..<HASH> 100644
--- a/lib/compiler.js
+++ b/lib/compiler.js
@@ -33,6 +33,8 @@ util.inherits(Compiler, events.EventEmitter);
Compiler.prototype.compileModule = function (contractPath) {
var _this = this;
+ contractPath = contractPath || '';
+
// Read existing manifest or create a new one
var manifest;
var manifest_path = path.join(contractPath, _this.config.manifestFilename);
@@ -82,7 +84,8 @@ Compiler.prototype.compileModule = function (contractPath) {
_this.emit('file', {
data: file,
- hash: hash
+ hash: hash,
+ name: path.join(contractPath, filename)
});
});
@@ -103,9 +106,11 @@ Compiler.prototype.compileModule = function (contractPath) {
var manifestBuffer = new Buffer(prettyManifest, 'utf-8');
var manifestHash = FileHash.hash(manifestBuffer);
+ console.log(prettyManifest);
_this.emit('file', {
data: manifestBuffer,
- hash: manifestHash
+ hash: manifestHash,
+ name: path.join(contractPath, 'codius-manifest.json')
});
return manifestHash; | [TASK] Emit filenames when compiling. | codius-deprecated_codius-engine | train | js |
358fb9882505acd98fd26a01ed11cf686b8c8ea8 | diff --git a/common/vr/common/paths.py b/common/vr/common/paths.py
index <HASH>..<HASH> 100644
--- a/common/vr/common/paths.py
+++ b/common/vr/common/paths.py
@@ -29,19 +29,24 @@ def get_proc_path(settings):
return os.path.join(PROCS_ROOT, get_container_name(settings))
-def get_build_path(settings):
+def get_app_path(settings):
"""
Path to which a build should be unpacked.
"""
- return os.path.join(BUILDS_ROOT, '%s-%s' % (settings.app_name,
- settings.version))
+ # These days, we unpack a separate copy of the build for each proc on the
+ # host. This is the easiest way around different instances possibly
+ # running as different users, while still being able to write .pyc files in
+ # there (for example). In practice, Velociraptor wouldn't get much
+ # disk/memory savings from having multiple procs pointing at the same
+ # underlying files anyway, because VR tries hard to distribute instances of
+ # the same app across different hosts.
+ return os.path.join(get_container_path(settings), 'app')
def get_buildfile_path(settings):
"""
- Path to which a build tarball should be unloaded.
+ Path to which a build tarball should be downloaded.
"""
-
base = os.path.basename(settings.build_url)
return os.path.join(BUILDS_ROOT, base) | each proc gets its own copy of the build | yougov_vr.common | train | py |
df21faead2b427c56152eca744f12ce8fcc1e0ca | diff --git a/package/index.js b/package/index.js
index <HASH>..<HASH> 100644
--- a/package/index.js
+++ b/package/index.js
@@ -2,10 +2,11 @@
/* eslint import/no-dynamic-require: 0 */
const Environment = require('./environment')
+const { resolve } = require('path')
const { existsSync } = require('fs')
function createEnvironment() {
- const path = `./environments/${process.env.NODE_ENV}`
+ const path = resolve(__dirname, 'environments', `${process.env.NODE_ENV}.js`)
const constructor = existsSync(path) ? require(path) : Environment
return new constructor()
} | Resolve full file path + name to fix existsSync check | rails_webpacker | train | js |
be89a464cd05081485b9cd0c671de0dd7c223da6 | diff --git a/src/AlertDialog.js b/src/AlertDialog.js
index <HASH>..<HASH> 100644
--- a/src/AlertDialog.js
+++ b/src/AlertDialog.js
@@ -82,18 +82,12 @@ class AlertDialog extends Dialog {
const key = event.key.length === 1 && event.key.toLowerCase();
if (key) {
- // Loop over choices to see if one of them starts with the key.
- let found = false;
- let index = 0;
- while (index < this.choices.length && !found) {
- if (this.choices[index][0].toLowerCase() === key) {
- found = true;
- } else {
- index++;
- }
- }
- if (found && index >= 0) {
- this.close(this.choices[index]);
+ // See if one of the choices starts with the key.
+ const choiceForKey = this.choices.find(choice =>
+ choice[0].toLowerCase() === key
+ );
+ if (choiceForKey) {
+ this.close(choiceForKey);
handled = true;
}
} | Take advantage of Array.find to simplify mapping a key press to a choice button. | elix_elix | train | js |
719d8243bde89d36dbd3895c05166c36424c0ed1 | diff --git a/snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java b/snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java
index <HASH>..<HASH> 100644
--- a/snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java
+++ b/snorocket-core/src/main/java/au/csiro/snorocket/core/NormalisedOntology.java
@@ -1564,7 +1564,7 @@ public class NormalisedOntology implements Serializable {
NF8 nf8 = it2.next();
res.add(new ConceptInclusion(
transform(nf8.lhsD),
- transform(factory.lookupConceptId(i))
+ transform(factory.lookupConceptId(nf8.rhsB))
));
}
}
@@ -2242,7 +2242,7 @@ public class NormalisedOntology implements Serializable {
topNode.getChildren().add(cn);
}
}
- }
+ }
}
/** | Fixed bug in stated axioms calculation. | aehrc_snorocket | train | java |
4996f1d707a6e3fd119aa77911428c7e431942e6 | diff --git a/lib/couchdb/index.js b/lib/couchdb/index.js
index <HASH>..<HASH> 100644
--- a/lib/couchdb/index.js
+++ b/lib/couchdb/index.js
@@ -118,7 +118,7 @@ exports.pollCouch = function (env_config, callback) {
env_config.couch.version = data.version
env_config.couch.vendor = _.findKey(data, function (prop) {
- return prop === 'Welcome!'
+ return /^welcome/i.test(prop)
})
console.error('CouchDB started') | fix(couchdb): correctly detect couchdbs that reply "Welcome" instead of "Welcome!"
* * *
This commit was sponsored by The Hoodie Firm.
You can hire The Hoodie Firm:
<URL> | hoodiehq_hoodie-server | train | js |
c968fc7e18a2405b3afb9f8cd5c6dfcc0759d1f0 | diff --git a/src/sap.ui.integration/test/sap/ui/integration/demokit/cardExplorer/webapp/scripts/boot.js b/src/sap.ui.integration/test/sap/ui/integration/demokit/cardExplorer/webapp/scripts/boot.js
index <HASH>..<HASH> 100644
--- a/src/sap.ui.integration/test/sap/ui/integration/demokit/cardExplorer/webapp/scripts/boot.js
+++ b/src/sap.ui.integration/test/sap/ui/integration/demokit/cardExplorer/webapp/scripts/boot.js
@@ -17,6 +17,7 @@ window.addEventListener("load", function () {
aNodes.push('<link rel="stylesheet" href="' + sWebApp + 'css/topic.css">');
aNodes.push('<link rel="stylesheet" href="' + sWebApp + 'css/codesample.css">');
aNodes.push('<link rel="stylesheet" href="' + sRes + 'sap/ui/core/themes/sap_fiori_3/library.css">');
+ aNodes.push('<script src="' + sRes + 'sap/ui/documentation/sdk/thirdparty/google-code-prettify/prettify.js"></script>');
aNodes.push('<script src="' + sWebApp + 'scripts/topic.js"></script>');
function afterLoad() { | [INTERNAL][FIX] Demo Kit: Added reference
Reference to old highlighter prettify.js is added.
BCP: <I>
Change-Id: I<I>b<I>a<I>b<I>ce<I>a<I>b<I>a<I>d<I>cf<I> | SAP_openui5 | train | js |
013ee9c5cd164c4f229e69c7d5514ebe3fdd5709 | diff --git a/SimplePie/Sanitize.php b/SimplePie/Sanitize.php
index <HASH>..<HASH> 100644
--- a/SimplePie/Sanitize.php
+++ b/SimplePie/Sanitize.php
@@ -365,13 +365,13 @@ class SimplePie_Sanitize
// Atom XHTML constructs are wrapped with a div by default
// Note: No protection if $html contains a stray </div>!
$html = '<div>' . $html . '</div>';
- $ret .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
- $content_type = 'application/xhtml+xml';
+ $ret .= '<!DOCTYPE html>';
+ $content_type = 'text/html';
}
else
{
- $ret .= '<!DOCTYPE html>';
- $content_type = 'text/html';
+ $ret .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
+ $content_type = 'application/xhtml+xml';
}
$ret .= '<html><head>'; | Use the correct DOCTYPEs when sanitizing | simplepie_simplepie | train | php |
34e03f245dbbfaa215983bf167782bae8a671bac | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -44,8 +44,6 @@ function appender(configuration)
loggingObject.environment = configuration.environment;
}
- console.log(MDC);
-
if (MDC && MDC.active)
{
Object.keys(MDC.active).forEach(function(key) | Removed redundant debug logging statement | viskan_log4js-logstash-appender | train | js |
70b0023b828b8dcd24914232741141e903532fff | diff --git a/models/action.go b/models/action.go
index <HASH>..<HASH> 100644
--- a/models/action.go
+++ b/models/action.go
@@ -142,18 +142,6 @@ func updateIssuesCommit(userId, repoId int64, repoUserName, repoName string, com
return err
}
- issue.Repo, err = GetRepositoryById(issue.RepoId)
-
- if err != nil {
- return err
- }
-
- issue.Repo.NumClosedIssues++
-
- if err = UpdateRepository(issue.Repo); err != nil {
- return err
- }
-
if err = ChangeMilestoneIssueStats(issue); err != nil {
return err
} | Fix double decrement of issue counter | gogs_gogs | train | go |
1d3e0da183f676ecc70e5aef24f91899483d19fd | diff --git a/code/Extensions/CWPUserDefinedFormExtension.php b/code/Extensions/CWPUserDefinedFormExtension.php
index <HASH>..<HASH> 100644
--- a/code/Extensions/CWPUserDefinedFormExtension.php
+++ b/code/Extensions/CWPUserDefinedFormExtension.php
@@ -60,11 +60,13 @@ class CWPUserDefinedFormExtension extends DataExtension
)),
EditableTextField::create(array(
'Title' => 'Name',
- 'Required' => true
+ 'Required' => true,
+ 'RightTitle' => 'Please enter your first and last name'
)),
EditableEmailField::create(array(
'Title' => 'Email',
- 'Required' => true
+ 'Required' => true,
+ 'Placeholder' => '[email protected]'
)),
EditableTextField::create(array(
'Title' => 'Subject' | CWPT-<I>: Add placeholder and description to some contact user form example fields | silverstripe_cwp-agencyextensions | train | php |
b896d8d69c3f0d687b3afe9d17dc5bdfd534cba6 | diff --git a/apiserver/client/status.go b/apiserver/client/status.go
index <HASH>..<HASH> 100644
--- a/apiserver/client/status.go
+++ b/apiserver/client/status.go
@@ -133,7 +133,7 @@ func (c *Client) StatusHistory(request params.StatusHistoryRequests) params.Stat
hist []params.DetailedStatus
)
kind := status.HistoryKind(request.Kind)
- err = errors.NotValidf("%q requires a unit, got %t", kind, request.Tag)
+ err = errors.NotValidf("%q requires a unit, got %T", kind, request.Tag)
switch kind {
case status.KindUnit, status.KindWorkload, status.KindUnitAgent:
var u names.UnitTag
diff --git a/apiserver/uniter/uniter.go b/apiserver/uniter/uniter.go
index <HASH>..<HASH> 100644
--- a/apiserver/uniter/uniter.go
+++ b/apiserver/uniter/uniter.go
@@ -571,7 +571,7 @@ func (u *UniterAPIV3) charmModifiedVersion(tagStr string, canAccess func(names.T
return -1, err
}
default:
- return -1, errors.BadRequestf("type %t does not have a CharmModifiedVersion", entity)
+ return -1, errors.BadRequestf("type %T does not have a CharmModifiedVersion", entity)
}
return service.CharmModifiedVersion(), nil
} | Fixed incorrect format strings
These were picked up after improving the go vet command used in
scripts/verify.sh and they're only found under Go <I>. go vet under <I>
doesn't seem to do checking for %t. | juju_juju | train | go,go |
65d0eaab1e362185334c6730398711703822c764 | diff --git a/plugins/CoreHome/javascripts/autocomplete.js b/plugins/CoreHome/javascripts/autocomplete.js
index <HASH>..<HASH> 100644
--- a/plugins/CoreHome/javascripts/autocomplete.js
+++ b/plugins/CoreHome/javascripts/autocomplete.js
@@ -78,12 +78,12 @@ $(function () {
// autocomplete.js allows item names to be HTML, so we have to entity the site name in PHP.
// to avoid double encoding, we decode before setting text.
// note: use of $.html() would not be future-proof.
- var name = piwikHelper.htmlDecode(ui.item.name);
+ ui.item.name = piwikHelper.htmlDecode(ui.item.name);
// set attributes of selected site display (what shows in the box)
$('.custom_select_main_link', selector)
.attr('data-siteid', ui.item.id)
- .html($('<span/>').text(name));
+ .html($('<span/>').text(ui.item.name));
// hide the dropdown
$('.custom_select_block', selector).removeClass('custom_select_block_show'); | Make sure double encoded site name fix works in all cases. | matomo-org_matomo | train | js |
95dc723ed4de2944fad69ef756f8cabbdf772861 | diff --git a/manifest.php b/manifest.php
index <HASH>..<HASH> 100755
--- a/manifest.php
+++ b/manifest.php
@@ -31,7 +31,7 @@ return array(
'label' => 'Tao base',
'description' => 'TAO meta-extension',
'license' => 'GPL-2.0',
- 'version' => '7.37.2',
+ 'version' => '7.38.0',
'author' => 'Open Assessment Technologies, CRP Henri Tudor',
'requires' => array(
'generis' => '>=3.9.0',
diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php
index <HASH>..<HASH> 100644
--- a/scripts/update/Updater.php
+++ b/scripts/update/Updater.php
@@ -637,7 +637,7 @@ class Updater extends \common_ext_ExtensionUpdater {
$this->setVersion('7.35.0');
}
- $this->skip('7.35.0', '7.37.2');
+ $this->skip('7.35.0', '7.38.0');
}
private function migrateFsAccess() { | Bump to version <I> | oat-sa_tao-core | train | php,php |
15c3b7f783b44e02b24c3623bbc0571361acbf4a | diff --git a/src/Everon/FileSystem.php b/src/Everon/FileSystem.php
index <HASH>..<HASH> 100644
--- a/src/Everon/FileSystem.php
+++ b/src/Everon/FileSystem.php
@@ -286,20 +286,27 @@ class FileSystem implements Interfaces\FileSystem
{
return new FileSystem\TmpFile();
}
-
-
+
/**
* @inheritdoc
*/
public function moveUploadedFile($file_path, $destination, $create_directory = true)
{
- $directory = pathinfo($destination, PATHINFO_DIRNAME);
-
- if ($this->directoryExists($directory) === false && $create_directory === true) {
- $this->createPath($directory);
+ if (is_uploaded_file($file_path) === false) {
+ throw new Exception\FileSystem('The file needs to be uploaded in order to be moved');
+ }
+
+ try {
+ $directory = pathinfo($destination, PATHINFO_DIRNAME);
+ if ($this->directoryExists($directory) === false && $create_directory === true) {
+ $this->createPath($directory);
+ }
+
+ return move_uploaded_file($file_path, $destination) === true;
+ }
+ catch (\Exception $e) {
+ throw new Exception\FileSystem($e);
}
-
- return move_uploaded_file($file_path, $destination);
}
/** | added is_uploaded_file() to moveUploadedFile() | oliwierptak_Everon1 | train | php |
8bcd000829e50b43d3f8ebda083473d6cde89b9d | diff --git a/core/server/errors.js b/core/server/errors.js
index <HASH>..<HASH> 100644
--- a/core/server/errors.js
+++ b/core/server/errors.js
@@ -166,6 +166,7 @@ var errors = {
}
};
+util.inherits(GhostError, Error);
_.each(errors, function (error) {
util.inherits(error, GhostError);
});
diff --git a/core/test/unit/errors_spec.js b/core/test/unit/errors_spec.js
index <HASH>..<HASH> 100644
--- a/core/test/unit/errors_spec.js
+++ b/core/test/unit/errors_spec.js
@@ -4,6 +4,11 @@ var errors = require('../../server/errors'),
should.equal(true, true);
describe('Errors', function () {
+ it('Ensure we inherit from Error', function () {
+ var ghostError = new errors.GhostError();
+ (ghostError instanceof Error).should.eql(true);
+ });
+
describe('Inherite from other error', function () {
it('default', function () {
var someError = new Error(), ghostError; | 🐛 GhostError needs to inherit from Error (#<I>)
no issue | TryGhost_Ghost | train | js,js |
44a7e949bffd471f3c43ba77a2be7ce1e04651ce | diff --git a/lib/irc.js b/lib/irc.js
index <HASH>..<HASH> 100755
--- a/lib/irc.js
+++ b/lib/irc.js
@@ -1232,6 +1232,18 @@ Client.prototype.privmsg = function(target, message, forcePushBack) {
send(head.trim());
// and recurse
cutAndSend(tail.trim());
+ } else if (msgStr.indexOf('\n') !== -1) {
+ // split the message
+ var parts = msgStr.split(/\n/g);
+
+ // send
+ send(parts[0]);
+
+ // recurse
+ if (parts.length > 0) {
+ parts.shift();
+ cutAndSend(parts.join('\n'));
+ }
} else {
send(msgStr);
} | Splitting privmsgs via \n and sending as individual messages. Fixes ircanywhere/ircanywhere#<I> | ircanywhere_irc-factory | train | js |
a6d559b9bc4c8efb12a92955f2adb1463b1590bf | diff --git a/externs/w3c_xml.js b/externs/w3c_xml.js
index <HASH>..<HASH> 100644
--- a/externs/w3c_xml.js
+++ b/externs/w3c_xml.js
@@ -288,10 +288,22 @@ XPathNamespace.XPATH_NAMESPACE_NODE = 13;
* server.
*
* @constructor
+ * @implements {EventTarget}
* @see http://www.w3.org/TR/XMLHttpRequest/#xmlhttprequest-object
*/
function XMLHttpRequest() {}
+/** @override */
+XMLHttpRequest.prototype.addEventListener =
+ function(type, listener, useCapture) {};
+
+/** @override */
+XMLHttpRequest.prototype.removeEventListener =
+ function(type, listener, useCapture) {};
+
+/** @override */
+XMLHttpRequest.prototype.dispatchEvent = function(evt) {};
+
/**
* @param {string} method
* @param {string} url | add some missing externs declarations,
as pointed out on closure-compiler-discuss
R=pallosp
DELTA=<I> (<I> added, 0 deleted, 0 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=<I>
git-svn-id: <URL> | google_closure-compiler | train | js |
5ba4000f774b51a206a8a05b208f5c637010d42d | diff --git a/tests/integration/test_requests.py b/tests/integration/test_requests.py
index <HASH>..<HASH> 100644
--- a/tests/integration/test_requests.py
+++ b/tests/integration/test_requests.py
@@ -130,3 +130,18 @@ def test_gzip(tmpdir, scheme):
with vcr.use_cassette(str(tmpdir.join('gzip.yaml'))) as cass:
assert_is_json(response.content)
+
+
+def test_session_and_connection_close(tmpdir, scheme):
+ '''
+ This tests the issue in https://github.com/kevin1024/vcrpy/issues/48
+
+ If you use a requests.session and the connection is closed, then an
+ exception is raised in the urllib3 module vendored into requests:
+ `AttributeError: 'NoneType' object has no attribute 'settimeout'`
+ '''
+ with vcr.use_cassette(str(tmpdir.join('session_connection_closed.yaml'))):
+ session = requests.session()
+
+ resp = session.get('http://httpbin.org/get', headers={'Connection': 'close'})
+ resp = session.get('http://httpbin.org/get', headers={'Connection': 'close'}) | Add test: test_session_and_connection_close
This is a test for issue GH-<I>. | kevin1024_vcrpy | train | py |
6c087a0cbc4114ea6d19cb65942652c7467df903 | diff --git a/nodeconductor/structure/serializers.py b/nodeconductor/structure/serializers.py
index <HASH>..<HASH> 100644
--- a/nodeconductor/structure/serializers.py
+++ b/nodeconductor/structure/serializers.py
@@ -1302,7 +1302,7 @@ class BaseResourceSerializer(six.with_metaclass(ResourceSerializerMetaclass,
def validate_service_project_link(self, service_project_link):
if not service_project_link.is_policy_compliant:
- raise serializers.ValidationError('Cannot create resource for policy non-compliant service.')
+ raise serializers.ValidationError('Cannot create a resource for a policy non-compliant service.')
@transaction.atomic
def create(self, validated_data): | Add missing article [WAL-<I>] | opennode_waldur-core | train | py |
0d4546c9655f871f1cecd3fb8ce7dc9c6598cc24 | diff --git a/server.go b/server.go
index <HASH>..<HASH> 100644
--- a/server.go
+++ b/server.go
@@ -2516,6 +2516,9 @@ func addrStringToNetAddr(addr string) (net.Addr, error) {
if err != nil {
return nil, err
}
+ if len(ips) == 0 {
+ return nil, fmt.Errorf("no addresses found for %s", host)
+ }
port, err := strconv.Atoi(strPort)
if err != nil { | server: Return error on address lookup fails.
This corrects an issue introduced by commit
e8f<I>bc<I>b<I>ccc2ea<I>f8c<I>ba where a failure to lookup a
hostname could lead to a panic in certain circumstances. An error is
now returned in that case as expected. | btcsuite_btcd | train | go |
e7135ba7a421115f1c7888b216e76d12e037b910 | diff --git a/qiskit/circuit/quantumcircuit.py b/qiskit/circuit/quantumcircuit.py
index <HASH>..<HASH> 100644
--- a/qiskit/circuit/quantumcircuit.py
+++ b/qiskit/circuit/quantumcircuit.py
@@ -400,10 +400,6 @@ class QuantumCircuit:
return instruction
- def _attach(self, instruction, qargs, cargs):
- """DEPRECATED after 0.8"""
- self.append(instruction, qargs, cargs)
-
def add_register(self, *regs):
"""Add registers."""
if not regs: | Removed deprecated circuit._attach (#<I>)
* Removed circuit._attach
* Linting | Qiskit_qiskit-terra | train | py |
0b95267e48618700ffeec39f20c03d83c7c21fe0 | diff --git a/lib/Pool.js b/lib/Pool.js
index <HASH>..<HASH> 100644
--- a/lib/Pool.js
+++ b/lib/Pool.js
@@ -22,7 +22,13 @@ Pool.prototype.aquire = function()
}
var item = this.freeList.pop();
- this.T.call(item);
+
+ // We can provide explicit initing, otherwise re-call constructor (hackish)
+ if (item.__init)
+ item.__init();
+ else
+ this.T.call(item);
+
return item;
};
diff --git a/test/pool.js b/test/pool.js
index <HASH>..<HASH> 100644
--- a/test/pool.js
+++ b/test/pool.js
@@ -42,3 +42,25 @@ test('object reseting', function(t) {
t.strictEqual(v2.y, 0, 'y reset');
});
+
+test('Explicit init', function(t) {
+ t.plan(5);
+
+ function V() { this.x = 0; this.y = 0; }
+ V.prototype.__init = function() {
+ this.x = this.y = 0;
+ t.pass('__init fired');
+ };
+
+ var pool = new Pool(V);
+
+ var v = pool.aquire();
+ v.x = 5;
+ v.y = 7;
+ pool.release(v);
+ var u = pool.aquire();
+ t.strictEqual(u, v);
+ t.strictEqual(u.x, 0);
+ t.strictEqual(u.y, 0);
+
+}); | Can have an explicit __init method | bvalosek_tiny-ecs | train | js,js |
f1f10e148d660e86be098fdb34b65372c2652c89 | diff --git a/lib/fog_tracker/account_tracker.rb b/lib/fog_tracker/account_tracker.rb
index <HASH>..<HASH> 100644
--- a/lib/fog_tracker/account_tracker.rb
+++ b/lib/fog_tracker/account_tracker.rb
@@ -44,8 +44,8 @@ module FogTracker
sleep @delay
end
rescue Exception => e
- @log.error "on account #{name}: #{e.message}"
- @log.error e.backtrace.inspect
+ @log.error "Exception polling account #{name}: #{e.message}"
+ @log.error e.backtrace.join("\n")
exit
end
end | Improve Exception reporting in Tracker threads | benton_fog_tracker | train | rb |
aba4747c006d8a901ab180bb9763b919ed557836 | diff --git a/src/script.js b/src/script.js
index <HASH>..<HASH> 100644
--- a/src/script.js
+++ b/src/script.js
@@ -21,27 +21,15 @@ import {tryPromise, isGeneratorFunction, isAbsoluteOrRelative, bind, normalizeCo
import defaultExtensions from './extensions.js';
-let scriptCache = new Map();
let promisifyCache = new Map();
export function load( filename, watch = true, parent = null ) {
- var script;
filename = resolve( filename );
- if( scriptCache.has( filename ) ) {
- script = scriptCache.get( filename );
+ let script = new Script( null, parent );
- } else {
- script = new Script( null, parent );
-
- script.load( filename, watch );
-
- //Remove the reference to the script upon close, even if it isn't permenant
- script.once( 'close', () => {
- scriptCache.delete( filename );
- } );
- }
+ script.load( filename, watch );
return script;
} | src: Remove the scriptCache that was used to cache scripts created through Scriptor.load | novacrazy_scriptor | train | js |
793cc85229725fb08c9c8b87c8789fc9349fe043 | diff --git a/lib/extension.js b/lib/extension.js
index <HASH>..<HASH> 100644
--- a/lib/extension.js
+++ b/lib/extension.js
@@ -49,6 +49,11 @@ function assetRegister(moduleName, type, makeAsset){
}
});
}
+ // If we still haven't found one, set the bundleName as a bundle.
+ if(!bundle) {
+ var bundleName = findBundleName(moduleName);
+ bundle = bundles[bundleName] = {};
+ }
}
bundle[moduleName] = {
@@ -67,13 +72,18 @@ function isProduction(options){
}
}
-function findBundle(moduleName){
+function findBundleName(moduleName) {
var parent = parentMap[moduleName],
- bundleName = parent;
+ bundleName = parent;
while(parent) {
parent = parentMap[parent];
if(parent) bundleName = parent;
}
+ return bundleName;
+}
+
+function findBundle(moduleName){
+ var bundleName = findBundleName(moduleName);
return bundles[bundleName];
} | Make bundle finding more forgiving
This makes looking for bundles (bundles are the top-level modules that
import everything else) work with virtual modules such as those
created by plugins (the done-component plugin creates modules with
System.define).
Might fix #1 | donejs_done-ssr | train | js |
19da50cb6e7cc569d7393322d7cd9ad5c89b3d8e | diff --git a/src/main/java/spark/http/matching/ResponseWrapper.java b/src/main/java/spark/http/matching/ResponseWrapper.java
index <HASH>..<HASH> 100644
--- a/src/main/java/spark/http/matching/ResponseWrapper.java
+++ b/src/main/java/spark/http/matching/ResponseWrapper.java
@@ -127,6 +127,11 @@ class ResponseWrapper extends Response {
}
@Override
+ public void cookie(String path, String name, String value, int maxAge, boolean secured, boolean httpOnly) {
+ delegate.cookie(path, name, value, maxAge, secured, httpOnly);
+ }
+
+ @Override
public void removeCookie(String name) {
delegate.removeCookie(name);
} | added missing delegate implementation in ResponseWrapper | perwendel_spark | train | java |
32a00a9f5d552606160e3848346eb5c0f9a099a2 | diff --git a/Lib/glyphsLib/classes.py b/Lib/glyphsLib/classes.py
index <HASH>..<HASH> 100755
--- a/Lib/glyphsLib/classes.py
+++ b/Lib/glyphsLib/classes.py
@@ -2855,6 +2855,8 @@ class GSAnnotation(GSBase):
def _serialize_to_plist(self, writer):
writer.writeObjectKeyValue(self, "angle", default=0)
posKey = "position"
+ if writer.format_version > 2:
+ posKey = "pos"
writer.writeObjectKeyValue(
self, "position", keyName=posKey, default=Point(0, 0)
) | Write GSAnnotation in G3 style | googlefonts_glyphsLib | train | py |
9f931eba7758bb0c68fca237edb2ea67294f331d | diff --git a/example/ActualUseCases.py b/example/ActualUseCases.py
index <HASH>..<HASH> 100644
--- a/example/ActualUseCases.py
+++ b/example/ActualUseCases.py
@@ -2,7 +2,7 @@ import sys
sys.path.insert(0, '../')
import unittest
-import sinon.sinon as sinon
+import sinon
from TestClass import ForTestOnly
def A_func(): | fix CI failed (import) | note35_sinon | train | py |
e8490c0daed79324229e0023c3106ca67813ce18 | diff --git a/flask_unchained/bundles/security/views/user_resource.py b/flask_unchained/bundles/security/views/user_resource.py
index <HASH>..<HASH> 100644
--- a/flask_unchained/bundles/security/views/user_resource.py
+++ b/flask_unchained/bundles/security/views/user_resource.py
@@ -1,9 +1,5 @@
-try:
- from flask_unchained.bundles.api import ModelResource
-except ImportError:
- from py_meta_utils import OptionalClass as ModelResource
-
from flask_unchained import CREATE, GET, PATCH, injectable
+from flask_unchained.bundles.api import ModelResource
from ..decorators import anonymous_user_required, auth_required_same_user
from ..models import User | UserResource depends on the API bundle | briancappello_flask-unchained | train | py |
0f9d04d2297d767fc6044848e6acd7a97fb49c30 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -9,9 +9,11 @@ setup(
name='django-useraudit',
version='1.0.0',
description='Django user audit utilities like logging user log in, disabling access when password expires or user is inactive',
+ long_description='Django user audit utilities like logging user log in, disabling access when password expires or user is inactive',
author='CCG, Murdoch University',
+ author_email='[email protected]',
url='https://github.com/muccg/django-useraudit',
- download_url='https://github.com/muccg/django-useraudit/downloads',
+ download_url='https://github.com/muccg/django-useraudit/releases',
classifiers=[
"Framework :: Django",
"Intended Audience :: Developers",
@@ -26,4 +28,5 @@ setup(
'useraudit.migrations',
'useraudit.south_migrations',
],
+ include_package_date=True,
) | Small updates to fields in setup.py | muccg_django-useraudit | train | py |
c91d2e301b28e51a817d5900a3353d48bb6c1bb8 | diff --git a/strategies/swarm.js b/strategies/swarm.js
index <HASH>..<HASH> 100644
--- a/strategies/swarm.js
+++ b/strategies/swarm.js
@@ -502,6 +502,7 @@ const engine = {
deployService (options, cb) {
let payload = utils.cloneObj(require(__dirname + '/../schemas/swarm/service.template.js'));
options.params.variables.push('SOAJS_DEPLOY_HA=swarm');
+ options.params.variables.push('SOAJS_HA_NAME={{.Task.Name}}');
payload.Name = options.params.name;
payload.TaskTemplate.ContainerSpec.Image = options.params.image; | Added a new environment variable when deploying service, swarm driver | soajs_soajs.core.drivers | train | js |
d9d99c1c27732b8ebb973b91ce958ebe5022a640 | diff --git a/addons/fit/fit.js b/addons/fit/fit.js
index <HASH>..<HASH> 100644
--- a/addons/fit/fit.js
+++ b/addons/fit/fit.js
@@ -20,7 +20,7 @@
} else {
/*
* Plain browser environment
- */
+ */
fit(this.Xterm);
}
})(function (Xterm) {
@@ -44,22 +44,12 @@
subjectRow.style.display = 'inline';
subjectRow.innerHTML = 'W'; // Common character for measuring width, although on monospace
- characterWidth = parseInt(subjectRow.offsetWidth);
+ characterWidth = subjectRow.getBoundingClientRect().width;
subjectRow.style.display = ''; // Revert style before calculating height, since they differ.
characterHeight = parseInt(subjectRow.offsetHeight);
subjectRow.innerHTML = contentBuffer;
rows = parseInt(availableHeight / characterHeight);
- /*
- * The following hack takes place in order to get "fit" work properly
- * in Mozilla Firefox.
- * Most probably, because of a dimension calculation bug, Firefox
- * calculates the width to be 1px less than it is actually drawn on
- * screen.
- */
- if (navigator.userAgent.match(/Firefox/)) {
- characterWidth++;
- }
cols = parseInt(availableWidth / characterWidth);
geometry = {cols: cols, rows: rows};
@@ -71,4 +61,4 @@
this.resize(geometry.cols, geometry.rows);
};
-});
\ No newline at end of file
+}); | fixed width of fit
removed firefox hack since it is no longer needed | xtermjs_xterm.js | train | js |
429f76dfba9cc715b9ec4fa4d7141473525c799d | diff --git a/parler/admin.py b/parler/admin.py
index <HASH>..<HASH> 100644
--- a/parler/admin.py
+++ b/parler/admin.py
@@ -114,12 +114,20 @@ class TranslatableAdmin(admin.ModelAdmin):
The language column which can be included in the ``list_display``.
"""
languages = self.get_available_languages(object)
+ languages = [self.get_language_short_title(code) for code in languages]
return u'<span class="available-languages">{0}</span>'.format(' '.join(languages))
language_column.allow_tags = True
language_column.short_description = _("Languages")
+ def get_language_short_title(self, language_code):
+ """
+ Hook for allowing to change the title in the :func:`language_column` of the list_display.
+ """
+ return language_code
+
+
def get_available_languages(self, obj):
"""
Fetching the available languages as queryset. | Allow customizing the language_column title. | django-parler_django-parler | train | py |
49e5f97986cc31732b39c497e15a878de29592bd | diff --git a/lib/document_mapper/query.rb b/lib/document_mapper/query.rb
index <HASH>..<HASH> 100644
--- a/lib/document_mapper/query.rb
+++ b/lib/document_mapper/query.rb
@@ -43,7 +43,7 @@ module DocumentMapper
def all
result = @model.select(:where => @where, :order_by => @order_by)
if @offset.present?
- result = result.last(result.size - @offset)
+ result = result.last([result.size - @offset, 0].max)
end
if @limit.present?
result = result.first(@limit)
diff --git a/test/document_mapper/document_mapper_test.rb b/test/document_mapper/document_mapper_test.rb
index <HASH>..<HASH> 100644
--- a/test/document_mapper/document_mapper_test.rb
+++ b/test/document_mapper/document_mapper_test.rb
@@ -121,6 +121,10 @@ describe MyDocument do
it 'should support offset and limit at the same time' do
assert_equal_set [2,3], MyDocument.order_by(:id).offset(1).limit(2).all.map(&:id)
end
+
+ it 'should not freak out about an offset higher than the document count' do
+ assert_equal_set [], MyDocument.order_by(:id).offset(5).all
+ end
end
describe 'resetting the MyDocument class' do | Allow offsets higher than the number of documents | ralph_document_mapper | train | rb,rb |
dd47ea20145a27c9dfc7a92aa6eef3fda2500d0e | diff --git a/lib/util/statsd.js b/lib/util/statsd.js
index <HASH>..<HASH> 100644
--- a/lib/util/statsd.js
+++ b/lib/util/statsd.js
@@ -3,7 +3,6 @@ var util = require("util");
var _ = require("lodash");
var SDC = require("statsd-client");
-var enabled = process.env.MAGELLAN_STATSD ? true : false;
// second check for magellan compatibility
var magellanJobName = process.env.MAGELLAN_JOB_NAME;
@@ -24,8 +23,7 @@ module.exports = function statd(options) {
}
*/
- if (!enabled ||
- (!options.config.host || options.config.host === "") ||
+ if ((!options.config.host || options.config.host === "") ||
(!options.config.port || options.config.port === "")) {
// let's do all kinds of validation here
return; | only read from nightwatch.config/globals | TestArmada_nightwatch-extra | train | js |
4f97c909f3aeaa3351da473d12eba461ace0be76 | diff --git a/single_stage_detector/ssd/train.py b/single_stage_detector/ssd/train.py
index <HASH>..<HASH> 100644
--- a/single_stage_detector/ssd/train.py
+++ b/single_stage_detector/ssd/train.py
@@ -43,10 +43,10 @@ def parse_args():
help='path to model checkpoint file')
parser.add_argument('--no-save', action='store_true',
help='save model checkpoints')
- parser.add_argument('--val-interval', type=int, default=None,
+ parser.add_argument('--val-interval', type=int, default=5,
help='epoch interval for validation in addition to --val-epochs.')
parser.add_argument('--val-epochs', nargs='*', type=int,
- default=[40, 50, 55, 60, 65, 70, 75, 80],
+ default=[],
help='epochs at which to evaluate in addition to --val-interval')
parser.add_argument('--batch-splits', type=int, default=1,
help='Split batch to N steps (gradient accumulation)') | [SSD] Updated eval schedule to every 5th epoch (#<I>) | mlperf_training | train | py |
Subsets and Splits