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
|
---|---|---|---|---|---|
942ee9cfd6e2b7ff9dfe6eca7c4aa385d3ba9507 | diff --git a/examples/opencv/opencv.py b/examples/opencv/opencv.py
index <HASH>..<HASH> 100755
--- a/examples/opencv/opencv.py
+++ b/examples/opencv/opencv.py
@@ -17,6 +17,16 @@ def relpath(path):
return os.path.join(os.path.dirname(os.path.abspath(__file__)), path)
def main():
+ # Connects to a pachyderm cluster on the default host:port
+ # (`localhost:30650`). This will work for certain environments (e.g. k8s
+ # running on docker for mac), as well as when port forwarding is being
+ # used. For other setups, you'll want one of the alternatives:
+ # 1) To connect to pachyderm when this script is running inside the
+ # cluster, use `python_pachyderm.Client.new_in_cluster()`.
+ # 2) To connect to pachyderm via a pachd address, use
+ # `python_pachyderm.Client.new_from_pachd_address`.
+ # 3) To explicitly set the host and port, pass parameters into
+ # `python_pachyderm.Client()`.
client = python_pachyderm.Client()
# Create a repo called images | Connection options in docs (#<I>)
Explain connection options in opencv example | pachyderm_python-pachyderm | train | py |
a441ea1cb6895b0f134a49dbd97a1fde489d0e7f | diff --git a/pysat/_meta.py b/pysat/_meta.py
index <HASH>..<HASH> 100644
--- a/pysat/_meta.py
+++ b/pysat/_meta.py
@@ -208,7 +208,7 @@ class Meta(object):
if metadata is not None:
if isinstance(metadata, DataFrame):
self.data = metadata
- self.data.columns = map(''.lower, self.data.columns)
+ self.data.columns = map(str.lower, self.data.columns)
if 'long_name' not in self.data.columns:
self.data['long_name'] = self.data.index
if 'units' not in self.data.columns: | Attempting to fix bug for python 3+ | rstoneback_pysat | train | py |
28a54e256df8380bc30b93ffbab3f55c0f9158f9 | diff --git a/annis-gui/src/main/java/annis/gui/SearchUI.java b/annis-gui/src/main/java/annis/gui/SearchUI.java
index <HASH>..<HASH> 100644
--- a/annis-gui/src/main/java/annis/gui/SearchUI.java
+++ b/annis-gui/src/main/java/annis/gui/SearchUI.java
@@ -331,7 +331,7 @@ public class SearchUI extends AnnisBaseUI
mainTab.addSelectedTabChangeListener(queryController);
mainTab.addStyleName("blue-tab");
- Tab helpTab = mainTab.addTab(help, "Help");
+ Tab helpTab = mainTab.addTab(help, "Help/Examples");
helpTab.setIcon(new ThemeResource("tango-icons/16x16/help-browser.png"));
helpTab.setClosable(false);
controlPanel = new ControlPanel(queryController, instanceConfig, | change tab caption to "Help/Examples" | korpling_ANNIS | train | java |
124144d0c45d683b4a4e9f2ed27ed43688f5a8da | diff --git a/src/Illuminate/Support/Str.php b/src/Illuminate/Support/Str.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Support/Str.php
+++ b/src/Illuminate/Support/Str.php
@@ -403,7 +403,7 @@ class Str
public static function startsWith($haystack, $needles)
{
foreach ((array) $needles as $needle) {
- if ($needle != '' && strpos((string) $haystack, (string) $needle) === 0) {
+ if ($needle != '' && substr($haystack, 0, strlen($needle)) === (string) $needle) {
return true;
}
} | Revert changes to startsWith() (#<I>) | laravel_framework | train | php |
319066f0810aade3f10b882c176162d8f19b4bce | diff --git a/pyneuroml/pynml.py b/pyneuroml/pynml.py
index <HASH>..<HASH> 100644
--- a/pyneuroml/pynml.py
+++ b/pyneuroml/pynml.py
@@ -959,15 +959,20 @@ def evaluate_arguments(args):
elif args.graph:
- level = int(args.graph[0])
- print('Converting %s to graphical form, level %i'%(args.lems_file,level))
+ from neuromllite.GraphVizHandler import GraphVizHandler, engines
+ engine = 'dot'
+ try:
+ level = int(args.graph[0])
+ except:
+ engine = engines[args.graph[0][-1:]]
+ level = int(args.graph[0][:-1])
+
+ print('Converting %s to graphical form, level %i, engine %s'%(args.lems_file,level,engine))
from neuroml.hdf5.NeuroMLXMLParser import NeuroMLXMLParser
- from neuromllite.GraphVizHandler import GraphVizHandler
-
- handler = GraphVizHandler(level, None)
+ handler = GraphVizHandler(level=level, engine=engine, nl_network=None)
currParser = NeuroMLXMLParser(handler) | Improves reading options for graphing, e.g.: pynml MyNet.net.nml -graph 5c | NeuroML_pyNeuroML | train | py |
582557ea0abf876da910928cbad80cd7dfee8a9e | diff --git a/org.jenetix/src/main/java/org/jenetix/util/MutableTreeNode.java b/org.jenetix/src/main/java/org/jenetix/util/MutableTreeNode.java
index <HASH>..<HASH> 100644
--- a/org.jenetix/src/main/java/org/jenetix/util/MutableTreeNode.java
+++ b/org.jenetix/src/main/java/org/jenetix/util/MutableTreeNode.java
@@ -1132,7 +1132,7 @@ public class MutableTreeNode<T> implements Serializable {
MutableTreeNode<T> current = descendant;
while (current != ancestor) {
current = current._parent;
- if (current == null && descendant != ancestor) {
+ if (current == null) {
throw new IllegalArgumentException(
"Node " + ancestor + " is not an ancestor of " +
descendant + "." | #<I>: Code improvements. | jenetics_jenetics | train | java |
9e442a85a28efa9d015d23fee8eb27e6c55b8dd4 | diff --git a/src/main/java/de/zalando/typemapper/core/TypeMapper.java b/src/main/java/de/zalando/typemapper/core/TypeMapper.java
index <HASH>..<HASH> 100644
--- a/src/main/java/de/zalando/typemapper/core/TypeMapper.java
+++ b/src/main/java/de/zalando/typemapper/core/TypeMapper.java
@@ -15,7 +15,7 @@ import org.postgresql.util.PGobject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
+import org.springframework.jdbc.core.RowMapper;
import de.zalando.typemapper.core.db.DbFunction;
import de.zalando.typemapper.core.db.DbFunctionRegister;
@@ -32,7 +32,7 @@ import de.zalando.typemapper.core.result.SimpleResultNode;
import de.zalando.typemapper.parser.exception.RowParserException;
import de.zalando.typemapper.parser.postgres.ParseUtils;
-public class TypeMapper<ITEM> implements ParameterizedRowMapper<ITEM> {
+public class TypeMapper<ITEM> implements RowMapper<ITEM> {
private static final Logger LOG = LoggerFactory.getLogger(TypeMapper.class); | Change ParameterizedRowMapper to RowMapper.
So, ParameterizedRowMapper is deprecated for now and removed from latest Spring version.
RowMapper is a legal placeholder of ParameterizedRowMapper since Spring <I> | zalando-stups_java-sproc-wrapper | train | java |
0cd5e81b9a2e95afe4684217a5bd1857f69facda | diff --git a/tests/test_test_endpoint_docstrings.py b/tests/test_test_endpoint_docstrings.py
index <HASH>..<HASH> 100644
--- a/tests/test_test_endpoint_docstrings.py
+++ b/tests/test_test_endpoint_docstrings.py
@@ -3,7 +3,7 @@ from canvasapi.canvas_object import CanvasObject
from canvasapi.folder import Folder
from canvasapi.util import combine_kwargs, obj_or_id
from tests.test_endpoint_docstrings import test_method
-from tests.test_endpoint_docstrings import test_methods
+# from tests.test_endpoint_docstrings import test_methods
# test_endpoint_docstrings
@@ -16,7 +16,7 @@ class TestTestEndpointDocstrings(unittest.TestCase):
assert test_method(ExampleMethods.passes_multiple_endpoints, True)
assert test_method(ExampleMethods.passes_multiline_URL, True)
assert test_method(ExampleMethods.passes_calls_but_not_api, True)
- test_methods()
+ # test_methods()
class ExampleMethods(CanvasObject): | downgraded "syntax error" to "failed to parse", test pass if no URL | ucfopen_canvasapi | train | py |
41a53737a1674d786476adfcf38cb57d320abe94 | diff --git a/Adafruit_PN532/PN532.py b/Adafruit_PN532/PN532.py
index <HASH>..<HASH> 100644
--- a/Adafruit_PN532/PN532.py
+++ b/Adafruit_PN532/PN532.py
@@ -333,6 +333,8 @@ class PN532(object):
Ver, Rev, and Support values.
"""
response = self.call_function(PN532_COMMAND_GETFIRMWAREVERSION, 4)
+ if response is None:
+ raise RuntimeError('Failed to detect the PN532! Make sure there is sufficient power (use a 1 amp or greater power supply), the PN532 is wired correctly to the device, and the solder joints on the PN532 headers are solidly connected.')
return (response[0], response[1], response[2], response[3])
def SAM_configuration(self): | Add check for failure to find PN<I> and throw better error. | adafruit_Adafruit_Python_PN532 | train | py |
fedbf711a1c76bb2a9ff80e50a07526bedd6a639 | diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/HttpKernel/Kernel.php
+++ b/src/Symfony/Component/HttpKernel/Kernel.php
@@ -60,12 +60,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface
protected $startTime;
protected $loadClassCache;
- const VERSION = '2.3.32';
- const VERSION_ID = '20332';
+ const VERSION = '2.3.33-DEV';
+ const VERSION_ID = '20333';
const MAJOR_VERSION = '2';
const MINOR_VERSION = '3';
- const RELEASE_VERSION = '32';
- const EXTRA_VERSION = '';
+ const RELEASE_VERSION = '33';
+ const EXTRA_VERSION = 'DEV';
/**
* Constructor. | bumped Symfony version to <I> | symfony_symfony | train | php |
3aeebb50047f051f1a18886d1795176bb1290d2e | diff --git a/lib/compile.js b/lib/compile.js
index <HASH>..<HASH> 100644
--- a/lib/compile.js
+++ b/lib/compile.js
@@ -14,12 +14,7 @@ module.exports = {
.fromCallback(cb => compiler.run(cb))
.then(stats => {
- if (!this.multiCompile) {
- stats = { stats: [stats] };
- }
-
- const compileOutputPaths = [];
- const consoleStats = this.webpackConfig.stats || {
+ let consoleStats = {
colors: true,
hash: false,
version: false,
@@ -27,6 +22,19 @@ module.exports = {
children: false
};
+ if (!this.multiCompile) {
+ stats = { stats: [stats] };
+ if (_.has(this.webpackConfig, 'stats')) {
+ consoleStats = this.webpackConfig.stats;
+ }
+ } else {
+ if (_.has(this.webpackConfig, '0.stats')) {
+ consoleStats = this.webpackConfig[0].stats;
+ }
+ }
+
+ const compileOutputPaths = [];
+
_.forEach(stats.stats, compileStats => {
this.serverless.cli.consoleLog(compileStats.toString(consoleStats)); | fix compile stats in multiple packaging | serverless-heaven_serverless-webpack | train | js |
8e2fab78a7b3d17b42a49bd2887757752c24815c | diff --git a/visio2img/visio2img.py b/visio2img/visio2img.py
index <HASH>..<HASH> 100644
--- a/visio2img/visio2img.py
+++ b/visio2img/visio2img.py
@@ -10,7 +10,7 @@ from math import log
__all__ = ('export_img')
GEN_IMG_FORMATS = ('.gif', '.jpeg', '.jpg', '.png')
-VISIO_FORMATS = ('.vsd', 'vsdx')
+VISIO_FORMATS = ('.vsd', '.vsdx')
def is_pywin32_available(): | Support .vsdx file (fix typo) | visio2img_visio2img | train | py |
687b34748eb98b813d334ce09959f6840555e91a | diff --git a/lib/login/index.js b/lib/login/index.js
index <HASH>..<HASH> 100644
--- a/lib/login/index.js
+++ b/lib/login/index.js
@@ -23,7 +23,7 @@ passport.deserializeUser(function(obj, done) {
done(null, obj);
});
-if (config.login.steam.enabled) {
+if (config.login.steam && config.login.steam.enabled) {
passport.use(new SteamStrategy({
returnURL: 'http://'+ config.baseURL +'/login/auth/steam',
realm: 'http://'+ config.baseURL +'/login/auth/steam',
@@ -45,7 +45,7 @@ if (config.login.steam.enabled) {
));
}
-if (config.login.twitch.enabled) {
+if (config.login.twitch && config.login.twitch.enabled) {
passport.use(new TwitchStrategy({
clientID: config.login.twitch.clientID,
clientSecret: config.login.twitch.clientSecret, | [login] Fix startup crash caused by not having both Steam and Twitch login configurations present in cfg/nodecg.json | nodecg_nodecg | train | js |
31790f58b4f83ca606987ec36fbedfc0d02a1113 | diff --git a/awp/packager.py b/awp/packager.py
index <HASH>..<HASH> 100755
--- a/awp/packager.py
+++ b/awp/packager.py
@@ -9,6 +9,7 @@ import glob
import plistlib
import os
import os.path
+import re
import shutil
from zipfile import ZipFile, ZIP_DEFLATED
@@ -151,8 +152,8 @@ def update_workflow_readme(info, readme_path):
# Set the workflow version to a new version number if one is given
def update_workflow_version(info, new_version_num):
if new_version_num:
- info['version'] = new_version_num
- print('Set version to v{}'.format(new_version_num))
+ info['version'] = re.sub(r'^v', '', new_version_num)
+ print('Set version to v{}'.format(info['version']))
# Write installed workflow subdirectory files to the given zip file | Strip superfluous 'v' prefix from version numbers
Alfred already prepends a 'v' to the given version number. | caleb531_alfred-workflow-packager | train | py |
da01086bebb13432d7816fcb9b9556ee2221d31b | diff --git a/opal/browser/compatibility/dom/element/matches.rb b/opal/browser/compatibility/dom/element/matches.rb
index <HASH>..<HASH> 100644
--- a/opal/browser/compatibility/dom/element/matches.rb
+++ b/opal/browser/compatibility/dom/element/matches.rb
@@ -18,7 +18,9 @@ unless defined?(`window.Element.prototype.matches`)
`#@native.webkitMatchesSelector(#{selector})`
end
else
- raise NotImplementedError, 'matches by selector unsupported'
+ def matches?(*)
+ raise NotImplementedError, 'matches by selector unsupported'
+ end
end
end | dom/element: raise NotImplementedError on the call of #matches? | opal_opal-browser | train | rb |
4e964a62f6c7d7c5f002399d987579a41eaa2932 | diff --git a/vault/core.go b/vault/core.go
index <HASH>..<HASH> 100644
--- a/vault/core.go
+++ b/vault/core.go
@@ -1269,7 +1269,11 @@ func (c *Core) StepDown(token string) error {
return logical.ErrPermissionDenied
}
- c.manualStepDownCh <- struct{}{}
+ select {
+ case c.manualStepDownCh <- struct{}{}:
+ default:
+ c.logger.Printf("[WARN] core: manual step-down operation already queued")
+ }
return nil
} | Add default case for if the step down channel is blocked | hashicorp_vault | train | go |
b1dcdd34de6b88820cb0314af2bc884c9d8656bb | diff --git a/favorites/selectors/index.js b/favorites/selectors/index.js
index <HASH>..<HASH> 100644
--- a/favorites/selectors/index.js
+++ b/favorites/selectors/index.js
@@ -71,6 +71,12 @@ export const hasFavorites = createSelector(
);
/**
+ * Returns true if state is being updated.
+ * @param {Object} state State.
+ * @return {boolean}
+ */
+export const isFetching = state => state.favorites.products.isFetching;
+/**
* Returns true when the current product is on the favorites list
*/
export const isCurrentProductOnFavoriteList = createSelector( | CON-<I> - Favorites: delay removing of item until animation is done + ignore click events while favorites are updating on favorites page | shopgate_pwa | train | js |
a140b3c9cc3d3710952c3e0e66be0885875173c5 | diff --git a/nessie.go b/nessie.go
index <HASH>..<HASH> 100644
--- a/nessie.go
+++ b/nessie.go
@@ -8,7 +8,6 @@ import (
"crypto/x509"
"encoding/base64"
"encoding/json"
- "errors"
"fmt"
"io"
"io/ioutil"
@@ -1052,8 +1051,11 @@ func (n *nessusImpl) Upload(filePath string) error {
return err
}
- if reply.FileUploaded != filepath.Base(filePath) {
- return errors.New("Upload failed")
+ // Duplicate updates will get different replies
+ // request: CIS_CentOS_7_Server_L1_v3.0.0.audit
+ // reply: {FileUploaded:CIS_CentOS_7_Server_L1_v3.0.0-6.audit}
+ if 0 == len(reply.FileUploaded) {
+ return fmt.Errorf("Upload failed, api reply: %+v", reply)
}
return nil | Fix file/upload reply check condition | attwad_nessie | train | go |
2f742d7430e4a266238165732ecda3447acddc86 | diff --git a/spec/lib/db_lock/adapter/sqlserver_spec.rb b/spec/lib/db_lock/adapter/sqlserver_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/db_lock/adapter/sqlserver_spec.rb
+++ b/spec/lib/db_lock/adapter/sqlserver_spec.rb
@@ -35,7 +35,7 @@ module DBLock
time1 = Time.now
expect(subject.lock(name, 1)).to be false
time2 = Time.now
- expect((time2-time1).round(1).to_s).to eq "1.0"
+ expect((time2-time1).round(2)).to be_between(1.0, 1.1).inclusive
end
end | Fix random test fails for sqlserver (#9) | mkon_db_lock | train | rb |
d26a14b0ad939117f65cd50389a26f9ee62b695f | diff --git a/org/xbill/DNS/Message.java b/org/xbill/DNS/Message.java
index <HASH>..<HASH> 100644
--- a/org/xbill/DNS/Message.java
+++ b/org/xbill/DNS/Message.java
@@ -154,8 +154,8 @@ public void
addRecord(Record r, int section) {
if (sections[section] == null)
sections[section] = new LinkedList();
- sections[section].add(r);
header.incCount(section);
+ sections[section].add(r);
}
/** | Increment the section count before adding the new record, so that if too many
records are added, it's caught before modifying the message.
(Bill Kuker <<EMAIL>>
git-svn-id: <URL> | dnsjava_dnsjava | train | java |
5ce7d15aab2403151db6906a4cf8eb106dbffbb7 | diff --git a/ember-cli-build.js b/ember-cli-build.js
index <HASH>..<HASH> 100644
--- a/ember-cli-build.js
+++ b/ember-cli-build.js
@@ -6,9 +6,6 @@ module.exports = function (defaults) {
babel: {
optional: ['es7.decorators']
},
- 'ember-cli-mocha': {
- useLintTree: false
- },
sassOptions: {
includePaths: [
] | remove no longer needed useLintTree from ember-cli-mocha configuration in ember-cli-build.js | ciena-frost_ember-frost-chart | train | js |
d0af9e3d1dadca6208ba744477ee9ab8497b3489 | diff --git a/angr/analyses/cfg/cfg_fast.py b/angr/analyses/cfg/cfg_fast.py
index <HASH>..<HASH> 100644
--- a/angr/analyses/cfg/cfg_fast.py
+++ b/angr/analyses/cfg/cfg_fast.py
@@ -1001,7 +1001,7 @@ class CFGFast(ForwardAnalysis, CFGBase): # pylint: disable=abstract-method
try:
return next(self._regions.irange(minimum=address, reverse=True))
- except KeyError:
+ except StopIteration:
return None
# Methods for scanning the entire image | #<I> missed a spot | angr_angr | train | py |
d3634d32c13c1ee8c3b0c1e8510591e6381d1bed | diff --git a/scripts/create-stubs.js b/scripts/create-stubs.js
index <HASH>..<HASH> 100644
--- a/scripts/create-stubs.js
+++ b/scripts/create-stubs.js
@@ -4,7 +4,7 @@ fs.readdirSync('src/runtime')
.filter(dir => fs.statSync(`src/runtime/${dir}`).isDirectory())
.forEach(dir => {
fs.writeFileSync(`${dir}/package.json`, JSON.stringify({
- main: './index.js',
+ main: './index',
module: './index.mjs'
}, null, ' ')); | dont even know how to summarise this | sveltejs_svelte | train | js |
d31dc5c29611f72588dc994ddd2df62af4ccecb0 | diff --git a/src/Lang/no.php b/src/Lang/no.php
index <HASH>..<HASH> 100644
--- a/src/Lang/no.php
+++ b/src/Lang/no.php
@@ -28,7 +28,7 @@ return array(
'february' => 'februar',
'march' => 'mars',
'april' => 'april',
- 'may' => 'may',
+ 'may' => 'mai',
'june' => 'juni',
'july' => 'juli',
'august' => 'august', | Fix no.php
Quick fix, it's called 'mai' in norwegian. | jenssegers_date | train | php |
a7729ac75705fc915dee06cdb331396baf264232 | diff --git a/hostpool.go b/hostpool.go
index <HASH>..<HASH> 100644
--- a/hostpool.go
+++ b/hostpool.go
@@ -184,7 +184,7 @@ func (p *standardHostPool) markFailed(hostR HostPoolResponse) {
}
func (p *standardHostPool) Hosts() []string {
- hosts := make([]string, len(p.hosts))
+ hosts := make([]string, 0, len(p.hosts))
for host := range p.hosts {
hosts = append(hosts, host)
} | Update hostpool.go
the preview code would return len(p.hosts) empty string first,then the true hosts. | bitly_go-hostpool | train | go |
7e3391e77575773880b2e7a97d703054ac960ec8 | diff --git a/lib/netsuite/records/cash_refund_item.rb b/lib/netsuite/records/cash_refund_item.rb
index <HASH>..<HASH> 100644
--- a/lib/netsuite/records/cash_refund_item.rb
+++ b/lib/netsuite/records/cash_refund_item.rb
@@ -6,7 +6,7 @@ module NetSuite
include Support::Records
include Namespaces::TranCust
- fields :amount, :rate, :quantity, :is_taxable, :order_line, :line, :description
+ fields :amount, :gross_amt, :rate, :quantity, :is_taxable, :order_line, :line, :description
field :custom_field_list, CustomFieldList
record_refs :item, :klass, :price
diff --git a/spec/netsuite/records/cash_refund_item_spec.rb b/spec/netsuite/records/cash_refund_item_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/netsuite/records/cash_refund_item_spec.rb
+++ b/spec/netsuite/records/cash_refund_item_spec.rb
@@ -5,7 +5,7 @@ describe NetSuite::Records::CashRefundItem do
it 'has all the right fields' do
[
- :amount
+ :amount, :gross_amt, :rate, :quantity, :is_taxable, :order_line, :line, :description
].each do |field|
expect(item).to have_field(field)
end | add gross_amt field in cash refund item (#<I>) | NetSweet_netsuite | train | rb,rb |
25ea6ccb8d838ee308f6ac492e56eb27727d3ee8 | diff --git a/js/lib/beautify-html.js b/js/lib/beautify-html.js
index <HASH>..<HASH> 100644
--- a/js/lib/beautify-html.js
+++ b/js/lib/beautify-html.js
@@ -574,7 +574,7 @@
var add = function (str) {
var newToken = token + str.toLowerCase();
- token = newToken.substr(newToken.length - delimiter.length, delimiter.length);
+ token = newToken.length <= delimiter.length ? newToken : newToken.substr(newToken.length - delimiter.length, delimiter.length);
};
var doesNotMatch = function () { | Handling situations where delimiter was larger than newToken | beautify-web_js-beautify | train | js |
c0999ac5bbd17e502cb2676e5b0ac8dc4f13e46a | diff --git a/lib/stripe/transfer.rb b/lib/stripe/transfer.rb
index <HASH>..<HASH> 100644
--- a/lib/stripe/transfer.rb
+++ b/lib/stripe/transfer.rb
@@ -1,16 +1,5 @@
module Stripe
class Transfer < APIResource
include Stripe::APIOperations::List
-
- def transactions(params={})
- response, api_key = Stripe.request(:get, transactions_url, @api_key, params)
- Util.convert_to_stripe_object(response, api_key)
- end
-
- private
-
- def transactions_url
- url + '/transactions'
- end
end
end | Remove the conflicting definition of transactions for transfers. | stripe_stripe-ruby | train | rb |
3cb43baac1ca87cb9f568fe23ae5da07ffb564ee | diff --git a/pyswip/prolog.py b/pyswip/prolog.py
index <HASH>..<HASH> 100644
--- a/pyswip/prolog.py
+++ b/pyswip/prolog.py
@@ -58,11 +58,11 @@ def _initialize():
plargs[i] = args[i]
result = PL_initialise(s_plargs, plargs)
- # For some reason, PL_initialise is returning 1, even though everything is
- # working
-# if result != 0:
-# raise PrologError("Could not initialize Prolog environment."
-# "PL_initialise returned %d" % result)
+ # result is a boolean variable (i.e. 0 or 1) indicating whether the
+ # initialisation was successful or not.
+ if not result:
+ raise PrologError("Could not initialize Prolog environment."
+ "PL_initialise returned %d" % result)
swipl_fid = PL_open_foreign_frame()
swipl_load = PL_new_term_ref() | Reactivate the initialisation error in init method.
Comment was:
For some reason, PL_initialise is returning 1, even though everything is
working
Solution is:
Result is a boolean variable (i.e. 0 or 1) indicating whether the
initialisation was successful or not.
(See SWI-Prolog documentation for PL_initialise) | yuce_pyswip | train | py |
5d4964cf9c16313db7490a82cbe24773171caf2d | diff --git a/src/deep-db/lib/DB.js b/src/deep-db/lib/DB.js
index <HASH>..<HASH> 100644
--- a/src/deep-db/lib/DB.js
+++ b/src/deep-db/lib/DB.js
@@ -60,7 +60,11 @@ export class DB extends Kernel.ContainerAware {
*/
get(modelName) {
if (!this.has(modelName)) {
- throw new ModelNotFoundException(modelName);
+ modelName = this._lispCase(modelName);
+
+ if (!this.has(modelName)) {
+ throw new ModelNotFoundException(modelName);
+ }
}
let model = this._models[modelName];
@@ -303,6 +307,18 @@ export class DB extends Kernel.ContainerAware {
}
/**
+ * @param {String} str
+ * @returns {String}
+ * @private
+ */
+ _lispCase(str) {
+ return str
+ .split(/[^a-z0-9\-]+/i)
+ .map(s => s.toLowerCase())
+ .join('-');
+ }
+
+ /**
* @returns {Number}
*/
static get LOCAL_DB_PORT() { | # Added lispCase compatibility for deep-db | MitocGroup_deep-framework | train | js |
43a17214790b0616b845fde6ccf8abdc37e5923f | diff --git a/lib/Alchemy/Phrasea/Core/Version.php b/lib/Alchemy/Phrasea/Core/Version.php
index <HASH>..<HASH> 100644
--- a/lib/Alchemy/Phrasea/Core/Version.php
+++ b/lib/Alchemy/Phrasea/Core/Version.php
@@ -20,7 +20,7 @@ namespace Alchemy\Phrasea\Core;
class Version
{
- protected static $number = '3.6.0';
+ protected static $number = '3.6.1';
protected static $name = 'Brachiosaure';
public static function getNumber() | Bump to version <I> | alchemy-fr_Phraseanet | train | php |
0f5030a87a2ccffc5cce7d28019ff2d655199b84 | diff --git a/lib/codemirror.js b/lib/codemirror.js
index <HASH>..<HASH> 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -1387,11 +1387,14 @@
var same = 0, l = Math.min(prevInput.length, text.length);
while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same;
- operation(cm, applyTextInput)(cm, text.slice(same), prevInput.length - same);
+ var self = this;
+ runInOp(cm, function() {
+ applyTextInput(cm, text.slice(same), prevInput.length - same);
- // Don't leave long text in the textarea, since it makes further polling slow
- if (text.length > 1000 || text.indexOf("\n") > -1) input.value = this.prevInput = "";
- else this.prevInput = text;
+ // Don't leave long text in the textarea, since it makes further polling slow
+ if (text.length > 1000 || text.indexOf("\n") > -1) input.value = self.prevInput = "";
+ else self.prevInput = text;
+ });
return true;
}, | When polling input, set prevInput before ending the operation
Since that might end up calling resetInput and creating an
inconsistent state.
Issue #<I> | codemirror_CodeMirror | train | js |
4c20f1b810595a8eb8b321a24768c7b80be9b98d | diff --git a/lib/action_cable/channel/base.rb b/lib/action_cable/channel/base.rb
index <HASH>..<HASH> 100644
--- a/lib/action_cable/channel/base.rb
+++ b/lib/action_cable/channel/base.rb
@@ -7,7 +7,10 @@ module ActionCable
# Channel instances are long-lived. A channel object will be instantiated when the cable consumer becomes a subscriber, and then
# lives until the consumer disconnects. This may be seconds, minutes, hours, or even days. That means you have to take special care
# not to do anything silly in a channel that would balloon its memory footprint or whatever. The references are forever, so they won't be released
- # as is normally the case with a controller instance that gets thrown away after every request.
+ # as is normally the case with a controller instance that gets thrown away after every request.
+ #
+ # Long-lived channels (and connections) also mean you're responsible for ensuring that the data is fresh. If you hold a reference to a user
+ # record, but the name is changed while that reference is held, you may be sending stale data if you don't take precautions to avoid it.
#
# The upside of long-lived channel instances is that you can use instance variables to keep reference to objects that future subscriber requests
# can interact with. Here's a quick example: | Mention the concern about long-lived and stale data | rails_rails | train | rb |
7e59c1d6bdfca23e69095057d8ad981c040c612e | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -28,7 +28,6 @@ setup(
install_requires=[
"setuptools",
- "pandas >= 0.8.0",
"GoreUtilities == {0}".format(gore_utilities_version),
],
classifiers = [ | Removed required dependencies from setup. Let user choose manually what
to do. | eyurtsev_FlowCytometryTools | train | py |
8db223d5350a0eb16a83e18112d7abb5097c4beb | diff --git a/src/sap.uxap/src/sap/uxap/ObjectPageLayout.js b/src/sap.uxap/src/sap/uxap/ObjectPageLayout.js
index <HASH>..<HASH> 100644
--- a/src/sap.uxap/src/sap/uxap/ObjectPageLayout.js
+++ b/src/sap.uxap/src/sap/uxap/ObjectPageLayout.js
@@ -1235,7 +1235,7 @@ sap.ui.define([
this._adjustLayout(null, true);
- this._oScroller.scrollTo(0, this._$opWrapper.scrollTop(), 0);
+ this._scrollTo(this._$opWrapper.scrollTop(), 0);
});
}; | [FIX][INTERNAL] fixed failing test caused by error in scrolling logic
BCP: <I>
Change-Id: If<I>b5f<I>e<I>f<I>a3aeba<I>dc<I>aca3a9da | SAP_openui5 | train | js |
376b0e40a2042782933a21f94ae30e9f56d62404 | diff --git a/tests/system/Validation/FormatRulesTest.php b/tests/system/Validation/FormatRulesTest.php
index <HASH>..<HASH> 100644
--- a/tests/system/Validation/FormatRulesTest.php
+++ b/tests/system/Validation/FormatRulesTest.php
@@ -700,7 +700,7 @@ class FormatRulesTest extends \CIUnitTestCase
],
[
'0',
- false,
+ true,
],
[
'1.0a', | Update FormatRulesTest.php
test fix. decimal rule will accept integer | codeigniter4_CodeIgniter4 | train | php |
1bc71e54a7995c072dd2f1421ac375cc1b5ba72b | diff --git a/activiti-webapp/src/main/webapp/js/activiti-widget.js b/activiti-webapp/src/main/webapp/js/activiti-widget.js
index <HASH>..<HASH> 100644
--- a/activiti-webapp/src/main/webapp/js/activiti-widget.js
+++ b/activiti-webapp/src/main/webapp/js/activiti-widget.js
@@ -1077,7 +1077,7 @@ Activiti.widget.PopupManager = function()
// Use a Dialog (instead of a Panel) to take use of it's getData method
this.dialog = new YAHOO.widget.Dialog(dialog, {
- fixedcenter: true,
+ fixedcenter: "contained",
visible: false,
constraintoviewport: true,
modal: true, | Fixed ACT-<I> "when form is too large (more 1 page), scroll is infinite! and buttons are always hidden." & ACT-<I> "Scrolling in GUI" | camunda_camunda-bpm-platform | train | js |
036f3e5e98afa18722dc0e0473af5a67309e59f5 | diff --git a/app/controllers/clipster/clips_controller.rb b/app/controllers/clipster/clips_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/clipster/clips_controller.rb
+++ b/app/controllers/clipster/clips_controller.rb
@@ -5,7 +5,7 @@ module Clipster
def index
@clips = Clip.all
- @languages = CodeRay::Scanners.all_plugins
+ @languages = CodeRay::Scanners.all_plugins.map{|lang| lang.title.to_s}
end
end
end | fixed language naming in view via map. need to find out if we can remove debug and raydebug as they cause erroneous actions | kwbock_clipster | train | rb |
5cd21f915998e537ab0f118dba3172aeafcb91e1 | diff --git a/spyder/plugins/explorer/widgets/explorer.py b/spyder/plugins/explorer/widgets/explorer.py
index <HASH>..<HASH> 100644
--- a/spyder/plugins/explorer/widgets/explorer.py
+++ b/spyder/plugins/explorer/widgets/explorer.py
@@ -330,7 +330,7 @@ class DirView(QTreeView):
)
# Filters
self.filters_action = create_action(
- self, _("Show files with these extensions..."), None,
+ self, _("Edit filter settings"), None,
ima.icon('filter'),
triggered=self.edit_filter,
) | Change hamburguer menu description to edit filter settings | spyder-ide_spyder | train | py |
ec7c7d738d113eee0e7e6829bc961cf406cb318e | diff --git a/salt/states/file.py b/salt/states/file.py
index <HASH>..<HASH> 100644
--- a/salt/states/file.py
+++ b/salt/states/file.py
@@ -2490,6 +2490,9 @@ def replace(name,
- pattern: |
CentOS \(2.6.32[^\n]+\n\s+root[^\n]+\n\)+
'''
+ .. note::
+ When using YAML multiline string syntax in pattern, make sure to also use that synyax in the repl part, or you might loose line feeds.
+ '''
name = os.path.expanduser(name)
ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} | minor note: added
note based on findings in #<I> | saltstack_salt | train | py |
63a18c73fea888e59321d4aae4c512b001d1d464 | diff --git a/src/org/openscience/cdk/test/qsar/descriptors/molecular/MolecularDescriptorTest.java b/src/org/openscience/cdk/test/qsar/descriptors/molecular/MolecularDescriptorTest.java
index <HASH>..<HASH> 100644
--- a/src/org/openscience/cdk/test/qsar/descriptors/molecular/MolecularDescriptorTest.java
+++ b/src/org/openscience/cdk/test/qsar/descriptors/molecular/MolecularDescriptorTest.java
@@ -118,9 +118,9 @@ public abstract class MolecularDescriptorTest extends DescriptorTest {
IAtomContainer mol = someoneBringMeSomeWater();
DescriptorValue v = descriptor.calculate(mol);
- assertEquals(
+ assertTrue(
"The getDescriptorResultType() is inconsistent with the calculated descriptor results",
- v.getValue().getClass().getName(), result.getClass().getName()
+ result.getClass().getName().contains(v.getValue().getClass().getName())
);
assertEquals(
"The specified getDescriptorResultType() length does not match the actually calculated result vector length", | Fixed test to take into account the new *Type classes: was now often incorrectly failing because DoubleArrayResult notEquals DoubleArrayResultType
git-svn-id: <URL> | cdk_cdk | train | java |
89d3a3c63e8416ae1d98d1a55150fc8de961467f | diff --git a/cloudflare.go b/cloudflare.go
index <HASH>..<HASH> 100644
--- a/cloudflare.go
+++ b/cloudflare.go
@@ -202,7 +202,7 @@ func (api *API) makeRequestWithAuthTypeAndHeaders(method, uri string, params int
return nil, errors.Errorf("HTTP status %d: service failure", resp.StatusCode)
// This isn't a great solution due to the way the `default` case is
// a catch all and that the `filters/validate-expr` returns a HTTP 400
- // yet the clients need to use the HTTP body.
+ // yet the clients need to use the HTTP body as a JSON string.
case resp.StatusCode == 400 && strings.HasSuffix(resp.Request.URL.Path, "/filters/validate-expr"):
return nil, errors.Errorf("%s", respBody)
default: | Add more of an explaination to the new cloudflare request handler condition | cloudflare_cloudflare-go | train | go |
6c76fba082872013a4b1c29f858ef636663d4ad1 | diff --git a/misc/plunk-gen.js b/misc/plunk-gen.js
index <HASH>..<HASH> 100644
--- a/misc/plunk-gen.js
+++ b/misc/plunk-gen.js
@@ -154,7 +154,7 @@ function generateConfigJs() {
'tslib': 'npm:tslib/tslib.js',
'typescript': 'npm:typescript@${versions.typescript}/lib/typescript.js',
- '@ng-bootstrap/ng-bootstrap': 'npm:@ng-bootstrap/ng-bootstrap@${versions.ngBootstrap}/bundles/ng-bootstrap.js'
+ '@ng-bootstrap/ng-bootstrap': 'npm:@ng-bootstrap/ng-bootstrap@${versions.ngBootstrap}/bundles/ng-bootstrap.umd.js'
},
packages: {
app: { | chore: fix umd bundle name for plunker (#<I>) | ng-bootstrap_ng-bootstrap | train | js |
2161cbedd20127b1f75b5dc24a534754a378b07b | diff --git a/lib/CORL/action/lookup.rb b/lib/CORL/action/lookup.rb
index <HASH>..<HASH> 100644
--- a/lib/CORL/action/lookup.rb
+++ b/lib/CORL/action/lookup.rb
@@ -33,8 +33,8 @@ class Lookup < Plugin::CloudAction
def execute
super do |node, network|
ensure_node(node) do
- property = settings[:property]
- value = node.lookup(property)
+ property = settings.delete(:property)
+ value = node.lookup(property, nil, settings)
ui.info(sprintf("#{property} = %s", value.inspect))
end | Passing the settings to the lookup method in the lookup action provider. | coralnexus_corl | train | rb |
6b0244fa2dd58d257c05debff393d0c29fc4f09b | diff --git a/lib/weary/request.rb b/lib/weary/request.rb
index <HASH>..<HASH> 100644
--- a/lib/weary/request.rb
+++ b/lib/weary/request.rb
@@ -25,11 +25,7 @@ module Weary
def via=(http_verb)
verb = HTTPVerb.new(http_verb).normalize
- @http_verb = if Methods.include?(verb)
- verb
- else
- :get
- end
+ @http_verb = Methods.include?(verb) ? verb : :get
end
def via
@@ -129,7 +125,7 @@ module Weary
# Prepare the HTTP Request.
# The Request has a lifecycle:
- # Prepare with `request_preparation`
+ # Prepare with `connection`
# Build with `request`
# Fire with `perform`
def connection | Cleanup via= && remove reference to old method name, now called "connection" | mwunsch_weary | train | rb |
5ba305d63fabaaa1e77bf325341376da10a0ac93 | diff --git a/devices.js b/devices.js
index <HASH>..<HASH> 100755
--- a/devices.js
+++ b/devices.js
@@ -12918,6 +12918,20 @@ const devices = [
meta: {battery: {dontDividePercentage: true}},
exposes: [e.battery(), e.action(['single', 'double', 'triple', 'quadruple']), exposes.text('direction', exposes.access.STATE)],
},
+ {
+ zigbeeModel: ['TERNCY-LS01'],
+ model: 'TERNCY-LS01',
+ vendor: 'TERNCY',
+ description: 'Smart light socket',
+ exposes: [e.switch(), e.action(['single'])],
+ fromZigbee: [fz.on_off, fz.terncy_raw, fz.ignore_basic_report],
+ toZigbee: [tz.on_off],
+ meta: {configureKey: 1},
+ configure: async (device, coordinatorEndpoint) => {
+ const endpoint = device.getEndpoint(1);
+ await bind(endpoint, coordinatorEndpoint, ['genOnOff']);
+ },
+ },
// ORVIBO
{ | Add support for TERNCY LS<I> Smart Light Socket (#<I>)
* Add TERNCY LS<I> Smart Light Socket support
* Update devices.js | Koenkk_zigbee-shepherd-converters | train | js |
a37a2259b3a0442fcc7250eb0cdca28a61c41920 | diff --git a/public/app/plugins/datasource/elasticsearch/metric_agg.js b/public/app/plugins/datasource/elasticsearch/metric_agg.js
index <HASH>..<HASH> 100644
--- a/public/app/plugins/datasource/elasticsearch/metric_agg.js
+++ b/public/app/plugins/datasource/elasticsearch/metric_agg.js
@@ -162,6 +162,9 @@ function (angular, _, queryDef) {
};
$scope.getFieldsInternal = function() {
+ if ($scope.agg.type === 'cardinality') {
+ return $scope.getFields();
+ }
return $scope.getFields({$fieldType: 'number'});
}; | Allowing "Unique Count"s of any data type (#<I>) | grafana_grafana | train | js |
d867ff91d9cb17c56ae3230313688f416362f8e7 | diff --git a/spec/opal/erb/erb_spec.rb b/spec/opal/erb/erb_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/opal/erb/erb_spec.rb
+++ b/spec/opal/erb/erb_spec.rb
@@ -5,11 +5,11 @@ require File.expand_path('../quoted', __FILE__)
describe "ERB files" do
before :each do
- @simple = ERB['opal/erb/simple']
- @quoted = ERB['opal/erb/quoted']
+ @simple = Template['opal/erb/simple']
+ @quoted = Template['opal/erb/quoted']
end
- it "should be defined by their filename on ERB namespace" do
+ it "should be defined by their filename on Template namespace" do
@simple.should be_kind_of(ERB)
end
diff --git a/stdlib/erb.rb b/stdlib/erb.rb
index <HASH>..<HASH> 100644
--- a/stdlib/erb.rb
+++ b/stdlib/erb.rb
@@ -1,4 +1,4 @@
-class ERB
+module Template
@_cache = {}
def self.[](name)
@_cache[name]
@@ -7,11 +7,13 @@ class ERB
def self.[]=(name, instance)
@_cache[name] = instance
end
+end
+class ERB
def initialize(name, &body)
@body = body
@name = name
- ERB[name] = self
+ Template[name] = self
end
def inspect | ERB should generate files into Template namespace
An older commit changed this to the ERB namespace, but Template is more
template language independant. | opal_opal | train | rb,rb |
98c6be15429f10a472b37f5158ef5cfeab3611f0 | diff --git a/bin/slush.js b/bin/slush.js
index <HASH>..<HASH> 100755
--- a/bin/slush.js
+++ b/bin/slush.js
@@ -69,7 +69,7 @@ function handleArguments(env) {
}
if (!env.modulePath) {
- gutil.log(chalk.red('No local gulp install found in'), chalk.magenta(env.cwd));
+ gutil.log(chalk.red('No local gulp install found in'), chalk.magenta(generator.path));
log(chalk.red('This is an issue with the `slush-' + generator.name + '` generator'));
process.exit(1);
} | Print generator path instead of cwd when generator is missing gulp | slushjs_slush | train | js |
9e69a042c50a3706c847addd68469dfe3eb698a0 | diff --git a/api/server.go b/api/server.go
index <HASH>..<HASH> 100644
--- a/api/server.go
+++ b/api/server.go
@@ -894,6 +894,9 @@ func postContainersCopy(eng *engine.Engine, version version.Version, w http.Resp
if copyData.Get("Resource") == "" {
return fmt.Errorf("Path cannot be empty")
}
+
+ origResource := copyData.Get("Resource")
+
if copyData.Get("Resource")[0] == '/' {
copyData.Set("Resource", copyData.Get("Resource")[1:])
}
@@ -904,6 +907,8 @@ func postContainersCopy(eng *engine.Engine, version version.Version, w http.Resp
utils.Errorf("%s", err.Error())
if strings.Contains(err.Error(), "No such container") {
w.WriteHeader(http.StatusNotFound)
+ } else if strings.Contains(err.Error(), "no such file or directory") {
+ return fmt.Errorf("Could not find the file %s in container %s", origResource, vars["name"])
}
}
return nil | Fix `docker cp` trying to untar files that do not exist.
Docker-DCO-<I>- | moby_moby | train | go |
44066f15ab0c5b3e93e4caae1e3169a04f3d480f | diff --git a/emannotationschemas/schemas/base.py b/emannotationschemas/schemas/base.py
index <HASH>..<HASH> 100644
--- a/emannotationschemas/schemas/base.py
+++ b/emannotationschemas/schemas/base.py
@@ -39,6 +39,11 @@ def get_geom_from_wkb(wkb):
class ReferenceTableField(mm.fields.Field):
+ def _jsonschema_type_mapping(self):
+ return {
+ "type": "integer",
+ }
+
def _deserialize(self, value, attr, obj, **kwargs):
if not isinstance(value, Integer):
return int(value)
@@ -47,6 +52,7 @@ class ReferenceTableField(mm.fields.Field):
def _serialize(self, value, attr, obj, **kwargs):
return int(value)
+
class IdSchema(mm.Schema):
"""schema with a unique identifier"""
@@ -70,7 +76,9 @@ class AnnotationSchema(mm.Schema):
class ReferenceAnnotation(AnnotationSchema):
"""a annotation that references another annotation"""
- target_id = ReferenceTableField(required=True, description="annotation this references")
+ target_id = ReferenceTableField(
+ required=True, description="annotation this references"
+ )
class FlatSegmentationReference(AnnotationSchema): | fix: set referencetablefield json mapping | seung-lab_EMAnnotationSchemas | train | py |
fd68431e477be6a0cc945bf1b10a2a4673389d0d | diff --git a/network.js b/network.js
index <HASH>..<HASH> 100644
--- a/network.js
+++ b/network.js
@@ -1954,8 +1954,15 @@ function handleJustsaying(ws, subject, body){
return;
}
ws.library_version = body.library_version;
- if (typeof ws.library_version === 'string' && version2int(ws.library_version) < version2int(constants.minCoreVersion))
+ if (typeof ws.library_version === 'string' && version2int(ws.library_version) < version2int(constants.minCoreVersion)){
ws.old_core = true;
+ if (ws.bSubscribed){
+ ws.bSubscribed = false;
+ sendJustsaying(ws, 'upgrade_required');
+ sendJustsaying(ws, "old core");
+ ws.close(1000, "old core");
+ }
+ }
eventBus.emit('peer_version', ws, body); // handled elsewhere
break; | if old core is already subscribed, unsubscribe and disconnect | byteball_ocore | train | js |
7086dec48ab9ae31d9e3e5353b11cb3fc29206e3 | diff --git a/client/runtime.go b/client/runtime.go
index <HASH>..<HASH> 100644
--- a/client/runtime.go
+++ b/client/runtime.go
@@ -342,9 +342,9 @@ func (r *Runtime) Submit(operation *runtime.ClientOperation) (interface{}, error
}
}
- if _, ok := r.Producers[cmt]; !ok {
- return nil, fmt.Errorf("none of producers: %v registered. try %s",r.Producers, cmt)
- }
+ if _, ok := r.Producers[cmt]; !ok && cmt != runtime.MultipartFormMime {
+ return nil, fmt.Errorf("none of producers: %v registered. try %s", r.Producers, cmt)
+ }
req, err := request.buildHTTP(cmt, r.BasePath, r.Producers, r.Formats, auth)
if err != nil { | add a special case for multipart form data when checking for producers | go-openapi_runtime | train | go |
e532b68a6569c39e65944f8b97c721d0225c0764 | diff --git a/glue/ligolw/lsctables.py b/glue/ligolw/lsctables.py
index <HASH>..<HASH> 100644
--- a/glue/ligolw/lsctables.py
+++ b/glue/ligolw/lsctables.py
@@ -998,8 +998,8 @@ class SegmentDefMapTable(metaio.Table):
tableName = "segment_def_map:table"
validcolumns = {
"creator_db": "int_4s",
- "process_id": "ilwd_char",
- "seg_def_map_id": "ilwd_char",
+ "process_id": "ilwd:char",
+ "seg_def_map_id": "ilwd:char",
"segment_cdb": "int_4s",
"segment_id": "ilwd:char",
"segment_def_cdb": "int_4s",
@@ -1026,7 +1026,7 @@ class SegmentDefTable(metaio.Table):
tableName = "segment_definer:table"
validcolumns = {
"creator_db": "int_4s",
- "process_id": "ilwd_char",
+ "process_id": "ilwd:char",
"segment_def_id": "ilwd:char",
"run": "char_s",
"ifos": "char_s", | Fix typos on a few column types. | gwastro_pycbc-glue | train | py |
21021fdb402167dbf70b49382a79941753a69b06 | diff --git a/tests/Functional/Fixtures/Builder/build.php b/tests/Functional/Fixtures/Builder/build.php
index <HASH>..<HASH> 100755
--- a/tests/Functional/Fixtures/Builder/build.php
+++ b/tests/Functional/Fixtures/Builder/build.php
@@ -9,6 +9,8 @@ namespace {
$metaData = ['test' => new TYPO3\PharStreamWrapper\Tests\Functional\Fixtures\Source\TestModel()];
@unlink('../bundle.phar');
+ @unlink('../bundle.phar.gz');
+ @unlink('../bundle.phar.bz2');
@unlink('../alias-no-path.phar');
@unlink('../alias-with-path.phar');
@unlink('../alias-special.phar');
@@ -29,6 +31,9 @@ namespace {
$phar->stopBuffering();
copy('../bundle.phar', '../bundle.phar.png');
+ $phar->compress(PHAR::GZ);
+ $phar->compress(PHAR::BZ2);
+
$phar = new Phar('../alias-no-path.phar');
$phar->startBuffering();
$phar->setMetadata(['vendor' => 'TYPO3Demo']); | [TASK] Update Phar builder script | TYPO3_phar-stream-wrapper | train | php |
ae7054f4e9e63f8f82bd95e8c2308e551c92bca8 | diff --git a/src/platforms/web/server/create-renderer.js b/src/platforms/web/server/create-renderer.js
index <HASH>..<HASH> 100644
--- a/src/platforms/web/server/create-renderer.js
+++ b/src/platforms/web/server/create-renderer.js
@@ -21,11 +21,14 @@ export function createComponentRenderer (options = {}) {
}
function renderNode (node) {
- return node.child
- ? renderComponent(node)
- : node.tag
+ if (node.componentOptions) {
+ node.data.hook.init(node)
+ return renderComponent(node.child)
+ } else {
+ return node.tag
? renderElement(node)
: node.text
+ }
}
function renderElement (el) { | fix ssr for child components | IOriens_wxml-transpiler | train | js |
51db4882f5f636ebc71bc1e38ac5d98ed64e7462 | diff --git a/web_tester.php b/web_tester.php
index <HASH>..<HASH> 100644
--- a/web_tester.php
+++ b/web_tester.php
@@ -98,21 +98,12 @@
}
/**
- * Resets the parsed HTML page cache.
- * @access private
- */
- function _clearHtmlCache() {
- $this->_html_cache = false;
- }
-
- /**
* Sets up a browser for the start of each
* test method.
* @param string $method Name of test method.
* @access protected
*/
function invoke($method) {
- $this->_current_content = false;
$this->_page = false;
$this->_current_browser = &$this->createBrowser();
$this->_frames_supported = true; | Some tidy ups after latest refactor | simpletest_simpletest | train | php |
5f74d8a1bfa8c0983a3ac594698de72fa1bfa218 | diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index <HASH>..<HASH> 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -233,14 +233,13 @@ suffixes : tuple of (str, str), default ('_x', '_y')
copy : bool, default True
If False, avoid copy if possible.
indicator : bool or str, default False
- If True, adds a column to output DataFrame called "_merge" with
- information on the source of each row.
- If string, column with information on source of each row will be added to
- output DataFrame, and column will be named value of string.
- Information column is Categorical-type and takes on a value of "left_only"
- for observations whose merge key only appears in 'left' DataFrame,
- "right_only" for observations whose merge key only appears in 'right'
- DataFrame, and "both" if the observation's merge key is found in both.
+ If True, adds a column to the output DataFrame called "_merge" with
+ information on the source of each row. The column can be given a different
+ name by providing a string argument. The column will have a Categorical
+ type with the value of "left_only" for observations whose merge key only
+ appears in the left DataFrame, "right_only" for observations
+ whose merge key only appears in the right DataFrame, and "both"
+ if the observation's merge key is found in both DataFrames.
validate : str, optional
If specified, checks if merge is of specified type. | DOC: updating the `indicator` wording in `merge` doc (#<I>) | pandas-dev_pandas | train | py |
a0af1449596ecf47a2ca6bbf3620e189acb4e2a0 | diff --git a/lib/superapi/api.js b/lib/superapi/api.js
index <HASH>..<HASH> 100644
--- a/lib/superapi/api.js
+++ b/lib/superapi/api.js
@@ -183,6 +183,14 @@ Api.prototype = {
return this.buildRequest(method, this.buildUrl(id, params, query), data, options);
},
+ _httpVerb: function(method, url, options, data) {
+ options = options || {};
+ options.data = data;
+ options.method = method;
+
+ return serviceHandler(url).call(this, options);
+ },
+
buildRequest: function (method, url, data, opts) {
method = method.toLowerCase();
opts = opts || {}; | feat(api): add a generic request caller
Built on top of service hander but for non configured calls. | stephanebachelier_superapi | train | js |
7a14b77a415df75829b7c8a8f324478ee6a0d06a | diff --git a/graphene_django/types.py b/graphene_django/types.py
index <HASH>..<HASH> 100644
--- a/graphene_django/types.py
+++ b/graphene_django/types.py
@@ -102,7 +102,7 @@ def validate_fields(type_, model, fields, only_fields, exclude_fields):
# Field is a custom field
warnings.warn(
(
- 'Excluding the custom field "{field_name} on DjangoObjectType "{type_}" has no effect. '
+ 'Excluding the custom field "{field_name}" on DjangoObjectType "{type_}" has no effect. '
'Either remove the custom field or remove the field from the "exclude" list.'
).format(
field_name=name, | fix a typo in the warning (#<I>) | graphql-python_graphene-django | train | py |
97f5de8ebca2ec7a8563bad02eea77dd5a9f543d | diff --git a/commerce-product-service/src/main/java/com/liferay/commerce/product/search/CPSpecificationOptionIndexer.java b/commerce-product-service/src/main/java/com/liferay/commerce/product/search/CPSpecificationOptionIndexer.java
index <HASH>..<HASH> 100644
--- a/commerce-product-service/src/main/java/com/liferay/commerce/product/search/CPSpecificationOptionIndexer.java
+++ b/commerce-product-service/src/main/java/com/liferay/commerce/product/search/CPSpecificationOptionIndexer.java
@@ -253,8 +253,8 @@ public class CPSpecificationOptionIndexer
catch (PortalException pe) {
if (_log.isWarnEnabled()) {
_log.warn(
- "Unable to index commerce product " +
- "specification option " +
+ "Unable to index commerce product specification " +
+ "option " +
cpSpecificationOption.
getCPSpecificationOptionId(),
pe); | LPS-<I> Manual SF required by new change | liferay_com-liferay-commerce | train | java |
bbc00e550372155a6d4102ebc3a9a5905ea63f67 | diff --git a/lib/hamlit/parsers/multiline.rb b/lib/hamlit/parsers/multiline.rb
index <HASH>..<HASH> 100644
--- a/lib/hamlit/parsers/multiline.rb
+++ b/lib/hamlit/parsers/multiline.rb
@@ -5,6 +5,8 @@ module Hamlit
module Multiline
include Concerns::LineReader
+ SPACED_BLOCK_REGEXP = /do +\| *[^\|]+ *\|\Z/
+
def preprocess_multilines(template)
reset_lines(template.split("\n"))
result = []
@@ -30,6 +32,8 @@ module Hamlit
def end_with_pipe?(line)
return false unless line
+ return false if line =~ SPACED_BLOCK_REGEXP
+
line.strip =~ / \|\Z/
end
diff --git a/spec/hamlit/engine/script_spec.rb b/spec/hamlit/engine/script_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/hamlit/engine/script_spec.rb
+++ b/spec/hamlit/engine/script_spec.rb
@@ -65,6 +65,15 @@ describe Hamlit::Engine do
HTML
end
+ it 'renders block and a variable with spaces' do
+ assert_render(<<-HAML, <<-HTML)
+ - 1.times do | i |
+ = i
+ HAML
+ 0
+ HTML
+ end
+
it 'accepts a continuing script' do
assert_render(<<-HAML, <<-HTML)
- def foo(a, b); a + b; end | Avoid regarding spaced block as multiline | haml_haml | train | rb,rb |
16a7eebed0b9b121f2b61157e0523c8dbb9b0a07 | diff --git a/core/src/main/java/com/digitalpebble/stormcrawler/protocol/httpclient/HttpProtocol.java b/core/src/main/java/com/digitalpebble/stormcrawler/protocol/httpclient/HttpProtocol.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/digitalpebble/stormcrawler/protocol/httpclient/HttpProtocol.java
+++ b/core/src/main/java/com/digitalpebble/stormcrawler/protocol/httpclient/HttpProtocol.java
@@ -270,7 +270,7 @@ public class HttpProtocol extends AbstractHttpProtocol implements
// check whether we need to trim
if (maxContent != -1
&& buffer.length() + lengthRead > maxContent) {
- buffer.append(tmp, 0, buffer.capacity());
+ buffer.append(tmp, 0, buffer.capacity() - buffer.length());
trimmed.setValue(true);
break;
} | Bugfix introduced in #<I> | DigitalPebble_storm-crawler | train | java |
4fa016214d8eb66422cf1db552ade3fd386225b8 | diff --git a/cocaine/tools/actions/common.py b/cocaine/tools/actions/common.py
index <HASH>..<HASH> 100644
--- a/cocaine/tools/actions/common.py
+++ b/cocaine/tools/actions/common.py
@@ -19,17 +19,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-import ast
-import re
-
from tornado import gen
-from cocaine.exceptions import ServiceError
from cocaine.decorators import coroutine
from cocaine.services import Service
from cocaine.tools.actions import profile
-from cocaine.tools.error import ServiceCallError
__author__ = 'Evgeny Safronov <[email protected]>' | [Pep8] Remove unused import to satisfy a PEP8 linter. | cocaine_cocaine-tools | train | py |
cdc2524b5f305f852b7f5d0aa2b0a88f004ea3c1 | diff --git a/mr/src/itest/java/org/elasticsearch/hadoop/integration/mr/AbstractMROldApiSearchTest.java b/mr/src/itest/java/org/elasticsearch/hadoop/integration/mr/AbstractMROldApiSearchTest.java
index <HASH>..<HASH> 100644
--- a/mr/src/itest/java/org/elasticsearch/hadoop/integration/mr/AbstractMROldApiSearchTest.java
+++ b/mr/src/itest/java/org/elasticsearch/hadoop/integration/mr/AbstractMROldApiSearchTest.java
@@ -20,7 +20,6 @@ package org.elasticsearch.hadoop.integration.mr;
import java.io.IOException;
import java.util.Collection;
-import java.util.Random;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
@@ -122,7 +121,7 @@ public class AbstractMROldApiSearchTest {
@Test
public void testDynamicPattern() throws Exception {
Assert.assertTrue(RestUtils.exists("mroldapi/pattern-1"));
- Assert.assertTrue(RestUtils.exists("mroldapi/pattern-" + new Random().nextInt(950)));
+ Assert.assertTrue(RestUtils.exists("mrnewapi/pattern-500"));
Assert.assertTrue(RestUtils.exists("mroldapi/pattern-990"));
} | Remove random number from test due to sparse IDs | elastic_elasticsearch-hadoop | train | java |
b5e18cce5114efd030f6fdc662d221fcaead382d | diff --git a/test/index.js b/test/index.js
index <HASH>..<HASH> 100644
--- a/test/index.js
+++ b/test/index.js
@@ -183,7 +183,7 @@ describe('gulp-symlink', function() {
stream.end()
})
- it('should symlink 2 sources to 2 different destinations', function(cb) {
+ it('should symlink 2 sources to 2 different destinations [array]', function(cb) {
var dests = ['./test/fixtures/links/test', './test/fixtures/links/test_dir']
@@ -205,4 +205,32 @@ describe('gulp-symlink', function() {
stream.end()
})
+
+ it('should symlink 2 sources to 2 different destinations [function]', function(cb) {
+
+ var dests = ['./test/fixtures/links/test', './test/fixtures/links/test_dir']
+ var i = 0
+ var stream = symlink(function(source) {
+ i++ //make sure this is called 2 times
+ return p.resolve(source.path, '../../fixtures/links', p.basename(source.path))
+ })
+
+ stream.on('data', function(data) {
+ })
+
+ stream.on('end', function() {
+
+ for(var j in dests)
+ expect(fs.existsSync(dests[j])).to.be.true
+
+ expect(i).to.equal(2)
+
+ async.map(dests, rm, cb)
+ })
+
+ stream.write(file)
+ stream.write(dir)
+ stream.end()
+ })
+
}) | Added test on function that should be called as much as there are sources | soyuka_gulp-sym | train | js |
0e6c51ad752e12b932b262e864ca4fe2080fa3ff | diff --git a/lib/ooor/connection.rb b/lib/ooor/connection.rb
index <HASH>..<HASH> 100644
--- a/lib/ooor/connection.rb
+++ b/lib/ooor/connection.rb
@@ -69,6 +69,10 @@ module Ooor
define_openerp_model(model: openerp_model, scope_prefix: @config[:scope_prefix])
end
+ def[](model_key)
+ const_get(model_key)
+ end
+
def connection_session
@connection_session ||= {}.merge!(@config[:connection_session] || {})
end | added new handly [] method on an OOOR connection to get the object with OpenERP model key | akretion_ooor | train | rb |
125b380a4da18e172b8524e8a64ea19f1cc9d914 | diff --git a/actionpack/lib/action_controller/metal/redirecting.rb b/actionpack/lib/action_controller/metal/redirecting.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_controller/metal/redirecting.rb
+++ b/actionpack/lib/action_controller/metal/redirecting.rb
@@ -63,10 +63,12 @@ module ActionController
#
# Passing user input directly into +redirect_to+ is considered dangerous (e.g. `redirect_to(params[:location])`).
# Always use regular expressions or a permitted list when redirecting to a user specified location.
- def redirect_to(options = {}, response_options = {}, allow_other_host: _allow_other_host)
+ def redirect_to(options = {}, response_options = {})
raise ActionControllerError.new("Cannot redirect to nil!") unless options
raise AbstractController::DoubleRenderError if response_body
+ allow_other_host = response_options.key?(:allow_other_host) ? response_options.delete(:allow_other_host) : _allow_other_host
+
self.status = _extract_redirect_to_status(options, response_options)
self.location = _enforce_open_redirect_protection(_compute_redirect_to_location(request, options), allow_other_host: allow_other_host)
self.response_body = "<html><body>You are being <a href=\"#{ERB::Util.unwrapped_html_escape(response.location)}\">redirected</a>.</body></html>" | Fix build broken on <I>: can't use keyword arguments like this here | rails_rails | train | rb |
aa8f7c560bdf50d243dcc35d430b9b1fec2096d2 | diff --git a/lib/PathFinder.php b/lib/PathFinder.php
index <HASH>..<HASH> 100644
--- a/lib/PathFinder.php
+++ b/lib/PathFinder.php
@@ -174,6 +174,7 @@ class PathFinder extends AbstractController
}
$this->base_location=$this->addLocation(array(
+ 'addons'=>'vendor',
'php'=>'lib',
'page'=>'page',
'template'=>'templates', | search for addons in vendor dir automaticaly | atk4_atk4 | train | php |
4ae42a90dbe5c1ab3708bc54c30a9675025b00db | diff --git a/spec/acts-as-messageable_spec.rb b/spec/acts-as-messageable_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/acts-as-messageable_spec.rb
+++ b/spec/acts-as-messageable_spec.rb
@@ -71,11 +71,18 @@ describe "ActsAsMessageable" do
@alice.sent_messages.are_to(@bob).count.should == 1
end
- it "alice try to add something to conversation" do
+ it "bob try to add something to conversation" do
@reply_message = @bob.reply_to(@message, "Oh, I Forget", "1+1=2")
@reply_message.from.should == @message.from
@reply_message.to.should == @message.to
end
+
+ it "bob try to add something to conversation and should receive proper order" do
+ @reply_message = @bob.reply_to(@message, "Oh, I Forget", "1+1=2")
+ @sec_message = @alice.reply_to(@message, "Yeah, right", "1+1=3!")
+
+ @message.conversation.should == [@sec_message, @reply_message, @message]
+ end
end
describe "delete messages" do | Add specs for order [#<I>] | LTe_acts-as-messageable | train | rb |
e1c0133ed6c2ed08e3a9abb751e98db3b22dce08 | diff --git a/android/app/src/main/java/com/reactnativenavigation/views/SideMenu.java b/android/app/src/main/java/com/reactnativenavigation/views/SideMenu.java
index <HASH>..<HASH> 100644
--- a/android/app/src/main/java/com/reactnativenavigation/views/SideMenu.java
+++ b/android/app/src/main/java/com/reactnativenavigation/views/SideMenu.java
@@ -58,11 +58,11 @@ public class SideMenu extends DrawerLayout {
}
public void setVisible(boolean visible, boolean animated, Side side) {
- if (!isShown() && visible) {
+ if (visible) {
openDrawer(animated, side);
}
- if (isShown() && !visible) {
+ if (!visible) {
closeDrawer(animated, side);
}
} | Side Drawer Problem Resolved for Android (#<I>)
While working I got a situation in which I wanted to open the side drawer on a button click. But I was not able to that. So I made some changes and now I am able to achieve the required functionality. | wix_react-native-navigation | train | java |
094be0ad8ed802126682982ac05cb44e9c101aa8 | diff --git a/cmd/converger/main_test.go b/cmd/converger/main_test.go
index <HASH>..<HASH> 100644
--- a/cmd/converger/main_test.go
+++ b/cmd/converger/main_test.go
@@ -98,7 +98,7 @@ var _ = Describe("Converger", func() {
err := bbs.DesireTask(logger, task)
Ω(err).ShouldNot(HaveOccurred())
- err = bbs.StartTask(logger, task.TaskGuid, "dead-cell")
+ _, err = bbs.StartTask(logger, task.TaskGuid, "dead-cell")
Ω(err).ShouldNot(HaveOccurred())
} | discard StartTask changed value in test | cloudfoundry_converger | train | go |
405bc45cf6899d9320d2156ee188896cea918159 | diff --git a/lib/datalib.php b/lib/datalib.php
index <HASH>..<HASH> 100644
--- a/lib/datalib.php
+++ b/lib/datalib.php
@@ -77,7 +77,7 @@ function get_admins() {
$context = get_context_instance(CONTEXT_SYSTEM, SITEID);
- return get_users_by_capability($context, 'moodle/legacy:admin', 'distinct u.*, ra.id as adminid', ' ORDER BY ra.id ASC '); // only need first one
+ return get_users_by_capability($context, 'moodle/legacy:admin', 'u.*, ra.id as adminid', ' ORDER BY ra.id ASC '); // only need first one
} | No need to specify DISTINCT because u.* guaranties distinct by id. | moodle_moodle | train | php |
4a0cf6ddf376cddef79392eb28d9bfad790ca3b6 | diff --git a/structr-ui/src/main/resources/structr/js/entities.js b/structr-ui/src/main/resources/structr/js/entities.js
index <HASH>..<HASH> 100644
--- a/structr-ui/src/main/resources/structr/js/entities.js
+++ b/structr-ui/src/main/resources/structr/js/entities.js
@@ -336,10 +336,10 @@ var _Entities = {
flowSelector.append('<option>--- Select Flow ---</option>');
// (type, pageSize, page, sort, order, properties, includeHidden, callback)
- Command.getByType('FlowContainer', 1000, 1, 'name', 'asc', null, false, function(flows) {
+ Command.getByType('FlowContainer', 1000, 1, 'effectiveName', 'asc', null, false, function(flows) {
flows.forEach(function(flow) {
- flowSelector.append('<option value="' + flow.id + '">' + flow.name + '</option>');
+ flowSelector.append('<option value="' + flow.id + '">' + flow.effectiveName + '</option>');
});
initRepeaterInputs(); | Changes flow selector in repeaters to use effectiveName instead of name. | structr_structr | train | js |
db7b052c329faefb0268aba1c10da2e824769b66 | diff --git a/lib/bq-translator.js b/lib/bq-translator.js
index <HASH>..<HASH> 100644
--- a/lib/bq-translator.js
+++ b/lib/bq-translator.js
@@ -333,8 +333,7 @@ BooleanQueryTranslator.prototype = {
if (is_range) {
var expressions = [];
if (min.length == 0 && max.length == 0) {
- // TODO: report error: only ".."
- return "";
+ this.throwTranslateError("both min and max are missing");
}
if (min.length > 0) {
expressions.push(field + " >= " + min);
diff --git a/test/bq-translator.test.js b/test/bq-translator.test.js
index <HASH>..<HASH> 100644
--- a/test/bq-translator.test.js
+++ b/test/bq-translator.test.js
@@ -293,4 +293,9 @@ suite('BoolanQueryTranslator', function() {
"'\"keyword",
"'\"keyword||",
"close double quote for phrase is missing");
+
+ testExpressionError("value only: unsigned integer range: no min and max",
+ "..",
+ "..||",
+ "both min and max are missing");
}); | bq: throw exception for no min and max range | groonga_gcs | train | js,js |
d1b098b551b3a3b879d1eea69da61bb8c77775a5 | diff --git a/netpyne/batch/batch.py b/netpyne/batch/batch.py
index <HASH>..<HASH> 100644
--- a/netpyne/batch/batch.py
+++ b/netpyne/batch/batch.py
@@ -16,7 +16,7 @@ from netpyne import specs
from .utils import bashTemplate
from random import Random
from time import sleep, time
-from itertools import izip, product
+from itertools import product
from subprocess import Popen, PIPE
@@ -250,8 +250,8 @@ class Batch(object):
if groupedParams:
labelListGroup, valuesListGroup = zip(*[(p['label'], p['values']) for p in self.params if p['group'] == True])
- valueCombGroups = izip(*(valuesListGroup))
- indexCombGroups = izip(*[range(len(x)) for x in valuesListGroup])
+ valueCombGroups = zip(*(valuesListGroup))
+ indexCombGroups = zip(*[range(len(x)) for x in valuesListGroup])
labelList = labelListGroup+labelList
else:
valueCombGroups = [(0,)] # this is a hack -- improve! | replaced izip with zip in batch python3 version | Neurosim-lab_netpyne | train | py |
050c668eaceb063e2c22404aa0e97abf2abd5934 | diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py
index <HASH>..<HASH> 100644
--- a/discord/ext/commands/core.py
+++ b/discord/ext/commands/core.py
@@ -34,7 +34,8 @@ from .errors import *
from .view import quoted_word
__all__ = [ 'Command', 'Group', 'GroupMixin', 'command', 'group',
- 'has_role', 'has_permissions', 'has_any_role', 'check' ]
+ 'has_role', 'has_permissions', 'has_any_role', 'check',
+ 'bot_has_role', 'bot_has_permissions', 'bot_has_any_role' ]
def inject_context(ctx, coro):
@functools.wraps(coro) | [commands] Add bot decorators into __all__. | Rapptz_discord.py | train | py |
66599df41356948b336f66f6a16cde33570abdf2 | diff --git a/jawa/constants.py b/jawa/constants.py
index <HASH>..<HASH> 100644
--- a/jawa/constants.py
+++ b/jawa/constants.py
@@ -50,7 +50,7 @@ class ConstantNumber(Constant):
self.value = value
def __repr__(self):
- return '{0}(value={0!r})'.format(self.__class__.__name__, self.value)
+ return '{0}(value={1!r})'.format(self.__class__.__name__, self.value)
class ConstantUTF8(Constant): | Off-by-one on ConstantNumber __repr__ | TkTech_Jawa | train | py |
04a969835eb06efbb0895a202d7c8d0c3b6c0780 | diff --git a/namesys/dns.go b/namesys/dns.go
index <HASH>..<HASH> 100644
--- a/namesys/dns.go
+++ b/namesys/dns.go
@@ -52,10 +52,10 @@ func parseEntry(txt string) (path.Path, error) {
}
func tryParseDnsLink(txt string) (path.Path, error) {
- parts := strings.Split(txt, "=")
- if len(parts) == 1 || parts[0] != "dnslink" {
- return "", errors.New("not a valid dnslink entry")
+ parts := strings.SplitN(txt, "=", 2)
+ if len(parts) == 2 && parts[0] == "dnslink" {
+ return path.ParsePath(parts[1])
}
- return path.ParsePath(parts[1])
+ return "", errors.New("not a valid dnslink entry")
} | namesys/dns: Use SplitN to find dnslink references
RFC <I> requires printable ASCII except '=' for the key [1], but
allows any character including '=' in the value [2]. This patch
adjusts our parsing to avoid splitting on '=' in the value, and then
ignoring anything after that split.
[1]: <URL> | ipfs_go-ipfs | train | go |
490d3bcee93a7590aa45a892928f957766f04015 | diff --git a/build/build.py b/build/build.py
index <HASH>..<HASH> 100755
--- a/build/build.py
+++ b/build/build.py
@@ -1109,6 +1109,10 @@ else:
usePromiscuousSsl = 1
elif arg == '--promiscuous-ssl=off':
usePromiscuousSsl = 0
+ elif arg == '--no-self-update':
+ pass
+ elif arg == '--local':
+ pass
elif arg.startswith("--connection-timeout="):
connectionTimeoutSeconds = int(arg[21:])
elif arg.startswith("--socket-timeout="):
@@ -1124,6 +1128,8 @@ else:
elif arg == 'dldeps':
downloadDependencies()
downloadLocalEntities()
+ elif arg == 'checkout':
+ pass
elif arg == 'build':
buildAll()
elif arg == 'jar': | Restored some obsolete build-script args as noops | validator_validator | train | py |
95af95085d5aa8992468caff8862dc855157c6fc | diff --git a/lib/assets/Base.js b/lib/assets/Base.js
index <HASH>..<HASH> 100644
--- a/lib/assets/Base.js
+++ b/lib/assets/Base.js
@@ -56,7 +56,7 @@ Base.prototype = {
},
toString: function () {
- return "[" + this.type + "/" + this.id + "]";
+ return "[" + this.type + "/" + this.id + (this.url ? " " + this.url : "") + "]";
}
}; | assets.Base.toString(): Include the url if available. | assetgraph_assetgraph | train | js |
88d10ff27b28396f874408d56772554ad767d021 | diff --git a/cell.go b/cell.go
index <HASH>..<HASH> 100644
--- a/cell.go
+++ b/cell.go
@@ -60,7 +60,7 @@ func (f *File) SetCellValue(sheet, axis string, value interface{}) {
case []byte:
f.SetCellStr(sheet, axis, string(t))
case time.Time:
- f.SetCellDefault(sheet, axis, strconv.FormatFloat(float64(timeToExcelTime(timeToUTCTime(value.(time.Time)))), 'f', -1, 32))
+ f.SetCellDefault(sheet, axis, strconv.FormatFloat(float64(timeToExcelTime(timeToUTCTime(value.(time.Time)))), 'f', -1, 64))
f.setDefaultTimeStyle(sheet, axis)
case nil:
f.SetCellStr(sheet, axis, "") | Fix round-off error in representation of date and time values | 360EntSecGroup-Skylar_excelize | train | go |
abf6f135ec404e9501f96d217a14b8d38ed6a206 | diff --git a/fastlane_core/lib/fastlane_core/version.rb b/fastlane_core/lib/fastlane_core/version.rb
index <HASH>..<HASH> 100644
--- a/fastlane_core/lib/fastlane_core/version.rb
+++ b/fastlane_core/lib/fastlane_core/version.rb
@@ -1,3 +1,3 @@
module FastlaneCore
- VERSION = "0.55.0".freeze
+ VERSION = "0.55.1".freeze
end | fastlane_core version bump (#<I>) | fastlane_fastlane | train | rb |
549e02cb58abd0936563828cf13a7a9150bd9b89 | diff --git a/bqplot/traits.py b/bqplot/traits.py
index <HASH>..<HASH> 100644
--- a/bqplot/traits.py
+++ b/bqplot/traits.py
@@ -131,10 +131,13 @@ def array_from_json(value, obj=None):
else:
return np.array(value)
elif 'value' in value:
- # this should not work
- ar = np.frombuffer(value['value'], dtype=value['dtype']).reshape(value['shape'])
- # this should
- # ar = np.asarray(value['value'], dtype=value['dtype']).reshape(value['shape'])
+ try:
+ ar = np.frombuffer(value['value'], dtype=value['dtype']).reshape(value['shape'])
+ except AttributeError:
+ # in some python27/numpy versions it does not like the memoryview
+ # we go the .tobytes() route, but since i'm not 100% sure memory copying
+ # is happening or not, we one take this path if the above fails.
+ ar = np.frombuffer(value['value'].tobytes(), dtype=value['dtype']).reshape(value['shape'])
if value.get('type') == 'date':
assert value['dtype'] == 'float64'
ar = ar.astype('datetime64[ms]') | fix array deserialization for some versions of python/numpy | bloomberg_bqplot | train | py |
24b76f8fbb1b1247d0ef399da13fee4d3a3a42fd | diff --git a/main.js b/main.js
index <HASH>..<HASH> 100644
--- a/main.js
+++ b/main.js
@@ -39,8 +39,13 @@ function AddNotifier(notifier){
//Adds a detector and binds it to the environment
function AddDetector(detector){
motionDetectors.push(detector);
- environment.BindDetector(detector);
- detector.StartMonitoring();
+ if (environment)
+ {
+ environment.BindDetector(detector);
+ detector.StartMonitoring();
+ } else {
+ throw new Error("No environment was detected, please add one first.");
+ }
}
function RemoveNotifier(notifier){ | fixed bug when trying to add detector without an environment | tcardoso2_vermon | train | js |
84ae769b6445cb3e6fa63ed19205f7f2318e0403 | diff --git a/lib/httpi/adapter/excon.rb b/lib/httpi/adapter/excon.rb
index <HASH>..<HASH> 100644
--- a/lib/httpi/adapter/excon.rb
+++ b/lib/httpi/adapter/excon.rb
@@ -41,6 +41,7 @@ module HTTPI
opts = {
:host => url.host,
+ :hostname => url.hostname,
:path => url.path,
:port => url.port,
:query => url.query,
diff --git a/spec/httpi/adapter/excon_spec.rb b/spec/httpi/adapter/excon_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/httpi/adapter/excon_spec.rb
+++ b/spec/httpi/adapter/excon_spec.rb
@@ -23,6 +23,12 @@ begin
)
end
end
+ describe "host, hostname" do
+ it "both are set" do
+ Excon.expects(:display_warning).never
+ expect(adapter.client.data).to include(host: 'example.com', hostname: 'example.com')
+ end
+ end
end
end
end | Set both :host, and :hostname options on excon connection to avoid warning.
```
[excon][WARNING] hostname is missing! For IPv6 support, provide both host and hostname: Excon::Connection#new(:host => uri.host, :hostname => uri.hostname, ...).
``` | savonrb_httpi | train | rb,rb |
296cc5327782a03b4df4c68b17d9b33d216f8e93 | diff --git a/actiontext/lib/action_text/engine.rb b/actiontext/lib/action_text/engine.rb
index <HASH>..<HASH> 100644
--- a/actiontext/lib/action_text/engine.rb
+++ b/actiontext/lib/action_text/engine.rb
@@ -29,6 +29,10 @@ module ActionText
def attachable_plain_text_representation(caption = nil)
"[#{caption || filename}]"
end
+
+ def to_trix_content_attachment_partial_path
+ nil
+ end
end
end
diff --git a/actiontext/test/unit/attachment_test.rb b/actiontext/test/unit/attachment_test.rb
index <HASH>..<HASH> 100644
--- a/actiontext/test/unit/attachment_test.rb
+++ b/actiontext/test/unit/attachment_test.rb
@@ -32,8 +32,8 @@ class ActionText::AttachmentTest < ActiveSupport::TestCase
assert_equal attachable.byte_size, trix_attachment.attributes["filesize"]
assert_equal "Captioned", trix_attachment.attributes["caption"]
- assert_not_nil attachable.to_trix_content_attachment_partial_path
- assert_not_nil trix_attachment.attributes["content"]
+ assert_nil attachable.to_trix_content_attachment_partial_path
+ assert_nil trix_attachment.attributes["content"]
end
test "converts to TrixAttachment with content" do | Fix ActiveStorage::Blob → ActionText::TrixAttachment conversion
A regression introduced in <I>e<I>a5c<I>c<I>df9a1c4fe<I>f<I>b<I>e6 caused blobs to appear as HTML content attachments instead of file / image attachments when editing rich text content. This change restores the original intended behavior.
References: <URL> | rails_rails | train | rb,rb |
0106dd13d1cbbfbcf377a9d62d40d52f4fbaaff3 | diff --git a/siphon/cdmr/ncstream.py b/siphon/cdmr/ncstream.py
index <HASH>..<HASH> 100644
--- a/siphon/cdmr/ncstream.py
+++ b/siphon/cdmr/ncstream.py
@@ -30,20 +30,25 @@ def read_ncstream_messages(fobj):
break
if magic == MAGIC_HEADER:
+ log.debug('Header chunk')
messages.append(stream.Header())
messages[0].ParseFromString(read_block(fobj))
elif magic == MAGIC_DATA:
+ log.debug('Data chunk')
data = stream.Data()
data.ParseFromString(read_block(fobj))
if data.dataType in (stream.STRING, stream.OPAQUE) or data.vdata:
+ log.debug('Reading string/opaque')
dt = _dtypeLookup.get(data.dataType, np.object_)
num_obj = read_var_int(fobj)
blocks = np.array([read_block(fobj) for _ in range(num_obj)], dtype=dt)
messages.append(blocks)
elif data.dataType in _dtypeLookup:
+ log.debug('Reading array data')
data_block = read_numpy_block(fobj, data)
messages.append(data_block)
elif data.dataType in (stream.STRUCTURE, stream.SEQUENCE):
+ log.debug('Reading structure')
blocks = []
magic = read_magic(fobj)
while magic != MAGIC_VEND: | Add debug logging for ncstream. | Unidata_siphon | train | py |
189226634d3e646217381af18e653c15963014e7 | diff --git a/test/TestServer/PerfTestFramework.js b/test/TestServer/PerfTestFramework.js
index <HASH>..<HASH> 100644
--- a/test/TestServer/PerfTestFramework.js
+++ b/test/TestServer/PerfTestFramework.js
@@ -98,6 +98,9 @@ PerfTestFramework.prototype.startTests = function(platform, tests) {
var toComplete;
var self = this;
+
+ // Record that we're running tests for this platform
+ this.runningTests.push(platform);
var results = [];
function doTest(test) {
@@ -175,9 +178,6 @@ PerfTestFramework.prototype.startTests = function(platform, tests) {
}
});
- // Record that we're running tests for this platform
- self.runningTests.push(platform);
-
// Begin the test..
device.socket.emit(
"start", | Don't add platform to running tests every time we start an individual test | thaliproject_Thali_CordovaPlugin | train | js |
e670756f254a9f4eeb2907d2744a29f1a7285e6c | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -7,9 +7,9 @@ exports.properties = {
storeContextKey: true,
render: {
static (target, node) {
- var val = target.compute()
- if (val === true) {
- val = target.cParent().key
+ if (!target.$) {
+ var val = target.compute()
+ if (val === true) { val = target.cParent().key }
}
setClassName(target.storeStatic(val, node), node)
}, | fix for rendering static vs state | vigour-io_brisky-class | train | js |
9d49a51e7f881f21a82dcba98dee95f827d427cf | diff --git a/.scripts/version-to-source.js b/.scripts/version-to-source.js
index <HASH>..<HASH> 100755
--- a/.scripts/version-to-source.js
+++ b/.scripts/version-to-source.js
@@ -1,16 +1,20 @@
#!/usr/bin/env node
-const fs = require('fs')
-const path = require('path')
-const version = require(path.resolve('package.json')).version
+~function() {
+ "use strict"
-let data = fs.readFileSync(path.resolve('src', 'index.js')).toString()
+ const fs = require('fs')
+ const path = require('path')
+ const version = require(path.resolve('package.json')).version
-const lines = data.trim().split('\n')
-lines.pop() // delete last line
+ let data = fs.readFileSync(path.resolve('src', 'index.js')).toString()
-lines.push(`export const version = '${version}'`)
+ const lines = data.trim().split('\n')
+ lines.pop() // delete last line
-data = lines.join('\n') + '\n'
+ lines.push(`export const version = '${version}'`)
-fs.writeFileSync(path.resolve('src', 'index.js'), data)
+ data = lines.join('\n') + '\n'
+
+ fs.writeFileSync(path.resolve('src', 'index.js'), data)
+}() | Wrap code in function with 'use strict' for older versions of node. | trusktr_infamous | train | js |
fe8373bcd25ad474398ef799e3a0dc0d3685e3d3 | diff --git a/message/index.php b/message/index.php
index <HASH>..<HASH> 100644
--- a/message/index.php
+++ b/message/index.php
@@ -198,6 +198,11 @@ if (!empty($user2)) {
}
$countunreadtotal = message_count_unread_messages($user1);
+if ($countunreadtotal==0 && $usergroup==VIEW_UNREAD_MESSAGES && empty($user2)) {
+ //default to showing the search
+ $usergroup = VIEW_SEARCH;
+}
+
$blockedusers = message_get_blocked_users($user1, $user2);
$countblocked = count($blockedusers); | message MDL-<I> made message search appear by default | moodle_moodle | train | php |
aad6560860d39fd9142c2f87db717ba306d2a85e | diff --git a/lib/_wpilib/core.py b/lib/_wpilib/core.py
index <HASH>..<HASH> 100644
--- a/lib/_wpilib/core.py
+++ b/lib/_wpilib/core.py
@@ -273,17 +273,19 @@ class CANJaguar(SpeedController):
return self.reverse_ok
def GetPosition(self):
- if self.control_mode != kPosition:
- raise RuntimeError("Invalid control mode")
- return self.position
+ if hasattr(self, 'position_reference')
+ return self.speed
+ else
+ raise RuntimeError("No position reference set")
def GetSpeedReference(self):
return self.speed_reference
def GetSpeed(self):
- if self.control_mode != kSpeed:
- raise RuntimeError("Invalid control mode")
- return self.speed
+ if hasattr(self, 'speed_reference')
+ return self.speed
+ else
+ raise RuntimeError("No speed reference set")
def Set(self, value, syncGroup=0):
self.value = value | Changed GetSpeed and GetPosition to raise an error when the references aren't set, but work fine even if we are not in the corresponding control mode | robotpy_pyfrc | train | py |
f1b372ef74a32c499970a127e163fe5c7f853f08 | diff --git a/src/App.php b/src/App.php
index <HASH>..<HASH> 100644
--- a/src/App.php
+++ b/src/App.php
@@ -16,7 +16,7 @@ class App
// @var array|false Location where to load JS/CSS files
public $cdn = [
- 'atk' => 'https://cdn.rawgit.com/atk4/ui/1.5.7/public',
+ 'atk' => 'https://cdn.rawgit.com/atk4/ui/1.5.8/public',
'jquery' => 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1',
'serialize-object' => 'https://cdnjs.cloudflare.com/ajax/libs/jquery-serialize-object/2.5.0',
'semantic-ui' => 'https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.1',
@@ -24,7 +24,7 @@ class App
];
// @var string Version of Agile UI
- public $version = '1.5.7';
+ public $version = '1.5.8';
// @var string Name of application
public $title = 'Agile UI - Untitled Application'; | Updated CDN and $version in App.php to <I> | atk4_ui | train | php |
7bb5ef187d45cc57ea9577b1d43ba334a0ea14e8 | diff --git a/manifest.php b/manifest.php
index <HASH>..<HASH> 100755
--- a/manifest.php
+++ b/manifest.php
@@ -35,7 +35,7 @@ return [
'author' => 'Open Assessment Technologies, CRP Henri Tudor',
'requires' => [
'tao' => '>=27.0.0',
- 'generis' => '>=5.9.0'
+ 'generis' => '>=12.15.0'
],
'models' => [
'http://www.tao.lu/Ontologies/taoFuncACL.rdf' | dependency generis <I>. Removed some assertTrue from risky tests. | oat-sa_extension-tao-funcacl | train | php |
50515c2ebc333917ae42b3cb3151d6c9f7d6c719 | diff --git a/massautocomplete.js b/massautocomplete.js
index <HASH>..<HASH> 100644
--- a/massautocomplete.js
+++ b/massautocomplete.js
@@ -39,6 +39,7 @@ angular.module('MassAutoComplete', [])
var bound_events = {};
bound_events[EVENTS.BLUR] = null;
bound_events[EVENTS.KEYDOWN] = null;
+ bound_events[EVENTS.RESIZE] = null;
var _user_options = $scope.options() || {};
var user_options = {
@@ -171,12 +172,12 @@ angular.module('MassAutoComplete', [])
update_model_value(value);
current_options.on_detach && current_options.on_detach(value);
current_element.unbind(EVENTS.KEYDOWN, bound_events[EVENTS.KEYDOWN]);
- current_element.unbind(EVENTS.BLUR, bound_events[EVENTS.BLUR]);
+ current_element.unbind(EVENTS.BLUR, bound_events[EVENTS.BLUR]);
}
// Clear references and events.
$scope.show_autocomplete = false;
- angular.element($window).unbind(EVENTS.RESIZE);
+ angular.element($window).unbind(EVENTS.RESIZE, bound_events[EVENTS.RESIZE]);
value_watch && value_watch();
$scope.selected_index = $scope.results = undefined;
current_model = current_element = previous_value = undefined; | unbind only ac handler on resize on detach | hakib_MassAutocomplete | train | js |
8e4575eb21c00ef194fb1297b4af046581e18349 | diff --git a/executor/infoschema_reader.go b/executor/infoschema_reader.go
index <HASH>..<HASH> 100644
--- a/executor/infoschema_reader.go
+++ b/executor/infoschema_reader.go
@@ -271,7 +271,7 @@ func (c *statsCache) get(ctx sessionctx.Context) (map[int64]uint64, map[tableHis
}
func getAutoIncrementID(ctx sessionctx.Context, schema *model.DBInfo, tblInfo *model.TableInfo) (int64, error) {
- is := ctx.GetSessionVars().TxnCtx.InfoSchema.(infoschema.InfoSchema)
+ is := infoschema.GetInfoSchema(ctx)
tbl, err := is.TableByName(schema.Name, tblInfo.Name)
if err != nil {
return 0, err | executor: 'select * from information_schema.tables' fail after setting @@tidb_snapshot (#<I>) | pingcap_tidb | train | go |
0cf7f0ad4766cf449c5f9f602f8f623a7f223f93 | diff --git a/babelapi/babel/tower.py b/babelapi/babel/tower.py
index <HASH>..<HASH> 100644
--- a/babelapi/babel/tower.py
+++ b/babelapi/babel/tower.py
@@ -136,7 +136,7 @@ class TowerOfBabel(object):
# Remove namespaces that don't define data types or routes. These are
# either entirely empty, or only define aliases.
- for namespace in self.api.namespaces.values():
+ for namespace in list(self.api.namespaces.values()):
if not namespace.data_types and not namespace.routes:
del self.api.namespaces[namespace.name] | PY<I> compat fix: Mutating dict during iteration.
Test Plan: Repro-ed and tested with Java v2 SDK.
Reviewed By: kannan | dropbox_stone | train | py |
ddb598a6d71de2fe0c9d9785917a70d045cb194b | diff --git a/influxdb/client.py b/influxdb/client.py
index <HASH>..<HASH> 100644
--- a/influxdb/client.py
+++ b/influxdb/client.py
@@ -504,7 +504,7 @@ class InfluxDBClient(object):
self.request(
url=url,
method='DELETE',
- status_code=204
+ status_code=200
)
return True
diff --git a/tests/influxdb/client_test.py b/tests/influxdb/client_test.py
index <HASH>..<HASH> 100644
--- a/tests/influxdb/client_test.py
+++ b/tests/influxdb/client_test.py
@@ -336,7 +336,7 @@ class TestInfluxDBClient(unittest.TestCase):
m.register_uri(
requests_mock.DELETE,
"http://localhost:8086/cluster_admins/paul",
- status_code=204,
+ status_code=200,
)
cli = InfluxDBClient(database='db') | delete_cluster_admin should expect <I>, fixed #<I> | influxdata_influxdb-python | train | py,py |
43c2413631860d92e64433c2ad63794642742b95 | diff --git a/Mail/Helper.php b/Mail/Helper.php
index <HASH>..<HASH> 100644
--- a/Mail/Helper.php
+++ b/Mail/Helper.php
@@ -101,7 +101,7 @@ class Helper implements HelperInterface
$this->logger->info(sprintf(
'Try register mail from L91 FormBundle: ' . PHP_EOL .
- ' From: ' . $fromMail . PHP_EOL .
+ ' From: ' . serialize($fromMail) . PHP_EOL .
' To: ' . $toMail . PHP_EOL .
($replayTo != null) ? 'Reply to: ' . $replayTo . PHP_EOL : '' .
' Subject: ' . $subject | Fix sending emails using the 'name <email>' format
Trying to set the 'From' address as 'name <email>' currently
fails because the logging can't handle array-variables. This
patch serializes the $fromMail variable for the logger which
fixes the issue.
Fixes #<I> | sulu_SuluFormBundle | train | php |
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.