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 |
|---|---|---|---|---|---|
2703a07c215c6c92387fdd220e3bf5cb2a91f32e | diff --git a/packages/okidoc-md/src/utils/nodeAST.js b/packages/okidoc-md/src/utils/nodeAST.js
index <HASH>..<HASH> 100644
--- a/packages/okidoc-md/src/utils/nodeAST.js
+++ b/packages/okidoc-md/src/utils/nodeAST.js
@@ -56,6 +56,7 @@ function cleanUpClassProperty(
// https://github.com/babel/babel/blob/v7.0.0-beta.44/packages/babel-plugin-transform-typescript/src/index.js#L155-L168
node.accessibility = null;
node.decorators = [];
+ item.optional = false;
cleanUpNodeJSDoc(node, JSDocCommentValue);
} | fix(okidoc-md): fix issue ts vs flow issue for optional class property | wix_okidoc | train | js |
6f57664bca76f90cad307034124d722b0317e9b1 | diff --git a/cli.js b/cli.js
index <HASH>..<HASH> 100755
--- a/cli.js
+++ b/cli.js
@@ -121,6 +121,7 @@ cli
console.log('[FATAL] There was an error while reading the file:', err)
} else {
cpu = new LC2(cli.debug)
+ cpu.turnOn()
// Start catching key events from STDIN and pass them to the onRead
process.stdin.setRawMode(true)
process.stdin.on('data', onRead)
diff --git a/lib/LC2.js b/lib/LC2.js
index <HASH>..<HASH> 100644
--- a/lib/LC2.js
+++ b/lib/LC2.js
@@ -352,7 +352,7 @@ LC2.prototype.jsrr = function (src, i6, l) {
LC2.prototype.trap = function (trapn) {
this.gpr[7] = this.pc
this.pc = this.mem(trapn)
- if (this.debug) console.log('PC = x' + common.pad(this.pc.toString(16), 4))
+ if (this.debug) console.log('PC = mem[mem[x' + common.pad(trapn.toString(16)) + ']] =', common.pad(this.pc.toString(16), 4))
}
LC2.prototype.ret = function () {
this.pc = this.gpr[7] | fixed bug in cli, better trap debugging | fazo96_LC2.js | train | js,js |
264622c5bfb5f322be917962394c1dec24db7ba3 | diff --git a/lib/open_exchange_rates/version.rb b/lib/open_exchange_rates/version.rb
index <HASH>..<HASH> 100644
--- a/lib/open_exchange_rates/version.rb
+++ b/lib/open_exchange_rates/version.rb
@@ -1,3 +1,3 @@
module OpenExchangeRates
- VERSION = "0.2.0"
+ VERSION = "0.2.1"
end | Bumped version number to <I> | vlado_open_exchange_rates | train | rb |
0f279999090579fba18971652066fe3306e23da0 | diff --git a/image.go b/image.go
index <HASH>..<HASH> 100644
--- a/image.go
+++ b/image.go
@@ -400,7 +400,7 @@ type DrawTrianglesShaderOptions struct {
Uniforms map[string]interface{}
// Images is a set of the source images.
- // All the image must be the same bounds.
+ // All the images must be the same sizes.
Images [4]*Image
// FillRule indicates the rule how an overlapped region is rendered.
@@ -542,7 +542,7 @@ type DrawRectShaderOptions struct {
Uniforms map[string]interface{}
// Images is a set of the source images.
- // All the image must be the same bounds.
+ // All the images must be the same sizes.
Images [4]*Image
} | ebiten: bug fix: wrong comments
Updates #<I>
Updates #<I> | hajimehoshi_ebiten | train | go |
35df48a7450ebc24c565b5811af8d63beb8715a8 | diff --git a/Entity/ContactSourceRepository.php b/Entity/ContactSourceRepository.php
index <HASH>..<HASH> 100644
--- a/Entity/ContactSourceRepository.php
+++ b/Entity/ContactSourceRepository.php
@@ -64,7 +64,7 @@ class ContactSourceRepository extends CommonRepository
return $this->addStandardCatchAllWhereClause(
$q,
$filter,
- ['f.name', 'f.description', 'f.description_public', 'f.token', 'f.utmSource']
+ ['f.name', 'f.description', 'f.descriptionPublic', 'f.token', 'f.utmSource']
);
} | fix camel casing of description_public to descriptionPublic | TheDMSGroup_mautic-contact-source | train | php |
2496ee72c079f9ef0f7be15b1f7a5b04c4b55e97 | diff --git a/js/bitstamp.js b/js/bitstamp.js
index <HASH>..<HASH> 100644
--- a/js/bitstamp.js
+++ b/js/bitstamp.js
@@ -294,6 +294,10 @@ module.exports = class bitstamp extends Exchange {
'mpl_address/': 1,
'euroc_withdrawal/': 1,
'euroc_address/': 1,
+ 'sol_withdrawal/': 1,
+ 'sol_address/': 1,
+ 'dot_withdrawal/': 1,
+ 'dot_address/': 1,
},
},
}, | Added support for SOL and DOT | ccxt_ccxt | train | js |
17f71d827f5e1167a2c4a18b5f09bcdf9f87c08d | diff --git a/test/bad-dns-warning.js b/test/bad-dns-warning.js
index <HASH>..<HASH> 100644
--- a/test/bad-dns-warning.js
+++ b/test/bad-dns-warning.js
@@ -78,7 +78,7 @@ describe("BADDNS", () => {
getdns.BAD_DNS_CNAME_RETURNED_FOR_OTHER_TYPE,
];
- return badDnsValus.includes(badDns);
+ return badDnsValus.indexOf(badDns) !== -1;
});
expect(badDnsReplies.length).to.be(reply.bad_dns.length);
}); | Replace [].includes() call for node.js v4 support | getdnsapi_getdns-node | train | js |
2812f11bdc86495dd9ef62b4b45d90335bcbda7d | diff --git a/runtests.py b/runtests.py
index <HASH>..<HASH> 100644
--- a/runtests.py
+++ b/runtests.py
@@ -18,6 +18,7 @@ if not settings.configured:
'NAME': ':memory:',
}
},
+ MIDDLEWARE_CLASSES=(),
INSTALLED_APPS=(
'selectable',
), | Set middleware classes to suppress warning on <I>+ | mlavin_django-selectable | train | py |
c454c8741e07774169ef3e46cb4d4a653871c0e1 | diff --git a/amino/util/mod.py b/amino/util/mod.py
index <HASH>..<HASH> 100644
--- a/amino/util/mod.py
+++ b/amino/util/mod.py
@@ -6,4 +6,8 @@ def unsafe_import_name(modname: str, name: str) -> Optional[Any]:
mod = importlib.import_module(modname)
return getattr(mod, name) if hasattr(mod, name) else None
-__all__ = ('unsafe_import_name',)
+
+def class_path(cls: type) -> str:
+ return f'{cls.__module__}.{cls.__name__}'
+
+__all__ = ('unsafe_import_name', 'class_path') | helper `class_path` that creates a string for a class | tek_amino | train | py |
73d1cea5cf251386ea70d21930425c0c97e2554e | diff --git a/LiSE/LiSE/rule.py b/LiSE/LiSE/rule.py
index <HASH>..<HASH> 100644
--- a/LiSE/LiSE/rule.py
+++ b/LiSE/LiSE/rule.py
@@ -445,11 +445,11 @@ class RuleMapping(MutableMapping, Signal):
def __init__(self, engine, rulebook):
super().__init__()
self.engine = engine
+ self._rule_cache = self.engine.rule._cache
if isinstance(rulebook, RuleBook):
self.rulebook = rulebook
else:
self.rulebook = self.engine.rulebook[rulebook]
- self._rule_cache = {}
def __repr__(self):
return 'RuleMapping({})'.format([k for k in self])
@@ -466,9 +466,6 @@ class RuleMapping(MutableMapping, Signal):
def __getitem__(self, k):
if k not in self:
raise KeyError("Rule '{}' is not in effect".format(k))
- if k not in self._rule_cache:
- self._rule_cache[k] = Rule(self.engine, k)
- self._rule_cache[k].active = True
return self._rule_cache[k]
def __getattr__(self, k): | Make all RuleMapping instances use the AllRules cache
Fixes a bug where actions were getting deleted right after adding. | LogicalDash_LiSE | train | py |
05418a59f5b3ed77a7b24c77b35fdca244b708a6 | diff --git a/qtpylib/futures.py b/qtpylib/futures.py
index <HASH>..<HASH> 100644
--- a/qtpylib/futures.py
+++ b/qtpylib/futures.py
@@ -79,8 +79,14 @@ def create_continous_contract(df, resolution="1T"):
except:
pass
- return flags[['symbol', 'expiry', 'gap']]
+ flags = flags[flags['symbol'] == flags['symbol'].unique()]
+
+ # single row df won't resample
+ if len(flags) <= 1:
+ flags = pd.DataFrame(index=pd.date_range(start=flags[0:1].index[0],
+ periods=24, freq="1H"), data=flags[['symbol', 'expiry', 'gap']]).ffill()
+ return flags[['symbol', 'expiry', 'gap']]
# gonna need this later
df['datetime'] = df.index | fixed bug where pandas won't resample df with 1 row | ranaroussi_qtpylib | train | py |
42a2f7769301b0e033d9e11a70bae3cd1a27ab88 | diff --git a/mod/wiki/ewiki/ewiki.php b/mod/wiki/ewiki/ewiki.php
index <HASH>..<HASH> 100644
--- a/mod/wiki/ewiki/ewiki.php
+++ b/mod/wiki/ewiki/ewiki.php
@@ -1087,6 +1087,8 @@ function ewiki_page_versions($id=0, $data=0) {
function ewiki_page_search($id, &$data, $action) {
+ global $CFG;
+
$o = ewiki_make_title($id, $id, 2, $action);
if (! ($q = @$_REQUEST["q"])) {
@@ -1099,7 +1101,11 @@ function ewiki_page_search($id, &$data, $action) {
else {
$found = array();
- $q = preg_replace('/\s*[^\w]+\s*/', ' ', $q);
+ if ($CFG->unicodedb) {
+ $q = preg_replace('/\s*[\W]+\s*/u', ' ', $q);
+ } else {
+ $q = preg_replace('/\s*[^\w]+\s*/', ' ', $q);
+ }
foreach (explode(" ", $q) as $search) {
if (empty($search)) { continue; } | Now wiki supports Unicode searches
Merged from MOODLE_<I>_STABLE | moodle_moodle | train | php |
315d90e39e98edf5aacdf09c98d2b61c9da92bf7 | diff --git a/src/AutosizeInput.js b/src/AutosizeInput.js
index <HASH>..<HASH> 100644
--- a/src/AutosizeInput.js
+++ b/src/AutosizeInput.js
@@ -76,7 +76,7 @@ var AutosizeInput = React.createClass({
this.refs.input.getDOMNode().select();
},
render () {
- var escapedValue = (this.props.value || '').replace(/ /g, ' ').replace(/\</g, '<').replace(/\>/g, '>');
+ var escapedValue = (this.props.value || '').replace(/\&/g, '&').replace(/ /g, ' ').replace(/\</g, '<').replace(/\>/g, '>');
var wrapperStyle = this.props.style || {};
wrapperStyle.display = 'inline-block';
var inputStyle = this.props.inputStyle || {}; | Escaping & characters in input, fixes #9 | JedWatson_react-input-autosize | train | js |
b7aa7cc20f1f127a31138e71a0c5170fe0218513 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -136,6 +136,6 @@ setup(
ext_modules=extensions,
setup_requires=['numpy'],
install_requires=['numpy>=1.9.2', 'six'],
- tests_require=['nose', 'decorator', 'trollius', 'netifaces'],
+ tests_require=['nose', 'decorator', 'trollius'],
test_suite='nose.collector',
packages=['spead2', 'spead2.recv', 'spead2.send']) | Remove accidentally added netifaces dependency | ska-sa_spead2 | train | py |
95eb9a641bf2f63341640d4a0a774ce6519bfc37 | diff --git a/packages/qiskit-sdk/bin/cmds/sim.js b/packages/qiskit-sdk/bin/cmds/sim.js
index <HASH>..<HASH> 100644
--- a/packages/qiskit-sdk/bin/cmds/sim.js
+++ b/packages/qiskit-sdk/bin/cmds/sim.js
@@ -50,15 +50,16 @@ exports.handler = argv => {
const pathCode = path.resolve(process.cwd(), argv.circuit);
- logger.info(`${logger.emoji('mag')} Reading the circuit file: ${pathCode}`);
+ logger.info(`${logger.emoji('mag')} Reading the circuit file: ${pathCode}`);
readFile(pathCode, 'utf8')
// TODO: .then(code => {
.then(() => {
logger.error(
- 'Still not supported, waiting for the new simulator implementation',
+ '\nStill not supported, waiting for the new simulator implementation',
);
process.exit(1);
})
+ // TODO from here.
// logger.info('Parsing the code file ...');
// let codeParsed; | Minor improvement to beautify a CLI output | Qiskit_qiskit-js | train | js |
284da1487c4574352ba54a0d60c23d7ebd9e31b5 | diff --git a/src/Composer/Command/DiagnoseCommand.php b/src/Composer/Command/DiagnoseCommand.php
index <HASH>..<HASH> 100644
--- a/src/Composer/Command/DiagnoseCommand.php
+++ b/src/Composer/Command/DiagnoseCommand.php
@@ -474,10 +474,10 @@ EOT
if ($hadError) {
$io->write('<error>FAIL</error>');
- $this->exitCode = 2;
+ $this->exitCode = max($this->exitCode, 2);
} elseif ($hadWarning) {
$io->write('<warning>WARNING</warning>');
- $this->exitCode = 1;
+ $this->exitCode = max($this->exitCode, 1);
}
if ($result) {
@@ -716,7 +716,7 @@ EOT
*
* @return bool|string
*/
- private function checkConnectivity()
+ private function checkConnectivity()
{
if (!ini_get('allow_url_fopen')) {
$result = '<info>Skipped because allow_url_fopen is missing.</info>'; | Avoid downgrading from error to warning | composer_composer | train | php |
f1b62de81862b7b70c5b833d48bfde5a54801b3c | diff --git a/Kwc/Directories/List/ViewAjax/Component.defer.js b/Kwc/Directories/List/ViewAjax/Component.defer.js
index <HASH>..<HASH> 100644
--- a/Kwc/Directories/List/ViewAjax/Component.defer.js
+++ b/Kwc/Directories/List/ViewAjax/Component.defer.js
@@ -346,6 +346,7 @@ Kwc.Directories.List.ViewAjax.prototype = {
}
}
this.$el.html(html);
+ this.$el.trigger('load', data);
Kwf.callOnContentReady(this.$el, { action: 'render' });
}).bind(this));
}, | Add js-event for ajax-view loaded
Needed for web to update totalResults for search-params | koala-framework_koala-framework | train | js |
d52203ee03e96dade6b332a9121ab071888569c6 | diff --git a/release/long_running_tests/workloads/serve.py b/release/long_running_tests/workloads/serve.py
index <HASH>..<HASH> 100644
--- a/release/long_running_tests/workloads/serve.py
+++ b/release/long_running_tests/workloads/serve.py
@@ -38,9 +38,8 @@ def update_progress(result):
result["last_update"] = time.time()
test_output_json = os.environ.get("TEST_OUTPUT_JSON",
"/tmp/release_test_output.json")
- with open(test_output_json, "at") as f:
+ with open(test_output_json, "wt") as f:
json.dump(result, f)
- f.write("\n")
cluster = Cluster() | [ci/release] Fix long running serve test result fetching (#<I>) | ray-project_ray | train | py |
83fed1e78720bf9a1e3cbd77ef57256c8ea1df46 | diff --git a/src/java/voldemort/xml/StoreDefinitionsMapper.java b/src/java/voldemort/xml/StoreDefinitionsMapper.java
index <HASH>..<HASH> 100644
--- a/src/java/voldemort/xml/StoreDefinitionsMapper.java
+++ b/src/java/voldemort/xml/StoreDefinitionsMapper.java
@@ -93,7 +93,6 @@ public class StoreDefinitionsMapper {
}
}
- @SuppressWarnings("unchecked")
public List<StoreDefinition> readStoreList(Reader input) {
try {
@@ -106,8 +105,8 @@ public class StoreDefinitionsMapper {
throw new MappingException("Invalid root element: "
+ doc.getRootElement().getName());
List<StoreDefinition> stores = new ArrayList<StoreDefinition>();
- for(Element store: (List<Element>) root.getChildren(STORE_ELMT))
- stores.add(readStore(store));
+ for(Object store: root.getChildren(STORE_ELMT))
+ stores.add(readStore((Element) store));
return stores;
} catch(JDOMException e) {
throw new MappingException(e); | Replace unchecked cast with checked one and remove now unnecessary @SuppressWarnings. | voldemort_voldemort | train | java |
9ac1f76148cc8baa7df7601ea41bc62645a7f57c | diff --git a/src/tools/mountainchart/mountainchart.js b/src/tools/mountainchart/mountainchart.js
index <HASH>..<HASH> 100644
--- a/src/tools/mountainchart/mountainchart.js
+++ b/src/tools/mountainchart/mountainchart.js
@@ -5,6 +5,7 @@ import MountainChartComponent from './mountainchart-component';
import {
timeslider,
buttonlist,
+ treemenu,
datawarning
}
from 'components/_index';
@@ -36,6 +37,10 @@ var MountainChart = Tool.extend('MountainChart', {
placeholder: '.vzb-tool-buttonlist',
model: ['state', 'ui', 'language']
}, {
+ component: treemenu,
+ placeholder: '.vzb-tool-treemenu',
+ model: ['state.marker', 'language']
+ }, {
component: datawarning,
placeholder: '.vzb-tool-datawarning',
model: ['language'] | Add treemenu to mountain chart, closes #<I> | vizabi_vizabi | train | js |
635e8adfc60ba6a19a906c7b02a87e6e12785eb9 | diff --git a/src/sap.m/src/sap/m/Page.js b/src/sap.m/src/sap/m/Page.js
index <HASH>..<HASH> 100644
--- a/src/sap.m/src/sap/m/Page.js
+++ b/src/sap.m/src/sap/m/Page.js
@@ -456,6 +456,7 @@ function(
};
Page.prototype._adjustFooterWidth = function () {
+ var bDirection = sap.ui.getCore().getConfiguration().getRTL() ? "left" : "right";
if (!this.getShowFooter() || !this.getFloatingFooter() || !this.getFooter()) {
return;
}
@@ -463,10 +464,10 @@ function(
var $footer = jQuery(this.getDomRef()).find(".sapMPageFooter").last();
if (this._contentHasScroll()) {
- $footer.css("right", jQuery.position.scrollbarWidth() + "px");
+ $footer.css(bDirection, jQuery.position.scrollbarWidth() + "px");
$footer.css("width", "initial");
} else {
- $footer.css("right", 0);
+ $footer.css(bDirection, 0);
$footer.css("width", "");
}
}; | [FIX] sap.m.Page: Initial rendering of floating footer corrected
If the floating footer page is inially loaded in rtl language
the footer width was set incorrectly.
BCP: <I>
Change-Id: I<I>fdd<I>a<I>e<I>ab<I>f<I>b8abdcd<I> | SAP_openui5 | train | js |
f9fb6144d41d9ed1489f20cf03847f0641ca27b5 | diff --git a/gen_markdown.py b/gen_markdown.py
index <HASH>..<HASH> 100644
--- a/gen_markdown.py
+++ b/gen_markdown.py
@@ -18,7 +18,7 @@ Register Map
for m in memory_maps.memoryMap:
for block in m.addressBlock:
for reg in sorted(block.register, key=lambda addr: addr.addressOffset):
- s += "\n## 0x{:x} {}\n\n".format(offset+reg.addressOffset, reg.name)
+ s += "\n## 0x{:x} {}\n\n".format(offset+block.baseAddress+reg.addressOffset, reg.name)
if reg.description:
s += "{}\n\n".format(reg.description) | gen_markdown.py: Consider address block offset | olofk_ipyxact | train | py |
b2f0eb7d19517fb5894a4da51e1e4513ee28159e | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -74,9 +74,9 @@ author = "caner & inso & vit"
# built documents.
#
# The short X.Y version.
-version = "0.57.0"
+version = "0.61.0"
# The full version, including alpha/beta/rc tags.
-release = "0.57.0"
+release = "0.61.0"
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. | [fix] !<I>: Update documentation to <I>
It wasn't updated because the regex didn't match the old version | duniter_duniter-python-api | train | py |
2b0e2561b6e5747a6ddd3081da8bd9a7cb630db1 | diff --git a/holoviews/plotting/bokeh/element.py b/holoviews/plotting/bokeh/element.py
index <HASH>..<HASH> 100644
--- a/holoviews/plotting/bokeh/element.py
+++ b/holoviews/plotting/bokeh/element.py
@@ -181,10 +181,6 @@ class ElementPlot(BokehPlot, GenericElementPlot):
# Get the bottom layer and range element
el = element.traverse(lambda x: x, [Element])
el = el[0] if el else element
- if self.batched and not isinstance(self, OverlayPlot):
- range_el = el
- else:
- range_el = element
dims = el.dimensions()
xlabel, ylabel, zlabel = self._get_axis_labels(dims)
@@ -215,7 +211,10 @@ class ElementPlot(BokehPlot, GenericElementPlot):
else:
y_axis_type = 'log' if self.logy else 'auto'
+ # Get the Element that determines the range and get_extents
+ range_el = el if self.batched and not isinstance(self, OverlayPlot) else element
l, b, r, t = self.get_extents(range_el, ranges)
+
if not 'x_range' in plot_ranges:
if 'x_range' in ranges:
plot_ranges['x_range'] = ranges['x_range'] | Small fix to clean up bokeh range initialization | pyviz_holoviews | train | py |
22681b701d491b761b5a0ec65a9e3bd95d5d62ce | diff --git a/lib/origen/database/key_value_store.rb b/lib/origen/database/key_value_store.rb
index <HASH>..<HASH> 100644
--- a/lib/origen/database/key_value_store.rb
+++ b/lib/origen/database/key_value_store.rb
@@ -75,6 +75,8 @@ module Origen
# Deletes a key from the active store
def delete_key(key)
store.delete(key)
+ save_to_file
+ load_from_file
end
# Return an array of store keys, excluding the 'infrastructure' key(s) | updated the delete_key method to be a permanent delete by saving hte store to file and reloading the store from file | Origen-SDK_origen | train | rb |
2d8212b30a4061b9849fbbadbce26ead248336ff | diff --git a/src/sap.ui.core/src/sap/ui/core/delegate/ItemNavigation.js b/src/sap.ui.core/src/sap/ui/core/delegate/ItemNavigation.js
index <HASH>..<HASH> 100644
--- a/src/sap.ui.core/src/sap/ui/core/delegate/ItemNavigation.js
+++ b/src/sap.ui.core/src/sap/ui/core/delegate/ItemNavigation.js
@@ -577,6 +577,12 @@ sap.ui.define(['jquery.sap.global', 'sap/ui/base/EventProvider'],
ItemNavigation.prototype.setFocusedIndex = function(iIndex) {
var $Item;
+ if (this.aItemDomRefs.length < 0) {
+ // no items -> don't change TabIndex
+ this.iFocusedIndex = -1;
+ return this;
+ }
+
if (iIndex < 0) {
iIndex = 0;
} | [FIX] sap.ui.core.delegate.ItemNavigation: no items
if there are no Items in the ItemNavigation the tabIndex 0 must not be
removed from the root DOM-Ref
Change-Id: I2f<I>c1e<I>f<I>dd<I>d<I>a1aa<I>b<I>
BCP: <I> | SAP_openui5 | train | js |
ff124ef90f0fb9e3cea12230762c5e9fb6411de7 | diff --git a/lib/merb-core.rb b/lib/merb-core.rb
index <HASH>..<HASH> 100644
--- a/lib/merb-core.rb
+++ b/lib/merb-core.rb
@@ -10,9 +10,9 @@ root = root.to_a.empty? ? Dir.getwd : root
if File.directory?(gems_dir = File.join(root, 'gems'))
$BUNDLE = true; Gem.clear_paths; Gem.path.unshift(gems_dir)
# Warn if local merb-core is available but not loaded.
- if !($0 =~ /^(\.\/)?bin\/merb$/) &&
+ if File.expand_path($0).index(root) != 0 &&
(local_mc = Dir[File.join(gems_dir, 'specifications', 'merb-core-*.gemspec')].last)
- puts "Warning: please use bin/merb to load #{File.basename(local_mc, '.gemspec')} from ./gems"
+ puts "Warning: please use bin/#{File.basename($0)} to load #{File.basename(local_mc, '.gemspec')} from ./gems"
end
end | More fine-grained check to see if a local ./bin executable should have been used | wycats_merb | train | rb |
8f6b9b45918c2e7eda0bd797262f91ebc0ac0c11 | diff --git a/stanza/models/constituency_parser.py b/stanza/models/constituency_parser.py
index <HASH>..<HASH> 100644
--- a/stanza/models/constituency_parser.py
+++ b/stanza/models/constituency_parser.py
@@ -245,7 +245,7 @@ def parse_args(args=None):
# 0.015: 0.81721
# 0.010: 0.81474348
# 0.005: 0.81503
- DEFAULT_WEIGHT_DECAY = { "adamw": 0.01, "adadelta": 0.02, "sgd": 0.01, "adabelief": 1.2e-6, "madgrad": 1e-6 }
+ DEFAULT_WEIGHT_DECAY = { "adamw": 0.05, "adadelta": 0.02, "sgd": 0.01, "adabelief": 1.2e-6, "madgrad": 1e-6 }
parser.add_argument('--weight_decay', default=None, type=float, help='Weight decay (eg, l2 reg) to use in the optimizer')
parser.add_argument('--optim', default='Adadelta', help='Optimizer type: SGD, AdamW, Adadelta, AdaBelief')
parser.add_argument('--learning_rho', default=0.9, type=float, help='Rho parameter in Adadelta') | This WD seems to work better? needs more testing | stanfordnlp_stanza | train | py |
a2430f4266a698abdb75d5e61b44b4bbd33b46af | diff --git a/packages/cli/cli.js b/packages/cli/cli.js
index <HASH>..<HASH> 100644
--- a/packages/cli/cli.js
+++ b/packages/cli/cli.js
@@ -4,14 +4,14 @@ const yargs = require("yargs");
const { log, getProject } = require("./utils");
const { boolean } = require("boolean");
+// Disable help processing until after plugins are imported.
+yargs.help(false);
+
// Immediately load .env.{PASSED_ENVIRONMENT} and .env files.
// This way we ensure all of the environment variables are not loaded too late.
const project = getProject();
let paths = [path.join(project.root, ".env")];
-// Disable help processing until after plugins are imported
-yargs.help(false);
-
if (yargs.argv.env) {
paths.push(path.join(project.root, `.env.${yargs.argv.env}`));
}
@@ -102,6 +102,6 @@ yargs
(async () => {
await createCommands(yargs, context);
- // Run
+ // Enable help and run the CLI.
yargs.help().argv;
})(); | refactor: bring `yargs.help(false);` to the top | Webiny_webiny-js | train | js |
70afbf245f1038b91a664dcee98cb8dea61d9b91 | diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -477,7 +477,7 @@ module ActiveRecord
@foreign_key_drops << name
end
- def add_column(name, type, options)
+ def add_column(name, type, **options)
name = name.to_s
type = type.to_sym
@adds << AddColumnDefinition.new(@td.new_column_definition(name, type, **options))
diff --git a/activerecord/lib/active_record/migration/compatibility.rb b/activerecord/lib/active_record/migration/compatibility.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/migration/compatibility.rb
+++ b/activerecord/lib/active_record/migration/compatibility.rb
@@ -150,7 +150,7 @@ module ActiveRecord
super
end
- def add_column(table_name, column_name, type, options = {})
+ def add_column(table_name, column_name, type, **options)
if type == :primary_key
type = :integer
options[:primary_key] = true | Unify `add_column` method definition with other ones that take keyword arguments | rails_rails | train | rb,rb |
ec5860cfa49558e7477d9593ed91a8f9297821f4 | diff --git a/antfarm/urls.py b/antfarm/urls.py
index <HASH>..<HASH> 100644
--- a/antfarm/urls.py
+++ b/antfarm/urls.py
@@ -15,8 +15,9 @@ specified, they will default to {}.
'''
from collections import namedtuple
-
+from functools import partial
import re
+
from . import response
class KeepLooking(Exception):
@@ -29,7 +30,7 @@ class url_dispatcher(object):
__slots__ = ('patterns',)
def __init__(self, *patterns):
- self.patterns = tuple(self._make_url(pattern) for pattern in patterns)
+ self.patterns = [self._make_url(pattern) for pattern in patterns]
def _make_url(self, pattern):
'''Helper to ensure all patterns are url instances.'''
@@ -51,3 +52,10 @@ class url_dispatcher(object):
def handle_not_found(self, request):
return response.NotFound()
+
+ def register(self, pattern, view=None):
+ '''Allow decorator-style construction of URL pattern lists.'''
+ if view is None:
+ return partial(self.register, pattern)
+ self.patterns.append(self._make_url((pattern, view)))
+ return view | Add register to urls_dispatcher | funkybob_antfarm | train | py |
e4eb8d7a93f1894ad6ea3daaf646e1a78ac47b6f | diff --git a/src/Application/LayoutApplication.php b/src/Application/LayoutApplication.php
index <HASH>..<HASH> 100644
--- a/src/Application/LayoutApplication.php
+++ b/src/Application/LayoutApplication.php
@@ -78,7 +78,7 @@ class LayoutApplication extends Application
// twig template namespaces
foreach ($elementTypesModel->getAllElementTypes() as $elementType)
{
- $this["twig.loader.filesystem"]->addPath($elementTypesModel->getUserSubDirectory($elementType), $elementType);
+ $this["twig.loader.filesystem"]->addPath($elementTypesModel->getUserSubDirectory("{$elementType}s"), $elementType);
}
diff --git a/src/Model/ElementTypesModel.php b/src/Model/ElementTypesModel.php
index <HASH>..<HASH> 100644
--- a/src/Model/ElementTypesModel.php
+++ b/src/Model/ElementTypesModel.php
@@ -134,6 +134,6 @@ class ElementTypesModel
*/
public function getUserSubDirectory ($directoryName)
{
- return "{$this->baseDir}/layout/views/{$directoryName}s";
+ return "{$this->baseDir}/layout/views/{$directoryName}";
}
} | Explicitly add the "s" at the end of the layout subdirs | Becklyn_Gluggi | train | php,php |
2b2177280cb239e72223f88fe29e9bc2fab88461 | diff --git a/dygraph.js b/dygraph.js
index <HASH>..<HASH> 100644
--- a/dygraph.js
+++ b/dygraph.js
@@ -2736,7 +2736,7 @@ Dygraph.prototype.computeYAxisRanges_ = function(extremes) {
p_axis = axis;
}
}
- if(p_axis == undefined)
+ if(p_axis === undefined)
throw ("Configuration Error: At least one axis has to have the \"independentTicks\" option activated.");
// Add ticks. By default, all axes inherit the tick positions of the
// primary axis. However, if an axis is specifically marked as having | BUG FIX: Changed check to undefined with === as proposed by jslint. | danvk_dygraphs | train | js |
de1e99bdd0657cc44b4cdf93500d4f466cba42b7 | diff --git a/lib/aasm/core/event.rb b/lib/aasm/core/event.rb
index <HASH>..<HASH> 100644
--- a/lib/aasm/core/event.rb
+++ b/lib/aasm/core/event.rb
@@ -139,6 +139,7 @@ module AASM::Core
end
transitions.each do |transition|
+ transition.failures.clear #https://github.com/aasm/aasm/issues/383
next if to_state and !Array(transition.to).include?(to_state)
if (options.key?(:may_fire) && transition.eql?(options[:may_fire])) ||
(!options.key?(:may_fire) && transition.allowed?(obj, *args)) | Fix failures array in transition not being reset | aasm_aasm | train | rb |
2eed5b9ceef8a2912d7a767afc9d78d546e75cc8 | diff --git a/src/config/config.php b/src/config/config.php
index <HASH>..<HASH> 100644
--- a/src/config/config.php
+++ b/src/config/config.php
@@ -24,7 +24,7 @@ return array(
|
*/
- 'keyName' => 'X-API-KEY',
+ 'keyName' => 'Authorization',
/*
|-------------------------------------------------------------------------- | Changed default api key header parameter to "Authorization" so that it is encrypted when using SSL | chrisbjr_api-guard | train | php |
f595bc0b675bab6c6affb22d48a572f2f342f2b6 | diff --git a/test/headful.spec.js b/test/headful.spec.js
index <HASH>..<HASH> 100644
--- a/test/headful.spec.js
+++ b/test/headful.spec.js
@@ -118,11 +118,11 @@ module.exports.addTests = function({testRunner, expect, puppeteer, defaultBrowse
await browser.close();
});
it('should open devtools when "devtools: true" option is given', async({server}) => {
- const browser = await puppeteer.launch({...headfulOptions, devtools: true});
+ const browser = await puppeteer.launch(Object.assign({devtools: true}, headfulOptions));
const context = await browser.createIncognitoBrowserContext();
await Promise.all([
context.newPage(),
- context.waitForTarget(target => target.url().startsWith('devtools://')),
+ context.waitForTarget(target => target.url().includes('devtools://')),
]);
await browser.close();
}); | test: fix tests to work on node6 (#<I>)
Our magical node6 transpiler can't handle object spreads :(
Drive-by: use "includes" instead of "startsWith" for devtools URL
since I remember that it used to be "chrome-devtools://", and somehow
I saw it as "devtools://" somewhere. | GoogleChrome_puppeteer | train | js |
c7a340e2be351e24c3be7aba8fa2032fa6f01e52 | diff --git a/integration-cli/docker_cli_network_unix_test.go b/integration-cli/docker_cli_network_unix_test.go
index <HASH>..<HASH> 100644
--- a/integration-cli/docker_cli_network_unix_test.go
+++ b/integration-cli/docker_cli_network_unix_test.go
@@ -1417,8 +1417,9 @@ func (s *DockerSuite) TestDockerNetworkInternalMode(c *check.C) {
c.Assert(waitRun("first"), check.IsNil)
dockerCmd(c, "run", "-d", "--net=internal", "--name=second", "busybox", "top")
c.Assert(waitRun("second"), check.IsNil)
- _, _, err := dockerCmdWithTimeout(time.Second, "exec", "first", "ping", "-c", "1", "www.google.com")
+ out, _, err := dockerCmdWithError("exec", "first", "ping", "-W", "4", "-c", "1", "www.google.com")
c.Assert(err, check.NotNil)
+ c.Assert(out, checker.Contains, "100% packet loss")
_, _, err = dockerCmdWithError("exec", "second", "ping", "-c", "1", "first")
c.Assert(err, check.IsNil)
} | Update ping command timeout to 4 sec | moby_moby | train | go |
982efc582afbde2facd3463e0975b05695e66bba | diff --git a/lib/rawHandler.js b/lib/rawHandler.js
index <HASH>..<HASH> 100644
--- a/lib/rawHandler.js
+++ b/lib/rawHandler.js
@@ -114,7 +114,13 @@ function createMiddleware(options) {
const { owner } = req.params;
const repoName = req.params.repo;
const refName = req.params.ref;
- const fpath = req.params[0];
+ let fpath = req.params[0];
+
+ // issue #247: lenient handling of redundant leading slashes in path
+ while (fpath.length && fpath[0] === '/') {
+ // trim leading slash
+ fpath = fpath.substr(1);
+ }
// TODO: handle branch names containing '/' (e.g. 'foo/bar') | #<I>: lenient handling of redundant leading slashes in path | adobe_git-server | train | js |
13a2f2838fc339b99edc1a569fc68f849fb115fe | diff --git a/lib/jets/util.rb b/lib/jets/util.rb
index <HASH>..<HASH> 100644
--- a/lib/jets/util.rb
+++ b/lib/jets/util.rb
@@ -23,15 +23,15 @@ module Jets::Util
# Especially since Lambda functions will usually only require some of the
# classes most of the time.
def boot
+ # app/models/application_record
application_files = %w[
app/controllers/application_controller
app/jobs/application_job
- app/models/application_record
app/models/application_item
]
application_files.each do |p|
path = "#{Jets.root}#{p}"
- require path if File.exist?(path)
+ require path# if File.exist?(path)
end
Dir.glob("#{Jets.root}app/**/*").each do |path| | error if application file doesnt require | tongueroo_jets | train | rb |
f9fd476f816b44d40f7565eee39c495a8aee2e28 | diff --git a/src/php/wp-cli/commands/internals/theme.php b/src/php/wp-cli/commands/internals/theme.php
index <HASH>..<HASH> 100644
--- a/src/php/wp-cli/commands/internals/theme.php
+++ b/src/php/wp-cli/commands/internals/theme.php
@@ -121,6 +121,21 @@ class ThemeCommand extends WP_CLI_Command {
WP_CLI::line( $path );
}
+ /**
+ * Delete a theme
+ *
+ * @param array $args
+ */
+ function delete( $args ) {
+ list( $file, $name ) = $this->parse_name( $args, __FUNCTION__ );
+
+ $r = delete_theme( $name );
+
+ if ( is_wp_error( $r ) ) {
+ WP_CLI::error( $r );
+ }
+ }
+
protected function parse_name( $args, $subcommand ) {
if ( empty( $args ) ) {
WP_CLI::line( "usage: wp theme $subcommand <theme-name>" );
@@ -155,6 +170,7 @@ Available sub-commands:
status display status of all installed themes or of a particular theme
activate activate a particular theme
path print path to the theme's stylesheet
+ delete delete a theme
EOB
);
} | add theme delete subcommand. fixes #<I> | wp-cli_export-command | train | php |
d95f1e22269c0d8031eaed5aa0e1dba38f551dce | diff --git a/client/state/data-layer/wpcom/read/tags/mine/new/index.js b/client/state/data-layer/wpcom/read/tags/mine/new/index.js
index <HASH>..<HASH> 100644
--- a/client/state/data-layer/wpcom/read/tags/mine/new/index.js
+++ b/client/state/data-layer/wpcom/read/tags/mine/new/index.js
@@ -47,6 +47,11 @@ export function receiveFollowTag( store, action, next, apiResponse ) {
}
export function receiveError( store, action, next, error ) {
+ // exit early and do nothing if the error is that the user is already following the tag
+ if ( error && error.error === 'already_subscribed' ) {
+ return;
+ }
+
const errorText = translate( 'Could not follow tag: %(tag)s', {
args: { tag: action.payload.slug }
} ); | Reader: fix for following something you are already follwing (#<I>) | Automattic_wp-calypso | train | js |
8e1d37147263937be15bd57f6dea3198b135cc10 | diff --git a/src/bindings/python/setup.py b/src/bindings/python/setup.py
index <HASH>..<HASH> 100644
--- a/src/bindings/python/setup.py
+++ b/src/bindings/python/setup.py
@@ -190,6 +190,10 @@ class CMakeBuild(build_ext):
'CMAKE_GENERATOR'
])
+ if is_osx:
+ cmake_args.append('-DCLANG_USE_LIBCPP=ON')
+ cmake_args.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9')
+
# example of build args
build_args = [
'--config', config,
@@ -305,9 +309,6 @@ class CMakeBuild(build_ext):
if DEP_DIR64:
cmake_args.append('-DLIBSEDML_DEPENDENCY_DIR=' + DEP_DIR64)
cmake_args.append('-DLIBEXPAT_INCLUDE_DIR=' + join(DEP_DIR64, 'include'))
- elif is_osx:
- cmake_args.append('-DCLANG_USE_LIBCPP=ON')
- cmake_args.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9')
os.chdir(build_temp)
self.spawn(['cmake', SRC_DIR] + cmake_args) | - fix build on osx | fbergmann_libSEDML | train | py |
48193070ff23d80b988786ae0077d072b7ca8c7c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,7 @@ setup(
url='https://github.com/jwodder/javaproperties',
setup_requires=['pytest-runner>=2.0,<3'],
- install_requires=['six'],
+ install_requires=['six>=1.4.0,<2'],
tests_require=['pytest>=2.8,<3'],
extras_require={ | Requires six>=<I> (in which `unichr` was added) | jwodder_javaproperties | train | py |
3d4f5a8eb04515eca361e518e00cdd983f7d8019 | diff --git a/pyculiarity/detect_anoms.py b/pyculiarity/detect_anoms.py
index <HASH>..<HASH> 100644
--- a/pyculiarity/detect_anoms.py
+++ b/pyculiarity/detect_anoms.py
@@ -78,7 +78,7 @@ def detect_anoms(data, k=0.49, alpha=0.05, num_obs_per_period=None,
p = {
'timestamp': decomp.index,
- 'value': (decomp['trend'] + decomp['seasonal']).truncate().convert_objects(convert_numeric=True)
+ 'value': ps.to_numeric((decomp['trend'] + decomp['seasonal']).truncate())
}
data_decomp = ps.DataFrame(p) | Fix deprecation warning
Pandas says convert_objects is deprecated and suggests specific to_numeric instead. | zrnsm_pyculiarity | train | py |
345044906d7f4f007b410ee8a1036721c8561f8a | diff --git a/src/styles/lines/lines.js b/src/styles/lines/lines.js
index <HASH>..<HASH> 100644
--- a/src/styles/lines/lines.js
+++ b/src/styles/lines/lines.js
@@ -179,7 +179,7 @@ Object.assign(Lines, {
// Reusable outline style object, marked as already wrapped in cache objects (preprocessed = true)
style.outline = style.outline || { width: {}, next_width: {}, preprocessed: true };
- if (draw.outline && draw.outline.color && draw.outline.width) {
+ if (draw.outline && draw.outline.visible !== false && draw.outline.color && draw.outline.width) {
// outline width in meters
// NB: multiply by 2 because outline is applied on both sides of line
let outline_width = this.calcWidth(draw.outline.width, context) * 2; | support `visible` property for `outline` block (under `lines`) | tangrams_tangram | train | js |
0a432818740fdac4af08c6610a42c3456b69c633 | diff --git a/nomnom.js b/nomnom.js
index <HASH>..<HASH> 100644
--- a/nomnom.js
+++ b/nomnom.js
@@ -118,20 +118,8 @@ function ArgParser() {
return parser;
},
- parseArgs : function(argv, parserOpts) {
+ parseArgs : function(argv) {
var printHelp = true;
- if(!Array.isArray(argv) || (argv.length
- && typeof argv[0] != "string")) {
- // using old API
- parserOpts = parserOpts || {};
- parser.specs = argv;
- parser.script = parserOpts.script;
- parser.print = parserOpts.printFunc;
- printHelp = parserOpts.printHelp;
- if(printHelp === undefined)
- printHelp = true;
- argv = parserOpts.argv;
- }
parser.print = parser.print || function(str) {
require("sys").puts(str);
process.exit(0); | remove support for old <I>.x api | harthur_nomnom | train | js |
f4eb4a773886f99bc195b4f94505c1b34f914ef2 | diff --git a/lib/XeroOAuth.php b/lib/XeroOAuth.php
index <HASH>..<HASH> 100644
--- a/lib/XeroOAuth.php
+++ b/lib/XeroOAuth.php
@@ -587,7 +587,7 @@ class XeroOAuth {
* @return string the current URL
*/
public static function php_self($dropqs = true) {
- $url = sprintf ( '%s://%s%s', empty ( $_SERVER ['HTTPS'] ) ? (@$_SERVER ['SERVER_PORT'] == '443' ? 'https' : 'http') : 'https', $_SERVER ['SERVER_NAME'], $_SERVER ['REQUEST_URI'] );
+ $url = sprintf ( '%s://%s%s', empty ( $_SERVER ['HTTPS'] ) ? (@$_SERVER ['SERVER_PORT'] == '443' ? 'https' : 'http') : 'http', $_SERVER ['SERVER_NAME'], $_SERVER ['REQUEST_URI'] );
$parts = parse_url ( $url ); | Update XeroOAuth.php
reverted earlier change | XeroAPI_XeroOAuth-PHP | train | php |
a5f0142b2f083d39fe606f418cbf1b235b18c51c | diff --git a/src/Backup.php b/src/Backup.php
index <HASH>..<HASH> 100644
--- a/src/Backup.php
+++ b/src/Backup.php
@@ -12,7 +12,7 @@ class Backup extends Extension
{
public function getExists()
{
- $statuses = BackupDestinationStatusFactory::createForMonitorConfig(config('backup.monitorBackups'));
+ $statuses = BackupDestinationStatusFactory::createForMonitorConfig(config('backup.monitor_backups'));
$listCommand = new ListCommand(); | Config key changes update for moniter backups
Moniter Backup camel case updated as per the backup config file. | laravel-admin-extensions_backup | train | php |
df12fde4e040ea2620baec506dccb3412bb2f376 | diff --git a/github/github-accessors.go b/github/github-accessors.go
index <HASH>..<HASH> 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -9132,6 +9132,14 @@ func (r *Repository) GetDescription() string {
return *r.Description
}
+// GetDisabled returns the Disabled field if it's non-nil, zero value otherwise.
+func (r *Repository) GetDisabled() bool {
+ if r == nil || r.Disabled == nil {
+ return false
+ }
+ return *r.Disabled
+}
+
// GetDownloadsURL returns the DownloadsURL field if it's non-nil, zero value otherwise.
func (r *Repository) GetDownloadsURL() string {
if r == nil || r.DownloadsURL == nil {
diff --git a/github/repos.go b/github/repos.go
index <HASH>..<HASH> 100644
--- a/github/repos.go
+++ b/github/repos.go
@@ -57,6 +57,7 @@ type Repository struct {
AllowMergeCommit *bool `json:"allow_merge_commit,omitempty"`
Topics []string `json:"topics,omitempty"`
Archived *bool `json:"archived,omitempty"`
+ Disabled *bool `json:"disabled,omitempty"`
// Only provided when using RepositoriesService.Get while in preview
License *License `json:"license,omitempty"` | Add disabled bit to Organization struct. (#<I>) | google_go-github | train | go,go |
c72bafa1702a43c443d85da398ff234ba45351b6 | diff --git a/Controller/GeneratorController.php b/Controller/GeneratorController.php
index <HASH>..<HASH> 100755
--- a/Controller/GeneratorController.php
+++ b/Controller/GeneratorController.php
@@ -22,8 +22,11 @@ class GeneratorController extends Controller {
foreach ($list as $entity) {
list($bundleName, $path) = explode("/", substr($entity, 1), 2);
$bundle = $kernel->getBundle($bundleName, true);
- if ($entity[strlen($entity)-1] == "/") {
- /** Entity end with backslash, it is a directory */
+
+ /** Entity end with backslash, it is a directory */
+ $loadAllEntitiesFromDir = ($entity[strlen($entity)-1] == "/");
+
+ if ( $loadAllEntitiesFromDir ) {
$bundleRef = new \ReflectionClass($bundle);
$dir = new Finder();
$dir->files()->depth('== 0')->in(dirname($bundleRef->getFileName()).'/'.$path)->name('/.*\.php$/'); | refactoring for better code understanding
line $entity[strlen($entity)-1] == "/" is not so obvious | AmsTaFFix_extjs-bundle | train | php |
d53c8361303b95a51e48c368da8d61556f65ed6d | diff --git a/pysat/_instrument.py b/pysat/_instrument.py
index <HASH>..<HASH> 100644
--- a/pysat/_instrument.py
+++ b/pysat/_instrument.py
@@ -1176,7 +1176,7 @@ class Instrument(object):
- def to_netcdf4(self, fname=None, base_instrument=None, epoch_name='epoch', zlib=False):
+ def to_netcdf4(self, fname=None, base_instrument=None, epoch_name='Epoch', zlib=False):
"""Stores loaded data into a netCDF3/4 file.
Parameters
diff --git a/pysat/utils.py b/pysat/utils.py
index <HASH>..<HASH> 100644
--- a/pysat/utils.py
+++ b/pysat/utils.py
@@ -77,7 +77,7 @@ def set_data_dir(path=None, store=None):
raise ValueError('Path does not lead to a valid directory.')
-def load_netcdf4(fnames=None, strict_meta=False, file_format=None, epoch_name='epoch',
+def load_netcdf4(fnames=None, strict_meta=False, file_format=None, epoch_name='Epoch',
units_label='units', name_label='long_name'):
# unix_time=False, **kwargs):
"""Load netCDF-3/4 file produced by pysat. | updated to Epoch from epoch | rstoneback_pysat | train | py,py |
6bbba9e78af7c17ff081b663d3aa6a690aa2bb59 | diff --git a/spec/factories/concern/env.rb b/spec/factories/concern/env.rb
index <HASH>..<HASH> 100644
--- a/spec/factories/concern/env.rb
+++ b/spec/factories/concern/env.rb
@@ -1,6 +1,16 @@
-# -*- coding: utf-8 -*-
# frozen_string_literal: true
+# Files are described by path and data (content loaded as env)
+sample_files = {
+ math: [
+ SAMPLES_PATH.join('concern/env/math.env').realpath,
+ {
+ 'MATH_E' => Math::E.to_s,
+ 'MATH_PI' => Math::PI.to_s
+ }
+ ]
+}
+
FactoryBot.define do
factory 'concern/env', class: FactoryStruct do
sequence(:subject) do |seq|
@@ -10,5 +20,17 @@ FactoryBot.define do
include SwagDev::Project::Concern::Env
end.new
end
+
+ sequence(:files) do |seq|
+ @files ||= []
+
+ sample_files.each do |k, v|
+ @files
+ .tap { |h| h[seq] = {} } [seq]
+ .merge!(k => FactoryStruct.new(path: v.fetch(0), data: v.fetch(1)))
+ end
+
+ @files[seq]
+ end
end
end | concern/env (spec/factories) files sequence added | SwagDevOps_kamaze-project | train | rb |
7db2d00badd36f3f9bf1d62247fea7caaba6683a | diff --git a/tchannel/tornado/tchannel.py b/tchannel/tornado/tchannel.py
index <HASH>..<HASH> 100644
--- a/tchannel/tornado/tchannel.py
+++ b/tchannel/tornado/tchannel.py
@@ -41,21 +41,17 @@ class TChannel(object):
def __init__(self):
self.peers = {}
- @tornado.gen.coroutine
def add_peer(self, hostport):
if hostport not in self.peers:
self.peers[hostport] = TornadoConnection.outgoing(hostport)
- connection = yield self.peers[hostport]
- raise tornado.gen.Return(connection)
+ return self.peers[hostport]
def remove_peer(self, hostport):
# TODO: Connection cleanup
return self.peers.pop(hostport)
- @tornado.gen.coroutine
def get_peer(self, hostport):
- peer = yield self.add_peer(hostport)
- raise tornado.gen.Return(peer)
+ return self.add_peer(hostport)
def request(self, hostport, service=None):
return TChannelClientOperation(hostport, service, self) | [python] Eliminate unnecessary coroutines | uber_tchannel-python | train | py |
cc2c095de859967df59b50cc34b4f9d5f0e31f34 | diff --git a/gooey/python_bindings/config_generator.py b/gooey/python_bindings/config_generator.py
index <HASH>..<HASH> 100644
--- a/gooey/python_bindings/config_generator.py
+++ b/gooey/python_bindings/config_generator.py
@@ -41,8 +41,3 @@ def create_from_parser(parser, source_path, **kwargs):
build_spec['manual_start'] = True
return build_spec
-
-
-
-def has_argparse(module_path):
- return any(['.parse_args(' in line.lower() for line in f.readlines()]) | Remove broken function.
config_generator.has_argparse could not work as
`f` does not exist in scope. Furthermore, I suspect it is
probably a duplication accident, as it's very similar
to source_parser.has_argparse, which is the only one
used in the codebase. | chriskiehl_Gooey | train | py |
5d6d1d839fec9eb6dca2222470273ce38952164c | diff --git a/holoviews/core/options.py b/holoviews/core/options.py
index <HASH>..<HASH> 100644
--- a/holoviews/core/options.py
+++ b/holoviews/core/options.py
@@ -687,6 +687,8 @@ class Store(object):
object.
"""
+ renderers = {} # The set of available Renderers across all backends.
+
# A mapping from ViewableElement types to their corresponding plot
# types. Set using the register_plots methods.
registry = {}
diff --git a/holoviews/plotting/mpl/__init__.py b/holoviews/plotting/mpl/__init__.py
index <HASH>..<HASH> 100644
--- a/holoviews/plotting/mpl/__init__.py
+++ b/holoviews/plotting/mpl/__init__.py
@@ -101,6 +101,9 @@ def default_options(options):
# Interface
options.TimeSeries = Options('style', color=Cycle())
+
+Store.renderers['matplotlib'] = MPLRenderer
+
# Register the default options
Store.option_setters.append(default_options) | Introduced Store.renderers containing the set of available Renderers | pyviz_holoviews | train | py,py |
64612868dabe6c9809e000962f1b1f075ea9cc12 | diff --git a/lib/fog/xenserver/models/compute/pool.rb b/lib/fog/xenserver/models/compute/pool.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/xenserver/models/compute/pool.rb
+++ b/lib/fog/xenserver/models/compute/pool.rb
@@ -19,19 +19,41 @@ module Fog
attribute :restrictions
attribute :ha_enabled
attribute :vswitch_controller
+ attribute :__suspend_image_sr, :aliases => :suspend_image_SR
def default_sr
connection.storage_repositories.get __default_sr
end
+ def default_sr=(sr)
+ connection.set_attribute( 'pool', reference, 'default_SR', sr.reference )
+ end
+ alias :default_storage_repository= :default_sr=
+
def default_storage_repository
default_sr
end
+ def suspend_image_sr=(sr)
+ connection.set_attribute( 'pool', reference, 'suspend_image_SR', sr.reference )
+ end
+
+ def suspend_image_sr
+ connection.storage_repositories.get __suspend_image_sr
+ end
+
def master
connection.hosts.get __master
end
+
+ def set_attribute(name, *val)
+ data = connection.set_attribute( 'pool', reference, name, *val )
+ # Do not reload automatically for performance reasons
+ # We can set multiple attributes at the same time and
+ # then reload manually
+ #reload
+ end
end | [xenserver] missing Pool model attribute, new methods
- Added missing suspend_image_sr attribute
- added default_sr getter/setter
- added suspend_image_sr getter/setter
- added generic set_attribute method | fog_fog | train | rb |
077c84ba2c43c2b35c70fb06cafa394bd9af8a17 | diff --git a/lxd/daemon.go b/lxd/daemon.go
index <HASH>..<HASH> 100644
--- a/lxd/daemon.go
+++ b/lxd/daemon.go
@@ -1943,11 +1943,15 @@ func (d *Daemon) hasNodeListChanged(heartbeatData *cluster.APIHeartbeat) bool {
return true
}
- // Check for node address changes.
+ // Check for member address or state changes.
for lastMemberID, lastMember := range d.lastNodeList.Members {
if heartbeatData.Members[lastMemberID].Address != lastMember.Address {
return true
}
+
+ if heartbeatData.Members[lastMemberID].Online != lastMember.Online {
+ return true
+ }
}
return false | lxd/daemon: Update hasNodeListChanged to detect member state changes | lxc_lxd | train | go |
a619573dc9bbdce365c04d76dc6509fd5260c6bc | diff --git a/molgenis-core-ui/src/main/java/org/molgenis/ui/MolgenisInterceptor.java b/molgenis-core-ui/src/main/java/org/molgenis/ui/MolgenisInterceptor.java
index <HASH>..<HASH> 100644
--- a/molgenis-core-ui/src/main/java/org/molgenis/ui/MolgenisInterceptor.java
+++ b/molgenis-core-ui/src/main/java/org/molgenis/ui/MolgenisInterceptor.java
@@ -21,9 +21,7 @@ public class MolgenisInterceptor extends HandlerInterceptorAdapter
public static final String APP_HREF_LOGO = "app.href.logo";
private final ResourceFingerprintRegistry resourceFingerprintRegistry;
private final MolgenisSettings molgenisSettings;
-
public static final String I18N_LOCALE = "i18nLocale";
-
private final String environment;
@Autowired | revert changes (spacing) | molgenis_molgenis | train | java |
a8862ad8861114faf994118311f95f758991b012 | diff --git a/tests/ApiTest.php b/tests/ApiTest.php
index <HASH>..<HASH> 100644
--- a/tests/ApiTest.php
+++ b/tests/ApiTest.php
@@ -2,6 +2,12 @@
namespace WardenApi;
+/**
+ * Class to test the Warden API functionality.
+ *
+ * @package WardenApi
+ * @author John Ennew <johne@deeson.co.uk>
+ */
class ApiTest extends \PHPUnit_Framework_TestCase {
/** | Added doc comments to test class | teamdeeson_wardenapi | train | php |
2b4408a0d30c3d7ac6ea07f8e61cdfc7aa925f05 | diff --git a/core/src/main/java/lucee/runtime/net/http/ServletContextDummy.java b/core/src/main/java/lucee/runtime/net/http/ServletContextDummy.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/lucee/runtime/net/http/ServletContextDummy.java
+++ b/core/src/main/java/lucee/runtime/net/http/ServletContextDummy.java
@@ -319,37 +319,37 @@ public class ServletContextDummy implements ServletContext {
- @Override
+
public ServletRegistration.Dynamic addJspFile(String s, String s1) {
return null;
}
- @Override
+
public int getSessionTimeout() {
return 0;
}
- @Override
+
public void setSessionTimeout(int i) {
}
- @Override
+
public String getRequestCharacterEncoding() {
return null;
}
- @Override
+
public void setRequestCharacterEncoding(String s) {
}
- @Override
+
public String getResponseCharacterEncoding() {
return null;
}
- @Override
+
public void setResponseCharacterEncoding(String s) {
} | removed override from noop impl of abstract methods that were added in Servlet <I>
this causes some version mismatches between dev environment and build environment | lucee_Lucee | train | java |
1273e3acfe1c0e6fbecc1e894944bdef955e07c4 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -20,6 +20,7 @@ module.exports = {
browser: require('./configs/browser'),
es6: require('./configs/es6'),
flow: require('./configs/flow'),
+ node: require('./configs/node'),
react: require('./configs/react'),
recommended: require('./configs/recommended'),
relay: require('./configs/relay') | add node to list of configs | github_eslint-plugin-github | train | js |
c7584b5c92da00807a88420c384e165b269f6a89 | diff --git a/tests/test_contract.py b/tests/test_contract.py
index <HASH>..<HASH> 100755
--- a/tests/test_contract.py
+++ b/tests/test_contract.py
@@ -14,7 +14,7 @@ class ContractTestSuite(unittest.TestCase):
@staticmethod
def test_balance_json_with_proxy():
- proxies = {'http': 'http://78.188.162.174:45318', 'https': 'https://78.188.162.174:45318'}
+ proxies = {'http': 'http://196.43.235.238:53281', 'https': 'https://196.43.235.238:53281'}
flightradar24.Api(proxies=proxies)
@staticmethod | new proxy server defined for travisci | mkorkmaz_flightradar24 | train | py |
a079da5d86c6a21e40b7678a44366f0e51eec638 | diff --git a/platform/android/build/android_tools.rb b/platform/android/build/android_tools.rb
index <HASH>..<HASH> 100644
--- a/platform/android/build/android_tools.rb
+++ b/platform/android/build/android_tools.rb
@@ -208,7 +208,8 @@ def get_addon_classpath(addon_pattern, apilevel = nil)
unless found_classpath
msg = "No Android SDK add-on found: #{addon_pattern}"
msg += "; API level: #{apilevel}" if apilevel
- raise msg
+
+ @@logger.warn msg
end
if USE_TRACES | don't break build if Google APIs not found | rhomobile_rhodes | train | rb |
a8474ed6d3c70db79740c42753d991f663aab431 | diff --git a/discord/guild.py b/discord/guild.py
index <HASH>..<HASH> 100644
--- a/discord/guild.py
+++ b/discord/guild.py
@@ -1116,6 +1116,13 @@ class Guild(Hashable):
:class:`AuditLogEntry`
The audit log entry.
+ Raises
+ -------
+ Forbidden
+ You are not allowed to fetch audit logs
+ HTTPException
+ An error occurred while fetching the audit logs.
+
Examples
---------- | Document that exceptions happen in Guild.audit_logs. | Rapptz_discord.py | train | py |
f0ecebaa763816a48d09d20fc4775b882ae956ad | diff --git a/lib/after_do.rb b/lib/after_do.rb
index <HASH>..<HASH> 100644
--- a/lib/after_do.rb
+++ b/lib/after_do.rb
@@ -38,10 +38,6 @@ module AfterDo
end
private
- def _after_do_callbacks
- @_after_do_callbacks
- end
-
def _after_do_define_callback(type, methods, block)
@_after_do_callbacks ||= _after_do_basic_hash
methods = methods.flatten #in case someone used an Array
@@ -107,7 +103,7 @@ module AfterDo
end
def _after_do_execute_callbacks(type, method, object, *args)
- _after_do_callbacks[type][method].each do |block|
+ @_after_do_callbacks[type][method].each do |block|
_after_do_execute_callback(block, method, object, *args)
end
end | Actually we do not need the the accessor anymore at all - jay | PragTob_after_do | train | rb |
6e5256228951976682777bd1f35dd954eadd8ffb | diff --git a/paperpress.js b/paperpress.js
index <HASH>..<HASH> 100644
--- a/paperpress.js
+++ b/paperpress.js
@@ -40,7 +40,7 @@ Paperpress.prototype._getCollections = function(){
})
return collections
} catch (e) {
- // console.error('[Paperpress] ERROR - Can\'t read directory:', this.baseDirectory)
+ console.error('[Paperpress] ERROR - Can\'t read directory:', this.baseDirectory)
}
} | Error when directory is not found | Siedrix_paperpress | train | js |
3c50724d247e8dc163c25405cdfbffe03510b6c7 | diff --git a/lib/proxies/dom.js b/lib/proxies/dom.js
index <HASH>..<HASH> 100644
--- a/lib/proxies/dom.js
+++ b/lib/proxies/dom.js
@@ -192,10 +192,12 @@ function DomProxy(raja, opts) {
var h = this;
raja.retrieve(inst.user.url, req, function(err, resource) {
if (err) return cb(err);
- if (!resource) resource = raja.create(inst.user, req).save();
+ if (!resource) resource = raja.create(inst.user, res);
inst.user = resource;
if (!resource.headers) resource.headers = {};
+ resource.headers['Content-Type'] = 'text/html';
if (!resource.resources) resource.resources = {};
+ resource.save();
if (inst.page && inst.live && !inst.reloads) {
inst.page.locked = true;
inst.output(inst.page, function(err, str) {
@@ -219,7 +221,6 @@ function DomProxy(raja, opts) {
if (!resource.itime || resource.itime <= resource.mtime) {
resource.valid = true;
resource.mtime = new Date();
- resource.headers['Content-Type'] = 'text/html';
resource.save();
} else if (!resource.mtime) {
resource.mtime = new Date(); | Make sure Content-Type is set when building key in dom proxy | kapouer_raja | train | js |
2847f9bdb62ca351e3c801d4fc0bba335e67b723 | diff --git a/src/game.js b/src/game.js
index <HASH>..<HASH> 100644
--- a/src/game.js
+++ b/src/game.js
@@ -299,7 +299,7 @@
isDirty = api.viewport.update(updateDelta) || isDirty;
me.timer.lastUpdate = window.performance.now();
- updateAverageDelta = (updateAverageDelta * 2/3) + ( (me.timer.lastUpdate - lastUpdateStart) * 1/3 );
+ updateAverageDelta = me.timer.lastUpdate - lastUpdateStart;
accumulator -= accumulatorUpdateDelta;
if (me.sys.interpolation) { | Removed update delta averaging... seemed to only cause lag problems | melonjs_melonJS | train | js |
4568cdfb0199429b54f272ca1da4694b3e94f94f | diff --git a/lib/metamorpher/builders/ast/builder.rb b/lib/metamorpher/builders/ast/builder.rb
index <HASH>..<HASH> 100644
--- a/lib/metamorpher/builders/ast/builder.rb
+++ b/lib/metamorpher/builders/ast/builder.rb
@@ -2,6 +2,7 @@ require "metamorpher/builders/ast/literal_builder"
require "metamorpher/builders/ast/variable_builder"
require "metamorpher/builders/ast/greedy_variable_builder"
require "metamorpher/builders/ast/derivation_builder"
+require "forwardable"
module Metamorpher
module Builders
diff --git a/spec/integration/ruby/refactorer_spec.rb b/spec/integration/ruby/refactorer_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/integration/ruby/refactorer_spec.rb
+++ b/spec/integration/ruby/refactorer_spec.rb
@@ -1,4 +1,5 @@
require "metamorpher"
+require "tempfile"
describe "Refactorer" do
describe "for Ruby" do | Fix dependencies on components that are no longer in Ruby core. | ruby-mutiny_metamorpher | train | rb,rb |
5cab9a6b61c262b66b4d0c5b9f12e36630b75675 | diff --git a/tests/db/models_test.py b/tests/db/models_test.py
index <HASH>..<HASH> 100644
--- a/tests/db/models_test.py
+++ b/tests/db/models_test.py
@@ -549,7 +549,6 @@ class GmfSetIterTestCase(unittest.TestCase):
self.assertTrue(equal, error)
-
@attr('slow')
def test_iter(self):
# Test data | tests/db/models_test:
pep8 | gem_oq-engine | train | py |
ceb65862afd30aa5b15cb78daf34b8120a82ae0a | diff --git a/assertpy/__init__.py b/assertpy/__init__.py
index <HASH>..<HASH> 100644
--- a/assertpy/__init__.py
+++ b/assertpy/__init__.py
@@ -1 +1 @@
-from assertpy import assert_that, contents_of, fail
+from assertpy import assert_that, contents_of, fail, __version__
diff --git a/assertpy/assertpy.py b/assertpy/assertpy.py
index <HASH>..<HASH> 100644
--- a/assertpy/assertpy.py
+++ b/assertpy/assertpy.py
@@ -28,6 +28,8 @@
"""Fluent assertion framework for better, more readable tests."""
+__version__ = '0.5'
+
import re
import os
import datetime | added version string, <I> | ActivisionGameScience_assertpy | train | py,py |
0b8d1ccf6c813dfbf2dfe080a483e8eaaad45eba | diff --git a/pygccxml/utils/utils.py b/pygccxml/utils/utils.py
index <HASH>..<HASH> 100644
--- a/pygccxml/utils/utils.py
+++ b/pygccxml/utils/utils.py
@@ -155,7 +155,7 @@ def remove_file_no_raise(file_name, config):
try:
if os.path.exists(file_name):
os.remove(file_name)
- except Exception as error:
+ except IOError as error:
loggers.root.error(
"Error occurred while removing temporary created file('%s'): %s",
file_name, str(error)) | Catch IOError instead of all Exceptions | gccxml_pygccxml | train | py |
f55ac51152d8206e30f9a0a12cf3bac6019b135d | diff --git a/src/FormComponents/index.js b/src/FormComponents/index.js
index <HASH>..<HASH> 100644
--- a/src/FormComponents/index.js
+++ b/src/FormComponents/index.js
@@ -220,7 +220,11 @@ export const renderBlueprintCheckbox = props => {
label={label}
onChange={function(e, val) {
input.onChange(e, val);
- onFieldSubmit(e.target ? e.target.value : val);
+ let valToUse = val;
+ if (e.target) {
+ valToUse = e.target.value !== "false";
+ }
+ onFieldSubmit(valToUse);
}}
/>
); | fixing CheckboxField's onFieldSubmit | TeselaGen_teselagen-react-components | train | js |
cac972dab73673d4d5e7e5a43873c55f7af04f6f | diff --git a/hotdoc/core/extension.py b/hotdoc/core/extension.py
index <HASH>..<HASH> 100644
--- a/hotdoc/core/extension.py
+++ b/hotdoc/core/extension.py
@@ -392,6 +392,8 @@ class Extension(Configurable):
for source_file, symbols in list(self._created_symbols.items()):
gen_symbols = symbols - user_symbols
+ if not gen_symbols:
+ continue
self.__add_subpage(tree, index, source_file, gen_symbols)
tree.stale_symbol_pages(symbols) | extension: no need to generate a page with no symbols | hotdoc_hotdoc | train | py |
8710de7648160b5b80ef243aaaccfcdcaddd4939 | diff --git a/ghproxy/ghcache/ghcache.go b/ghproxy/ghcache/ghcache.go
index <HASH>..<HASH> 100644
--- a/ghproxy/ghcache/ghcache.go
+++ b/ghproxy/ghcache/ghcache.go
@@ -192,6 +192,7 @@ func (u upstreamTransport) RoundTrip(req *http.Request) (*http.Response, error)
apiVersion := "v3"
if strings.HasPrefix(req.URL.Path, "graphql") || strings.HasPrefix(req.URL.Path, "/graphql") {
+ resp.Header.Set("Cache-Control", "no-store")
apiVersion = "v4"
} | Ensure ghproxy not to use cache for github v4 api
github api v4 [1] has different limit from v3 and the mechanism used
in our caching for v3 does not apply any more.
More specifically, headers like `If-None-Match`, or `If-Modified-Since` [2]
are not mentioned in the v4 doc [1].
[1]. <URL> | kubernetes_test-infra | train | go |
ddfb7f668bf6e96beea79ced67260c7896b60ec4 | diff --git a/netmiko/base_connection.py b/netmiko/base_connection.py
index <HASH>..<HASH> 100644
--- a/netmiko/base_connection.py
+++ b/netmiko/base_connection.py
@@ -209,7 +209,11 @@ class BaseConnection(object):
self.remote_conn.write(write_bytes(out_data))
else:
raise ValueError("Invalid protocol specified")
- log.debug("write_channel: {}".format(write_bytes(out_data)))
+ try:
+ log.debug("write_channel: {}".format(write_bytes(out_data)))
+ except UnicodeDecodeError:
+ # Don't log non-ASCII characters; this is null characters and telnet IAC
+ pass
def write_channel(self, out_data):
"""Generic handler that will write to both SSH and telnet channel.""" | Fix netmiko logging issue with non-ASCII characters | ktbyers_netmiko | train | py |
70363330b0bd30c5e809921be4d6d36fb208f06e | diff --git a/lib/action_subscriber/middleware/error_handler.rb b/lib/action_subscriber/middleware/error_handler.rb
index <HASH>..<HASH> 100644
--- a/lib/action_subscriber/middleware/error_handler.rb
+++ b/lib/action_subscriber/middleware/error_handler.rb
@@ -8,26 +8,10 @@ module ActionSubscriber
end
def call(env)
- job_mutex = ::Mutex.new
- job_complete = ::ConditionVariable.new
-
- job_mutex.synchronize do
- ::Thread.new do
- job_mutex.synchronize do
- begin
- @app.call(env)
- rescue => error
- logger.error "FAILED #{env.message_id}"
- ::ActionSubscriber.configuration.error_handler.call(error, env.to_h)
- ensure
- job_complete.signal
- end
- end
- end
-
- # TODO we might want to pass a timeout to this wait so we can handle jobs that get frozen
- job_complete.wait(job_mutex)
- end
+ @app.call(env)
+ rescue => error
+ logger.error "FAILED #{env.message_id}"
+ ::ActionSubscriber.configuration.error_handler.call(error, env.to_h)
end
end
end | Remove extra thread in error handler - already in a threadpool | mxenabled_action_subscriber | train | rb |
fb5611780d427cf4eab6a83a9b1cea7694ab68aa | diff --git a/src/Storage/Field/Type/TaxonomyType.php b/src/Storage/Field/Type/TaxonomyType.php
index <HASH>..<HASH> 100644
--- a/src/Storage/Field/Type/TaxonomyType.php
+++ b/src/Storage/Field/Type/TaxonomyType.php
@@ -185,11 +185,11 @@ class TaxonomyType extends JoinTypeBase
switch ($platform) {
case 'mysql':
- return "GROUP_CONCAT($column ORDER BY $order ASC) as $alias";
+ return "GROUP_CONCAT($column ORDER BY $order ASC SEPARATOR '|') as $alias";
case 'sqlite':
- return "GROUP_CONCAT($column) as $alias";
+ return "GROUP_CONCAT($column, '|') as $alias";
case 'postgresql':
- return "string_agg($column" . "::character varying, ',' ORDER BY $order) as $alias";
+ return "string_agg($column" . "::character varying, '|' ORDER BY $order) as $alias";
}
throw new StorageException(sprintf('Unsupported platform: %s', $platform)); | change separator character on taxonomy queries | bolt_bolt | train | php |
9bd51d870f6529f5e1b5466bab04d9cded728c33 | diff --git a/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/OrientationListnerService.java b/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/OrientationListnerService.java
index <HASH>..<HASH> 100644
--- a/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/OrientationListnerService.java
+++ b/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/OrientationListnerService.java
@@ -14,6 +14,7 @@ public class OrientationListnerService extends Service{
mOrientationListener = new OrientationEventListener(this) {
@Override
public void onOrientationChanged(int rotation) {
+ if(rotation != -1){
if(rotation >=315 && rotation < 45){
mRotation = 0;
}else if(rotation >=45 && rotation < 135){
@@ -26,6 +27,7 @@ public class OrientationListnerService extends Service{
mRotation = 0;
}
}
+ }
};
}
@Override | Samsung device preview Rotation issue fix
Samsung device preview Rotation issue fix | rhomobile_rhodes | train | java |
ff130638a5370a5be5bad4a295b1441ccb03a42f | diff --git a/components/place-under-ng/place-under-ng.js b/components/place-under-ng/place-under-ng.js
index <HASH>..<HASH> 100644
--- a/components/place-under-ng/place-under-ng.js
+++ b/components/place-under-ng/place-under-ng.js
@@ -1,5 +1,5 @@
/**
- * @name Auth
+ * @name Place Under Ng
* @fileoverview This directive is a helper. Element with rg-place-under=".some-selector"
* attribute will be manually positioned under the provided element. Target element
* position should be 'absolute' | RG-<I> fix wrong named place-under-ng
Former-commit-id: <I>a<I>bdd4ed1f<I>a8b<I>b<I>ed<I>dbd6 | JetBrains_ring-ui | train | js |
64df10722d39949ad626f04e11b7448b3e45c007 | diff --git a/core/AssetManager.php b/core/AssetManager.php
index <HASH>..<HASH> 100644
--- a/core/AssetManager.php
+++ b/core/AssetManager.php
@@ -125,6 +125,7 @@ class Piwik_AssetManager
}
$mergedContent = cssmin::minify($mergedContent);
+ $mergedContent = str_replace("\n", "\r\n", $mergedContent);
// Remove the previous file
self::removeMergedAsset(self::MERGED_CSS_FILE);
@@ -233,6 +234,7 @@ class Piwik_AssetManager
$mergedContent = $mergedContent . PHP_EOL . $content;
}
+ $mergedContent = str_replace("\n", "\r\n", $mergedContent);
// Remove the previous file
self::removeMergedAsset(self::MERGED_JS_FILE);
diff --git a/core/Http.php b/core/Http.php
index <HASH>..<HASH> 100644
--- a/core/Http.php
+++ b/core/Http.php
@@ -294,6 +294,7 @@ class Piwik_Http
CURLOPT_USERAGENT => 'Piwik/'.Piwik_Version::VERSION.($userAgent ? " $userAgent" : ''),
CURLOPT_HEADER => false,
CURLOPT_CONNECTTIMEOUT => $timeout,
+// CURLOPT_CAINFO => PIWIK_INCLUDE_PATH . '/core/DataFiles/cacert.pem',
);
@curl_setopt_array($ch, $curl_options); | convert EOL on merged assets to make it more readable on Windows (when debugging)
git-svn-id: <URL> | matomo-org_matomo | train | php,php |
3fe044b7d2a031204664edf3e6777e3d7691b557 | diff --git a/lib/server.js b/lib/server.js
index <HASH>..<HASH> 100644
--- a/lib/server.js
+++ b/lib/server.js
@@ -14,6 +14,10 @@ var url = require("url");
module.exports = function() {
// A server object.
var self = new events.EventEmitter();
+ // A repository of sockets consisting of opened socket and closed socket
+ // only. A socket has id but it doesn't need to be public now so that array
+ // is used to hide it. TODO
+ self.sockets = [];
// Options to configure server and client.
var options = {
// A heartbeat interval in milliseconds.
@@ -32,9 +36,17 @@ module.exports = function() {
// A link between Cettia protocol and Cettia transport protocol. `transport` is
// expected to be passed from Cettia transport server.
self.handle = function(transport) {
- // Builds a socket on top of a transport and fires `socket` event to
- // server.
- self.emit("socket", createSocket(transport, options));
+ // Builds a socket on top of a transport
+ var socket = createSocket(transport, options);
+ // TODO
+ self.sockets.push(socket);
+ socket.on("close", function() {
+ // It equals to `self.sockets.remove(socket)`.
+ self.sockets.splice(self.sockets.indexOf(socket), 1);
+ });
+ // Fires `socket` event to server. This is the beginning of the socket
+ // life cycle.
+ self.emit("socket", socket);
};
return self;
}; | Add a repository for sockets to server #1 | cettia_cettia-protocol | train | js |
8ad9c96e0ca9c5dc2473d55da5187a3856f0797e | diff --git a/test/acceptance/index-test.js b/test/acceptance/index-test.js
index <HASH>..<HASH> 100644
--- a/test/acceptance/index-test.js
+++ b/test/acceptance/index-test.js
@@ -353,7 +353,7 @@ describe('Acceptance', function() {
before(function() {
this.timeout(10 * 60 * 1000);
- init(true, false);
+ init(false, false);
copyFixtures(getFastbootFixtureName, getClientFixtureName); | don't earlyReturn on CI, too many issues | kellyselden_fastboot-pool | train | js |
d55ccad4fbd0b9587a8aafe009c815879bca0529 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -277,6 +277,7 @@ AwsHelper.Logger = function (tags) {
return log;
};
+/* istanbul ignore next */
process.on('uncaughtException', function (err) {
var log = AwsHelper.log;
if (Object.keys(AwsHelper.log).length === 0) { | Ignore difficult to test code block | numo-labs_aws-lambda-helper | train | js |
1a1f1760af6d2e9004742ec373af420d2656694a | diff --git a/drf_haystack/filters.py b/drf_haystack/filters.py
index <HASH>..<HASH> 100644
--- a/drf_haystack/filters.py
+++ b/drf_haystack/filters.py
@@ -10,7 +10,6 @@ from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from haystack.utils.geo import D, Point
-from haystack.backends.elasticsearch_backend import ElasticsearchSearchBackend
from rest_framework.filters import BaseFilterBackend
@@ -149,7 +148,7 @@ class HaystackGEOSpatialFilter(HaystackFilter):
latitude, longitude = map(float, filters["from"].split(","))
point = Point(longitude, latitude, srid=getattr(settings, "GEO_SRID", 4326))
if point and distance:
- if isinstance(queryset.query.backend, ElasticsearchSearchBackend):
+ if queryset.query.backend.__class__.__name__ == "ElasticsearchSearchBackend":
# TODO: Make sure this is only applied if using a malfunction elasticsearch backend!
# NOTE: https://github.com/toastdriven/django-haystack/issues/957
# FIXME: Remove when upstream haystack bug is resolved | Avoid `MissingDependency` when using another search backend than Elasticsearch.
Fixed #3 | inonit_drf-haystack | train | py |
5c679e608c72227ba4d042b5c784b491ad491def | diff --git a/src/txkube/test/test_authentication.py b/src/txkube/test/test_authentication.py
index <HASH>..<HASH> 100644
--- a/src/txkube/test/test_authentication.py
+++ b/src/txkube/test/test_authentication.py
@@ -351,11 +351,11 @@ class ChainTests(TestCase):
BasicConstraints(True, None),
critical=True,
)
- return builder.public_key(a_key.public_key(),
+ return builder.public_key(pubkey,
).serial_number(1,
).not_valid_before(datetime.utcnow(),
).not_valid_after(datetime.utcnow() + timedelta(seconds=1),
- ).sign(a_key, SHA256(), default_backend(),
+ ).sign(privkey, SHA256(), default_backend(),
)
a_cert = cert(u"a.invalid", u"a.invalid", a_key.public_key(), a_key, True) | Ensure generated certificates use provided key arguments.
The cert function takes as parameters a public key to include in the
cert, and a private key to sign the cert. Currently, both are always the
root key, which deviates from the arguments supplied to cert later in
the test.
Discussed on twisted-web:
<URL> | LeastAuthority_txkube | train | py |
2dbe684ae088104b3aa75328a9c1ebd11ca527d1 | diff --git a/src/authorize.js b/src/authorize.js
index <HASH>..<HASH> 100644
--- a/src/authorize.js
+++ b/src/authorize.js
@@ -40,7 +40,6 @@
if(params) {
document.location.hash = '';
}
- console.log("found Params : ", params);
remoteStorage.on('features-loaded', function() {
if(params) {
if(params.access_token) { | removed logging from RemoteStorage.Authorize | remotestorage_remotestorage.js | train | js |
fef583012aff0278dbd1e1e9fbb4048a5768dd29 | diff --git a/spec/support/bosh_runner.rb b/spec/support/bosh_runner.rb
index <HASH>..<HASH> 100644
--- a/spec/support/bosh_runner.rb
+++ b/spec/support/bosh_runner.rb
@@ -36,10 +36,8 @@ module Bosh::Spec
exit_code = 0
time = Benchmark.realtime do
- Open3.popen2(env, command, {:err => [:child, :out]}) do |_, stdout, wait_thr|
- output = stdout.read
- exit_code = wait_thr.value
- end
+ output, _, process_status = Open3.capture3(env, command, {:err => [:child, :out]})
+ exit_code = process_status.exitstatus
end
@logger.info "Exit code is #{exit_code}" | Properly save exit status in integration tests | cloudfoundry_bosh | train | rb |
eb3016bd2d96d2ef3622bbc8ebad75a9326bee9b | diff --git a/server/plugins/clusterauth/jwtauth.routes.js b/server/plugins/clusterauth/jwtauth.routes.js
index <HASH>..<HASH> 100644
--- a/server/plugins/clusterauth/jwtauth.routes.js
+++ b/server/plugins/clusterauth/jwtauth.routes.js
@@ -4,7 +4,7 @@ module.exports = function (server, conf) {
var handlers = require('./jwtauth.handlers')(server, conf);
var Joi = require('joi');
- var clustermodel = require('../clustermodel');
+ var clustermodel = require('clustermodel');
server.auth.strategy('token', 'jwt', {
key: conf.privateKey,
diff --git a/server/plugins/clusterprovider/dataprovider.routes.js b/server/plugins/clusterprovider/dataprovider.routes.js
index <HASH>..<HASH> 100644
--- a/server/plugins/clusterprovider/dataprovider.routes.js
+++ b/server/plugins/clusterprovider/dataprovider.routes.js
@@ -4,7 +4,7 @@ module.exports = function (server, conf) {
var handlers = require('./dataprovider.handlers')(server, conf);
var Joi = require('joi');
- var clustermodel = require('../clustermodel');
+ var clustermodel = require('clustermodel');
server.route({
path: '/dataprovider', | STYLE: Use the package clustermodel instead of the relative path | juanprietob_clusterpost | train | js,js |
257f20358a146e8e1b3da16f85bcd5b526d12951 | diff --git a/shared/actions/wallets.js b/shared/actions/wallets.js
index <HASH>..<HASH> 100644
--- a/shared/actions/wallets.js
+++ b/shared/actions/wallets.js
@@ -266,7 +266,11 @@ const createPaymentsReceived = (accountID, payments, pending) =>
const loadPayments = (state, action) =>
!actionHasError(action) &&
- (action.type === WalletsGen.selectAccount ||
+ (!!(
+ action.type === WalletsGen.selectAccount &&
+ action.payload.accountID &&
+ action.payload.accountID !== Types.noAccountID
+ ) ||
Constants.getAccount(state, action.payload.accountID).accountID !== Types.noAccountID) &&
Promise.all([
RPCStellarTypes.localGetPendingPaymentsLocalRpcPromise({accountID: action.payload.accountID}), | check accountID when selecting account before loading payments (#<I>) | keybase_client | train | js |
061110e9a06a3963adf986e5c74c6b70d4e64bb4 | diff --git a/lib/puppet/version.rb b/lib/puppet/version.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/version.rb
+++ b/lib/puppet/version.rb
@@ -6,7 +6,7 @@
# Raketasks and such to set the version based on the output of `git describe`
module Puppet
- PUPPETVERSION = '4.10.12'
+ PUPPETVERSION = '4.10.13'
##
# version is a public API method intended to always provide a fast and | (packaging) Bump to version '<I>' [no-promote] | puppetlabs_puppet | train | rb |
4365b16811300622ef17c079e010c776bf9eb793 | diff --git a/php/utils.php b/php/utils.php
index <HASH>..<HASH> 100644
--- a/php/utils.php
+++ b/php/utils.php
@@ -8,8 +8,8 @@ use \WP_CLI\Dispatcher;
function load_dependencies() {
$vendor_paths = array(
- WP_CLI_ROOT . '../../../../vendor', // part of a larger project
WP_CLI_ROOT . '../vendor', // top-level project
+ WP_CLI_ROOT . '../../../../vendor', // part of a larger project
);
$has_autoload = false;
@@ -18,7 +18,6 @@ function load_dependencies() {
if ( file_exists( $vendor_path . '/autoload.php' ) ) {
require $vendor_path . '/autoload.php';
$has_autoload = true;
- break;
}
} | autoload from local vendor dir, then from global
This allows running `composer update` on the spot and without switching the wp-cli repo
back to the master branch.
This also allows using suggested packages from a super-project (most
common being ~/.composer). | wp-cli_export-command | train | php |
4cc187703bdb037085bdfbf4b0167b5c9f4bb284 | diff --git a/tagflag.go b/tagflag.go
index <HASH>..<HASH> 100644
--- a/tagflag.go
+++ b/tagflag.go
@@ -344,7 +344,7 @@ func (p *parser) addAny(cmd *command, fv reflect.Value, sf reflect.StructField)
case "pos":
p.addArg(cmd, fv, sf)
default:
- if fv.Kind() == reflect.Struct {
+ if fv.Kind() == reflect.Struct && unsettableType(fv.Type()) != nil {
name := sf.Tag.Get("name")
if name == "" {
name = sf.Name | Fix handling of non-pointer custom types | anacrolix_tagflag | train | go |
f6c668239c47afa861d49c00a4e02a2a4226d431 | diff --git a/doc/index.php b/doc/index.php
index <HASH>..<HASH> 100644
--- a/doc/index.php
+++ b/doc/index.php
@@ -36,15 +36,19 @@
}
?>
-
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php print_string("documentation")?></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=<?php print_string("thischarset") ?>" />
</head>
<frameset rows="70,*">
- <frame name="top" src="top.php">
+ <frame name="top" src="top.php" />
<frameset cols="200,*">
- <frame name="contents" src="contents.php">
- <frame name="main" src="index.php?file=<?php echo "$file$sub"; ?>">
+ <frame name="contents" src="contents.php" />
+ <frame name="main" src="index.php?file=<?php echo "$file$sub"; ?>" />
</frameset>
</frameset>
+</html> | Some changes added (see bug <I>).
- Added correct encoding.
- Make page XHTML <I> Frameset compliant
Credits go to sunner_sun.
(<URL>)
Merged from MOODLE_<I>_STABLE | moodle_moodle | train | php |
3dd18f9318d6fd9b7d26beac10fa79c2db883e1f | diff --git a/js/jquery.fileupload.js b/js/jquery.fileupload.js
index <HASH>..<HASH> 100644
--- a/js/jquery.fileupload.js
+++ b/js/jquery.fileupload.js
@@ -434,6 +434,13 @@
}
},
+ _deinitProgressListener: function (options) {
+ var xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr();
+ if (xhr.upload) {
+ $(xhr.upload).unbind('progress');
+ }
+ },
+
_isInstanceOf: function (type, obj) {
// Cross-frame instanceof check
return Object.prototype.toString.call(obj) === '[object ' + type + ']';
@@ -812,6 +819,9 @@
o.context,
[jqXHR, textStatus, errorThrown]
);
+ })
+ .always(function () {
+ that._deinitProgressListener(o);
});
};
this._enhancePromise(promise);
@@ -913,6 +923,7 @@
}).fail(function (jqXHR, textStatus, errorThrown) {
that._onFail(jqXHR, textStatus, errorThrown, options);
}).always(function (jqXHRorResult, textStatus, jqXHRorError) {
+ that._deinitProgressListener(options);
that._onAlways(
jqXHRorResult,
textStatus, | Explicit deinitialization of progress listeners.
This addresses a memory leak with Microsoft Edge.
Thanks @butonic for the report, investigation and fix.
Closes #<I> | blueimp_jQuery-File-Upload | train | js |
ac27d43c2e7ecd2009c085e7f65370f14b947839 | diff --git a/src/conversions.php b/src/conversions.php
index <HASH>..<HASH> 100644
--- a/src/conversions.php
+++ b/src/conversions.php
@@ -62,6 +62,32 @@ function toFloat ($val)
return floatval ($val);
}
+/**
+ * Always rounds up (unlike {@see round}).
+ *
+ * @param float|string $number
+ * @param int $precision
+ * @return float|int
+ */
+function round_up ($number, $precision = 0)
+{
+ $fig = (int)str_pad ('1', $precision + 1, '0');
+ return (ceil ((float)$number * $fig) / $fig);
+}
+
+/**
+ * Always rounds down (unlike {@see round}).
+ *
+ * @param float|string $number
+ * @param int $precision
+ * @return float|int
+ */
+function round_down ($number, $precision = 0)
+{
+ $fig = (int)str_pad ('1', $precision + 1, '0');
+ return (floor ((float)$number * $fig) / $fig);
+}
+
function friendlySize ($size, $precision = 0)
{
$units = ['bytes', 'Kb', 'Mb', 'Gb', 'Tb']; | round_up() and round_down() | php-kit_tools | train | php |
7c6f823e725e795214efd9909091a566cf8d3d0d | diff --git a/tests/test_tokenize.py b/tests/test_tokenize.py
index <HASH>..<HASH> 100644
--- a/tests/test_tokenize.py
+++ b/tests/test_tokenize.py
@@ -452,7 +452,7 @@ class TestTokenizePackage(unittest.TestCase):
tltk.syllable_tokenize(
"ฉันรักภาษาไทยเพราะฉันเป็นคนไทย"
),
- ['ฉัน', 'รัก', 'ภาษาไทย', 'เพราะ', 'ฉัน', 'เป็น', 'คน', 'ไทย'],
+ ['ฉัน', 'รัก', 'ภา', 'ษา', 'ไทย', 'เพราะ', 'ฉัน', 'เป็น', 'คน', 'ไทย'],
)
self.assertEqual(tltk.syllable_tokenize(None), [])
self.assertEqual(tltk.syllable_tokenize(""), []) | Update test_tokenize.py | PyThaiNLP_pythainlp | train | py |
883ea24483f2704729e299b0101ad51d3547315f | diff --git a/core/src/test/java/org/bitcoinj/wallet/WalletTest.java b/core/src/test/java/org/bitcoinj/wallet/WalletTest.java
index <HASH>..<HASH> 100644
--- a/core/src/test/java/org/bitcoinj/wallet/WalletTest.java
+++ b/core/src/test/java/org/bitcoinj/wallet/WalletTest.java
@@ -3699,4 +3699,16 @@ public class WalletTest extends TestWithWallet {
assertNull(wallet.findKeyFromAddress(LegacyAddress.fromKey(UNITTEST, p2wpkhKey)));
assertEquals(p2wpkhKey, wallet.findKeyFromAddress(SegwitAddress.fromKey(UNITTEST, p2wpkhKey)));
}
+
+ @Test
+ public void roundtripViaMnemonicCode() {
+ Wallet wallet = Wallet.createDeterministic(UNITTEST, Script.ScriptType.P2WPKH);
+ List<String> mnemonicCode = wallet.getKeyChainSeed().getMnemonicCode();
+ final DeterministicSeed clonedSeed = new DeterministicSeed(mnemonicCode, null, "",
+ wallet.getEarliestKeyCreationTime());
+ Wallet clone = Wallet.fromSeed(UNITTEST, clonedSeed, Script.ScriptType.P2WPKH);
+ assertEquals(wallet.currentReceiveKey(), clone.currentReceiveKey());
+ assertEquals(wallet.freshReceiveAddress(Script.ScriptType.P2PKH),
+ clone.freshReceiveAddress(Script.ScriptType.P2PKH));
+ }
} | WalletTest: Add test for roundtripping a wallet via its mnemonic code. | bitcoinj_bitcoinj | train | java |
ef4e046a7c8d55d637fbf2b305ac94e50228179e | diff --git a/SortableGridBehavior.php b/SortableGridBehavior.php
index <HASH>..<HASH> 100644
--- a/SortableGridBehavior.php
+++ b/SortableGridBehavior.php
@@ -53,6 +53,9 @@ class SortableGridBehavior extends Behavior
$i = 0;
foreach ($items as $item) {
/** @var \yii\db\ActiveRecord $row */
+ $item = json_decode($item);
+ if(is_object($item))
+ $item = get_object_vars($item);
$row = $model::findOne($item);
if ($row->{$this->sortableAttribute} != $i) {
$row->updateAttributes([$this->sortableAttribute => $i]); | added json_decode for item | himiklab_yii2-sortable-grid-view-widget | train | php |
88193119d091da3bb537d8469c54b7c188a494b4 | diff --git a/tests/CfdiUtilsTests/Utils/Internal/ShellExecTest.php b/tests/CfdiUtilsTests/Utils/Internal/ShellExecTest.php
index <HASH>..<HASH> 100644
--- a/tests/CfdiUtilsTests/Utils/Internal/ShellExecTest.php
+++ b/tests/CfdiUtilsTests/Utils/Internal/ShellExecTest.php
@@ -2,7 +2,7 @@
namespace CfdiUtilsTests\Utils\Internal;
use CfdiUtils\Utils\Internal\ShellExec;
-use PHPUnit\Framework\TestCase;
+use CfdiUtilsTests\TestCase;
class ShellExecTest extends TestCase
{
@@ -113,6 +113,11 @@ class ShellExecTest extends TestCase
public function testStdinDoesNotLockProcess()
{
+ $currentVersion = sprintf('%s.%s', PHP_MAJOR_VERSION, PHP_MINOR_VERSION);
+ if ($this->isRunningOnWindows() && '7.0' === $currentVersion) {
+ $this->markTestSkipped('This test fail on MS Windows with PHP 7.0');
+ }
+
$printer = implode(PHP_EOL, [
'fgets(STDIN);',
'file_put_contents("php://stdout", "BYE", FILE_APPEND);', | Avoid test where execution result on open stdin on WIN and PHP <I> | eclipxe13_CfdiUtils | 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.