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
4c5bbb12bb6a15c582272d481fb05ad66fafa48b
diff --git a/mcc/core.py b/mcc/core.py index <HASH>..<HASH> 100755 --- a/mcc/core.py +++ b/mcc/core.py @@ -32,7 +32,7 @@ import mcc.uimode as ui import os import sys -__version__ = "0.1.0" +__version__ = "0.1.1" def main(): diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -64,7 +64,7 @@ setup( package_data={'mcc': ['config.ini']}, entry_points={'console_scripts': ['mcc=mcc.core:main', 'mccl=mcc.core:list_only']}, - version='0.1.0', + version='0.1.1', author="Robert Peteuil", author_email="[email protected]", url='https://github.com/robertpeteuil/multi-cloud-control',
bumped version to <I>
robertpeteuil_multi-cloud-control
train
py,py
62132262c6f663bdef557331a0fe9191ec4b482c
diff --git a/runtime/classes/propel/Propel.php b/runtime/classes/propel/Propel.php index <HASH>..<HASH> 100644 --- a/runtime/classes/propel/Propel.php +++ b/runtime/classes/propel/Propel.php @@ -171,7 +171,6 @@ class Propel 'PropelColumnTypes' => 'propel/util/PropelColumnTypes.php', 'PropelPDO' => 'propel/util/PropelPDO.php', 'PropelPager' => 'propel/util/PropelPager.php', - 'Transaction' => 'propel/util/Transaction.php', 'BasicValidator' => 'propel/validator/BasicValidator.php', 'MatchValidator' => 'propel/validator/MatchValidator.php',
transaction is no longer in the source tree
propelorm_Propel
train
php
631c843ed179ff6aafaad93d1263468d7fc87b2f
diff --git a/spacy/lemmatizer.py b/spacy/lemmatizer.py index <HASH>..<HASH> 100644 --- a/spacy/lemmatizer.py +++ b/spacy/lemmatizer.py @@ -15,7 +15,7 @@ class Lemmatizer(object): def from_dir(cls, data_dir): index = {} exc = {} - for pos in ['adj', 'adv', 'noun', 'verb']: + for pos in ['adj', 'noun', 'verb']: index[pos] = read_index(path.join(data_dir, 'wordnet', 'index.%s' % pos)) exc[pos] = read_exc(path.join(data_dir, 'wordnet', '%s.exc' % pos)) rules = json.load(open(path.join(data_dir, 'vocab', 'lemma_rules.json')))
* Don't look for index.adv in le,matizer
explosion_spaCy
train
py
adb4ad3f7fc45612612df896eaee28948f9e5b2a
diff --git a/src/input/TextareaInput.js b/src/input/TextareaInput.js index <HASH>..<HASH> 100644 --- a/src/input/TextareaInput.js +++ b/src/input/TextareaInput.js @@ -264,6 +264,7 @@ export default class TextareaInput { onContextMenu(e) { let input = this, cm = input.cm, display = cm.display, te = input.textarea + if (input.contextMenuPending) input.contextMenuPending() let pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop if (!pos || presto) return // Opera is difficult. @@ -287,7 +288,7 @@ export default class TextareaInput { display.input.reset() // Adds "Select all" to context menu in FF if (!cm.somethingSelected()) te.value = input.prevInput = " " - input.contextMenuPending = true + input.contextMenuPending = rehide display.selForContextMenu = cm.doc.sel clearTimeout(display.detectingSelectAll) @@ -308,6 +309,7 @@ export default class TextareaInput { } } function rehide() { + if (input.contextMenuPending != rehide) return input.contextMenuPending = false input.wrapper.style.cssText = oldWrapperCSS te.style.cssText = oldCSS
Fix issue in IE where the context menu hack might stay visible Because JS seems to be frozen entirely while the context menu is open, the next open might happen before the timeout was able to fire. This forces the previous context menu kludge to be cleared before starting a new one.
codemirror_CodeMirror
train
js
246714c0595f981262101d7d367bed7bfca9dfbd
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ script_files = [] if os.name == "nt": pyang_bat_file = "{}/{}.bat".format(tempfile.gettempdir(), "pyang") with open(pyang_bat_file, 'w') as script: - script.write('@echo off\npython %cd%\pyang %*\n') + script.write('@echo off\npython %~dp0pyang %*\n') script_files = ['bin/pyang', 'bin/yang2html', 'bin/yang2dsdl', 'bin/json2xml', pyang_bat_file] else: script_files = ['bin/pyang', 'bin/yang2html', 'bin/yang2dsdl', 'bin/json2xml']
fixing pyang.bat on Windows The "%cd%" in the pyang.bat script returned the current working directory - hence the path "%cd%\pyang" pointed mostly to an non existing file. The new "%~dp0" returns the current directory location of the pyang.bat itself - that should the the same directory where the "pyang" file is installed.
mbj4668_pyang
train
py
8b613636ac01572101ec9bb806d5c09cb65d894a
diff --git a/sos/plugins/openssl.py b/sos/plugins/openssl.py index <HASH>..<HASH> 100644 --- a/sos/plugins/openssl.py +++ b/sos/plugins/openssl.py @@ -23,6 +23,17 @@ class OpenSSL(Plugin): plugin_name = "openssl" packages = ('openssl',) + def postproc(self): + protect_keys = ["input_password", + "output_password", + "challengePassword"] + + regexp = r"(?m)^(\s*#?\s*(%s).*=)(.*)" % "|".join(protect_keys) + + self.do_file_sub('/etc/ssl/openssl.cnf', + regexp, + r"\1 ******") + class RedHatOpenSSL(OpenSSL, RedHatPlugin): """openssl related information for Red Hat distributions """
Scrub credentials from openssl plugin
sosreport_sos
train
py
9c160e902728f72667f328718cc82659e63b5811
diff --git a/camxes/__init__.py b/camxes/__init__.py index <HASH>..<HASH> 100644 --- a/camxes/__init__.py +++ b/camxes/__init__.py @@ -54,7 +54,7 @@ class NodeBase(Node): @property def lojban(self): - sep = '' if self.find('spaces') else ' ' + sep = '' if self.find('*[Ss]paces') else ' ' return sep.join(self.leafs) @property
Detect spaces better with .lojban
lojban_python-camxes
train
py
14b9dc78d143d0e460faacc0d7e887c01cd2cdca
diff --git a/dbaas_zabbix/provider.py b/dbaas_zabbix/provider.py index <HASH>..<HASH> 100755 --- a/dbaas_zabbix/provider.py +++ b/dbaas_zabbix/provider.py @@ -71,7 +71,10 @@ class ZabbixProvider(object): def get_host_id(self, host_name): host_info = self._get_host_info(search={'name': host_name}) - return host_info[0]['hostid'] + for host in host_info: + if host['name'] == host_name: + return host['hostid'] + return None def get_host_interface_id(self, host_id): host_interface = self.api.hostinterface.get(hostids=host_id)
Get host id, handling with many hosts with similar name
globocom_dbaas-zabbix
train
py
7c6940b683d8e21ab8d781b6f9eac035e5ad5ed7
diff --git a/src/imagesready.js b/src/imagesready.js index <HASH>..<HASH> 100644 --- a/src/imagesready.js +++ b/src/imagesready.js @@ -25,7 +25,7 @@ function ImagesReady(elements, options) { if (typeof elements === 'string') { elements = document.querySelectorAll(elements); if (!elements.length) { - throw new Error('0 elements were found using selector `'+ elements +'`'); + throw new Error('0 elements were found using selector `' + elements + '`'); } }
Format for eslint compliance
r-park_images-ready
train
js
d447c221ebe331efc516c2f4efc2016262042aed
diff --git a/structr-core/src/main/java/org/structr/schema/compiler/RemoveClassesWithUnknownSymbols.java b/structr-core/src/main/java/org/structr/schema/compiler/RemoveClassesWithUnknownSymbols.java index <HASH>..<HASH> 100644 --- a/structr-core/src/main/java/org/structr/schema/compiler/RemoveClassesWithUnknownSymbols.java +++ b/structr-core/src/main/java/org/structr/schema/compiler/RemoveClassesWithUnknownSymbols.java @@ -47,7 +47,7 @@ public class RemoveClassesWithUnknownSymbols implements MigrationHandler { final Matcher matcher = PATTERN.matcher(detail); if (matcher.matches()) { - logger.warn(errorToken.toJSON().getAsString()); + logger.warn(errorToken.toJSON().toString()); /*
Bugfix: Replace unsupported operation "getAsString" with "toString"
structr_structr
train
java
5bc0f7593b9d87c948937ade380da726c41bb634
diff --git a/examples/websocket/websocket.go b/examples/websocket/websocket.go index <HASH>..<HASH> 100644 --- a/examples/websocket/websocket.go +++ b/examples/websocket/websocket.go @@ -27,7 +27,7 @@ func main() { fmt.Println("Infos:", ev.Info) fmt.Println("Connection counter:", ev.ConnectionCount) // Replace C2147483705 with your Channel ID - rtm.SendMessage(rtm.NewOutgoingMessage("Hello world", "C2147483705")) + rtm.SendMessage(rtm.NewOutgoingMessage("Hello world", "C2147483705", "")) case *slack.MessageEvent: fmt.Printf("Message: %v\n", ev)
small fix in order to pass build test
nlopes_slack
train
go
a1d18d70cce221db5be38530ab6853dd2124cab7
diff --git a/spec/support/cache_helper.rb b/spec/support/cache_helper.rb index <HASH>..<HASH> 100644 --- a/spec/support/cache_helper.rb +++ b/spec/support/cache_helper.rb @@ -48,7 +48,8 @@ module CacheHelper def cache_dir @cache_dir ||= begin project_root = File.expand_path(File.join(File.dirname(__FILE__), '..', '..')) - cache_dir = File.join(project_root, 'tmp', 'spec_cache') + ruby_version = "#{RUBY_ENGINE}#{RUBY_VERSION}" + cache_dir = File.join(project_root, 'tmp', 'spec_cache', ruby_version) unless Dir.exist?(cache_dir) require 'fileutils'
Separate spec cache directory for each Ruby version
yujinakayama_transpec
train
rb
99a971f11c07fe7581634a38349eb00c0dd5cbff
diff --git a/lib/biz.rb b/lib/biz.rb index <HASH>..<HASH> 100644 --- a/lib/biz.rb +++ b/lib/biz.rb @@ -31,7 +31,8 @@ module Biz private def schedule - Thread.current[:biz_schedule] or fail "#{name} not configured" + Thread.current[:biz_schedule] or + fail Error::Configuration, "#{name} not configured" end end diff --git a/spec/biz_spec.rb b/spec/biz_spec.rb index <HASH>..<HASH> 100644 --- a/spec/biz_spec.rb +++ b/spec/biz_spec.rb @@ -114,7 +114,9 @@ RSpec.describe Biz do before do Thread.current[:biz_schedule] = nil end it 'fails hard' do - expect { described_class.intervals }.to raise_error RuntimeError + expect { + described_class.intervals + }.to raise_error Biz::Error::Configuration end end end
Use custom error when gem not configured The generic `RuntimeError` was being raised when using `biz` before it is configured. Since we have a more descriptive configuration error, we should use it.
zendesk_biz
train
rb,rb
809e43934eff72cd419f715c5b30aba2e9cd89ce
diff --git a/src/candela/components/Heatmap/test/heatmap.image.js b/src/candela/components/Heatmap/test/heatmap.image.js index <HASH>..<HASH> 100644 --- a/src/candela/components/Heatmap/test/heatmap.image.js +++ b/src/candela/components/Heatmap/test/heatmap.image.js @@ -4,5 +4,6 @@ imageTest({ name: 'heatmap', url: 'http://localhost:28000/examples/heatmap', selector: '#vis-element', + delay: 1000, threshold: 0.001 }); diff --git a/src/candela/components/ScatterPlot/test/scatterplot.image.js b/src/candela/components/ScatterPlot/test/scatterplot.image.js index <HASH>..<HASH> 100644 --- a/src/candela/components/ScatterPlot/test/scatterplot.image.js +++ b/src/candela/components/ScatterPlot/test/scatterplot.image.js @@ -4,6 +4,6 @@ imageTest({ name: 'scatterplot', url: 'http://localhost:28000/examples/scatter', selector: '#vis-element', - delay: 1000, + delay: 2000, threshold: 0.001 });
Try longer delays to allow testing images to settle
Kitware_candela
train
js,js
d143cb72f179307c51a49cc18db304fa15abfff8
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -48,9 +48,9 @@ copyright = u'2012, Team Agiliq' # built documents. # # The short X.Y version. -version = '0.06' +version = '0.07' # The full version, including alpha/beta/rc tags. -release = '0.06' +release = '0.07' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -VERSION = (0, 0, 6, "a", 0) # following PEP 386 +VERSION = (0, 0, 7, "a", 0) # following PEP 386 DEV_N = None import os
Bumped the version in the setup.py and the docs.
agiliq_merchant
train
py,py
ff9ab933b322af53cfba3234530028849eaa7080
diff --git a/builder.go b/builder.go index <HASH>..<HASH> 100644 --- a/builder.go +++ b/builder.go @@ -222,14 +222,10 @@ func (k *kResolver) makeAddresses(e Endpoints) ([]resolver.Address, string) { } for _, address := range subset.Addresses { - sname := k.target.serviceName - if address.TargetRef != nil { - sname = address.TargetRef.Name - } newAddrs = append(newAddrs, resolver.Address{ Type: resolver.Backend, Addr: net.JoinHostPort(address.IP, port), - ServerName: sname, + ServerName: fmt.Sprintf("%s.%s", k.target.serviceName, k.target.serviceNamespace), Metadata: nil, }) }
use service name as server name for tls
sercand_kuberesolver
train
go
cf3caa7d6947229dd857ac61954312741f833587
diff --git a/lhc/binf/genomic_feature.py b/lhc/binf/genomic_feature.py index <HASH>..<HASH> 100644 --- a/lhc/binf/genomic_feature.py +++ b/lhc/binf/genomic_feature.py @@ -46,9 +46,6 @@ class GenomicFeature(Interval): self.stop = max(self.stop, feature.stop) self.children.add(feature) - def add_product(self, feature): - self.products.append(feature) - # Position functions def get_abs_pos(self, pos, partial_rel_pos=0): @@ -81,13 +78,11 @@ class GenomicFeature(Interval): # Sequence functions - def get_sub_seq(self, seq, types=None, depth=0): + def get_sub_seq(self, sequence_set, types=None, depth=0): if len(self.children) == 0: - if isinstance(seq, dict): - seq = seq[self.chr] - res = seq[self.start:self.stop] + res = sequence_set.fetch(self.chr, self.start, self.stop) else: - res = ''.join(child.get_sub_seq(seq, types, depth + 1) for child in self.children + res = ''.join(child.get_sub_seq(sequence_set, types, depth + 1) for child in self.children if types is None or child.type in types) if depth == 0: return res if self.strand == '+' else revcmp(res)
changed genomic_feature get_sub_seq to use a sequence set
childsish_sofia
train
py
e05fbcc1b34d31f9569feeacd5d430e08f421f9a
diff --git a/graphene_django/fields.py b/graphene_django/fields.py index <HASH>..<HASH> 100644 --- a/graphene_django/fields.py +++ b/graphene_django/fields.py @@ -77,6 +77,10 @@ class DjangoConnectionField(ConnectionField): if isinstance(iterable, QuerySet): if iterable is not default_manager: default_queryset = maybe_queryset(default_manager) + if default_queryset.query.distinct and not iterable.query.distinct: + iterable = iterable.distinct() + elif iterable.query.distinct and not default_queryset.query.distinct: + default_queryset = default_queryset.distinct() iterable = cls.merge_querysets(default_queryset, iterable) _len = iterable.count() else: diff --git a/graphene_django/tests/test_query.py b/graphene_django/tests/test_query.py index <HASH>..<HASH> 100644 --- a/graphene_django/tests/test_query.py +++ b/graphene_django/tests/test_query.py @@ -478,7 +478,7 @@ def test_should_query_node_filtering_with_distinct_queryset(): 'films': { 'edges': [{ 'node': { - 'genre': 'ot' + 'genre': 'OT' } }] }
Fix failing unit test by handling cases where a connection is resolved involving a query with inner join and distinct that is then filtered and would be combined with a filtered queryset that is not distinct.
graphql-python_graphene-django
train
py,py
9989c263740d7c8b2d7e3f37128688f08e3498bc
diff --git a/core/src/main/java/com/graphhopper/routing/lm/LandmarkStorage.java b/core/src/main/java/com/graphhopper/routing/lm/LandmarkStorage.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/graphhopper/routing/lm/LandmarkStorage.java +++ b/core/src/main/java/com/graphhopper/routing/lm/LandmarkStorage.java @@ -576,11 +576,9 @@ public class LandmarkStorage implements Storable<LandmarkStorage> { + " vs. " + subnetworkTo, new HashMap<>()); } - int[] tmpIDs = landmarkIDs.get(subnetworkFrom); - - // kind of code duplication to approximate - List<Map.Entry<Integer, Integer>> list = new ArrayList<>(tmpIDs.length); - for (int lmIndex = 0; lmIndex < tmpIDs.length; lmIndex++) { + // See the similar formula in LMApproximator.approximateForLandmark + List<Map.Entry<Integer, Integer>> list = new ArrayList<>(landmarks); + for (int lmIndex = 0; lmIndex < landmarks; lmIndex++) { int fromWeight = getFromWeight(lmIndex, toNode) - getFromWeight(lmIndex, fromNode); int toWeight = getToWeight(lmIndex, fromNode) - getToWeight(lmIndex, toNode);
landmarks subnetwork storage: second minor cleanup
graphhopper_graphhopper
train
java
489fe76fd9250bb3a55c7bf939a0420f76b9c79b
diff --git a/src/Integrations/LumenServiceProvider.php b/src/Integrations/LumenServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Integrations/LumenServiceProvider.php +++ b/src/Integrations/LumenServiceProvider.php @@ -24,16 +24,17 @@ class LumenServiceProvider extends ServiceProvider if (function_exists('env') && ! env('REGISTER_WORKER_ROUTES', true)) return; $this->bindWorker(); - $this->addRoutes(); + $this->addRoutes(preg_match('/5\.5\..*/', $this->app->version()) ? $this->app->router : $this->app); } /** + * @param mixed $router * @return void */ - protected function addRoutes() + protected function addRoutes($router) { - $this->app->post('/worker/schedule', 'Dusterio\AwsWorker\Controllers\WorkerController@schedule'); - $this->app->post('/worker/queue', 'Dusterio\AwsWorker\Controllers\WorkerController@queue'); + $router->post('/worker/schedule', 'Dusterio\AwsWorker\Controllers\WorkerController@schedule'); + $router->post('/worker/queue', 'Dusterio\AwsWorker\Controllers\WorkerController@queue'); } /**
r Support for Lumen <I>
dusterio_laravel-aws-worker
train
php
a3a2e82696781715f535270bf4f85c33843165b6
diff --git a/externs/closure-compiler.js b/externs/closure-compiler.js index <HASH>..<HASH> 100644 --- a/externs/closure-compiler.js +++ b/externs/closure-compiler.js @@ -27,5 +27,3 @@ ArrayBuffer.isView = function(arg) {}; * @see http://www.w3.org/TR/pointerevents/#the-touch-action-css-property */ CSSProperties.prototype.touchAction; - -var global;
Remove 'global' from externs/closure-compiler.js
openlayers_openlayers
train
js
284251807bfceb34f926b46d677e548cfd227326
diff --git a/yolk/cli.py b/yolk/cli.py index <HASH>..<HASH> 100755 --- a/yolk/cli.py +++ b/yolk/cli.py @@ -84,7 +84,10 @@ def show_distributions(show, project_name, version, show_metadata, fields): develop = "" else: develop = dist.location - print_metadata(show, metadata, develop, active, show_metadata, fields) + if metadata: + print_metadata(show, metadata, develop, active, show_metadata, fields) + else: + print dist + " has no metadata" results = True if show == 'all' and results and fields: print "Versions with '*' are non-active."
Fix for pkgs with no metadata
cakebread_yolk
train
py
d44e2376d8d87e8070ef752c55befca928b37bd3
diff --git a/java/client/test/org/openqa/selenium/AlertsTest.java b/java/client/test/org/openqa/selenium/AlertsTest.java index <HASH>..<HASH> 100644 --- a/java/client/test/org/openqa/selenium/AlertsTest.java +++ b/java/client/test/org/openqa/selenium/AlertsTest.java @@ -30,7 +30,7 @@ import static org.openqa.selenium.Ignore.Driver.SELENESE; import static org.openqa.selenium.TestWaiter.waitFor; -@Ignore({CHROME, HTMLUNIT, IPHONE, SELENESE}) +@Ignore({ANDROID, CHROME, HTMLUNIT, IPHONE, SELENESE}) public class AlertsTest extends AbstractDriverTestCase { @Override
DanielWagnerHall: Disable Android tests until android support lands r<I>
SeleniumHQ_selenium
train
java
0f6f14c36dcf25e80eb18042a53af25c16bd9348
diff --git a/tests/search/test_local.py b/tests/search/test_local.py index <HASH>..<HASH> 100644 --- a/tests/search/test_local.py +++ b/tests/search/test_local.py @@ -1,7 +1,8 @@ # coding=utf-8 import unittest from tests.search.dummies import DummyProblem, GOAL, DummyGeneticProblem -from simpleai.search.local import (beam, hill_climbing, +from simpleai.search.local import (beam, beam_best_first, + hill_climbing, hill_climbing_stochastic, simulated_annealing, hill_climbing_random_restarts, genetic) @@ -17,6 +18,10 @@ class TestLocalSearch(unittest.TestCase): result = beam(self.problem) self.assertEquals(result.state, GOAL) + def test_beam_best_first(self): + result = beam_best_first(self.problem) + self.assertEquals(result.state, GOAL) + def test_hill_climbing(self): result = hill_climbing(self.problem) self.assertEquals(result.state, GOAL)
Added test for beam_best_first algorithm
simpleai-team_simpleai
train
py
df60f9f6c270087703c4f79064a7b54254972378
diff --git a/src/main/java/com/assertthat/selenium_shutterbug/utils/web/Browser.java b/src/main/java/com/assertthat/selenium_shutterbug/utils/web/Browser.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/assertthat/selenium_shutterbug/utils/web/Browser.java +++ b/src/main/java/com/assertthat/selenium_shutterbug/utils/web/Browser.java @@ -169,6 +169,7 @@ public class Browser { Object metrics = this.evaluate(FileUtil.getJsScript(ALL_METRICS)); this.sendCommand("Emulation.setDeviceMetricsOverride", metrics); Object result = this.sendCommand("Page.captureScreenshot", ImmutableMap.of("format", "png", "fromSurface", true)); + this.sendCommand("Emulation.clearDeviceMetricsOverride", ImmutableMap.of()); String base64EncodedPng = (String) ((Map<String, ?>) result).get("data"); InputStream in = new ByteArrayInputStream(OutputType.BYTES.convertFromBase64Png(base64EncodedPng)); BufferedImage bImageFromConvert;
Update Browser.java (#<I>) Fixes #<I>. Clearing the device pixel on taking full screenshot in chrome
assertthat_selenium-shutterbug
train
java
d0b4c9f70802fe79eb47f3cfbaf520f5eaf78ce0
diff --git a/fstream.js b/fstream.js index <HASH>..<HASH> 100644 --- a/fstream.js +++ b/fstream.js @@ -183,6 +183,8 @@ function Writer (props) { me.dirname = path.dirname(props.path) me.linkpath = props.linkpath || null + if (typeof props.mode === "string") props.mode = parseInt(props.mode, 8) + me.readable = false me.writable = true @@ -251,7 +253,7 @@ function clobber (me) { function create (me) { if (typeof me.props.mode !== "number") { - me.props.mode = (me.type === "Directory" ? 0777 : 0666) & (~umask) + me.props.mode = me.type === "Directory" ? dirmode : filemode } mkdir(me.dirname, dirmode, function (er) {
Support octal strings for mode
npm_fstream
train
js
d79fa5da6c4667a1ea075877fd12e9276ab3c5a4
diff --git a/neuropythy/hcp/core.py b/neuropythy/hcp/core.py index <HASH>..<HASH> 100644 --- a/neuropythy/hcp/core.py +++ b/neuropythy/hcp/core.py @@ -207,7 +207,7 @@ class Subject(mri.Subject): imgs = {k:_img_loader(k) for k in six.iterkeys(imgmap)} def _make_mask(val, eq=True): rib = imgmap['ribbon'] - arr = (rib.get_data() == val) if eq else (rib.get_data() != val) + arr = (rib.dataobj == val) if eq else (rib.dataobj != val) arr.setflags(write=False) return type(rib)(arr, rib.affine, rib.header) imgs['lh_gray_mask'] = lambda:_make_mask(3)
debugging and eliminated the depricated get_data() calls to nibabel objects
noahbenson_neuropythy
train
py
e85c21f40e47399039982f3bdba7c4e2247d3c67
diff --git a/subliminal/providers/subscenter.py b/subliminal/providers/subscenter.py index <HASH>..<HASH> 100644 --- a/subliminal/providers/subscenter.py +++ b/subliminal/providers/subscenter.py @@ -44,7 +44,7 @@ class SubsCenterSubtitle(Subtitle): # episode if isinstance(video, Episode): # series - if video.series and sanitized_string_equal(self.series, video.series): + if video.series and sanitized_string_equal(self.series, video.series): matches.add('series') # season if video.season and self.season == video.season:
Fix pep8 in subscenter
Diaoul_subliminal
train
py
e69de94f613eb0892acf0fd6009586c24ce64228
diff --git a/python/sbp/client/drivers/pyserial_driver.py b/python/sbp/client/drivers/pyserial_driver.py index <HASH>..<HASH> 100644 --- a/python/sbp/client/drivers/pyserial_driver.py +++ b/python/sbp/client/drivers/pyserial_driver.py @@ -46,7 +46,7 @@ class PySerialDriver(BaseDriver): try: handle = serial.serial_for_url(port) handle.baudrate = baud - handle.timeout = 1 + handle.timeout = None handle.rtscts = rtscts super(PySerialDriver, self).__init__(handle) except (OSError, serial.SerialException) as e:
Remove short pyserial timeout. Timeout was causing console to disconnect during Piksi Multi restart. Timeout made serial driver not equivalent in behavior to file driver or network driver
swift-nav_libsbp
train
py
872720b945602d33119e6715606835be63524bc3
diff --git a/src/Platforms/SQLServerPlatform.php b/src/Platforms/SQLServerPlatform.php index <HASH>..<HASH> 100644 --- a/src/Platforms/SQLServerPlatform.php +++ b/src/Platforms/SQLServerPlatform.php @@ -1200,8 +1200,8 @@ class SQLServerPlatform extends AbstractPlatform protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) { return $fixed - ? ($length > 0 ? 'NCHAR(' . $length . ')' : 'CHAR(255)') - : ($length > 0 ? 'NVARCHAR(' . $length . ')' : 'NVARCHAR(255)'); + ? 'NCHAR(' . ($length > 0 ? $length : 255) . ')' + : 'NVARCHAR(' . ($length > 0 ? $length : 255) . ')'; } /**
Fix NCHAR typo for MSSQL
doctrine_dbal
train
php
3a6bf63ff6e53c998bc3ace784c9db9a41471222
diff --git a/src/main/java/io/javalin/Javalin.java b/src/main/java/io/javalin/Javalin.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/javalin/Javalin.java +++ b/src/main/java/io/javalin/Javalin.java @@ -59,6 +59,13 @@ public class Javalin { return new Javalin(); } + public static Javalin start(int port) { + return new Javalin() + .port(port) + .enableStaticFiles("/public") + .start(); + } + // Begin embedded server methods private boolean started = false;
[core] Add static method for quick-starting a server (fixed #<I>)
tipsy_javalin
train
java
9d1285400c5f33744822090faa931cb7c7b6dd59
diff --git a/src/Event/Model/WidgetsListener.php b/src/Event/Model/WidgetsListener.php index <HASH>..<HASH> 100644 --- a/src/Event/Model/WidgetsListener.php +++ b/src/Event/Model/WidgetsListener.php @@ -27,7 +27,6 @@ class WidgetsListener implements EventListenerInterface return [ (string)EventName::MODEL_DASHBOARDS_GET_WIDGETS() => [ 'callable' => 'getWidgets', - 'priority' => PHP_INT_MAX, // this listener should be called last ], ]; } @@ -70,7 +69,7 @@ class WidgetsListener implements EventListenerInterface if ($query->isEmpty()) { return []; } - + // dd($query->toArray()); return [ ['type' => 'saved_search', 'data' => $query->toArray()], ];
removing the priority call (task #<I>)
QoboLtd_cakephp-search
train
php
3e46e0b0c0edd24ff9bb6e300593aa996ae8ee51
diff --git a/test/spec.js b/test/spec.js index <HASH>..<HASH> 100644 --- a/test/spec.js +++ b/test/spec.js @@ -2,7 +2,7 @@ var blanket = require('blanket')('../') var chai = require('chai') var version = require('..') var should = chai.should() -var quantum = require('quantum-core') +var quantum = require('quantum-js') var path = require('path')
change quantum-core to quantum-js
ocadotechnology_quantumjs
train
js
66ab98659d97f96c03e2490bd346dac1f02ec39b
diff --git a/src/net/sf/mpxj/mpp/GanttChartView.java b/src/net/sf/mpxj/mpp/GanttChartView.java index <HASH>..<HASH> 100644 --- a/src/net/sf/mpxj/mpp/GanttChartView.java +++ b/src/net/sf/mpxj/mpp/GanttChartView.java @@ -1374,7 +1374,7 @@ public abstract class GanttChartView extends GenericView // If we have enough data left in the block for // a second criteria then process it // - if (varDataOffset - 272 >= 272) + if (varDataOffset - 272 >= 272 && data.length > (offset+272+80+4)) { int logicType = MPPUtility.getByte(data, offset + 272); switch (logicType)
Updated to add code which attempts to avoid overrunning the end of an array.
joniles_mpxj
train
java
87d9bc3b0971deb5e5d70b7d4a97c8f4d352186d
diff --git a/lib/db/adapter/mysql.js b/lib/db/adapter/mysql.js index <HASH>..<HASH> 100644 --- a/lib/db/adapter/mysql.js +++ b/lib/db/adapter/mysql.js @@ -386,6 +386,10 @@ MySQL.prototype.migrate = function(callback) migrator.migrate().success(function() { self.close(callback); + }).error(function(err) { + self.close(function() { + callback && callback(err); + }); }); }); }
[Backend/MySQL] Catched all events (success and error) of the sequelize migrator while migrating.
Jack12816_greppy
train
js
94e4aa6ea9aabb5bf6244d9b38607b336703af98
diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index <HASH>..<HASH> 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -460,6 +460,7 @@ out: // 3) Amount and availability. if peer := d.peers.Peer(pid); peer != nil { peer.Demote() + glog.V(logger.Detail).Infof("%s: block delivery timeout", peer) } } // After removing bad peers make sure we actually have sufficient peer left to keep downloading diff --git a/eth/downloader/peer.go b/eth/downloader/peer.go index <HASH>..<HASH> 100644 --- a/eth/downloader/peer.go +++ b/eth/downloader/peer.go @@ -87,6 +87,9 @@ func (p *peer) SetIdle() { scale := 2.0 if time.Since(p.started) > blockSoftTTL { scale = 0.5 + if time.Since(p.started) > blockHardTTL { + scale = 1 / float64(MaxBlockFetch) // reduces capacity to 1 + } } for { // Calculate the new download bandwidth allowance
eth/downloader: log hard timeouts and reset capacity
ethereum_go-ethereum
train
go,go
6d39588bf6e8d7b828ba0b48dc033d9148ebe554
diff --git a/org.jrebirth/core/src/main/java/org/jrebirth/core/link/WaveData.java b/org.jrebirth/core/src/main/java/org/jrebirth/core/link/WaveData.java index <HASH>..<HASH> 100644 --- a/org.jrebirth/core/src/main/java/org/jrebirth/core/link/WaveData.java +++ b/org.jrebirth/core/src/main/java/org/jrebirth/core/link/WaveData.java @@ -9,7 +9,7 @@ package org.jrebirth.core.link; * @author Sébastien Bordes * */ -public final class WaveData<T> implements Comparable<WaveData<T>> { +public final class WaveData<T> implements Comparable<WaveData<?>> { /** * The key property, must be set with an enumeration that implements WaveItem. @@ -113,7 +113,7 @@ public final class WaveData<T> implements Comparable<WaveData<T>> { * {@inheritDoc} */ @Override - public int compareTo(final WaveData<T> waveData) { + public int compareTo(final WaveData<?> waveData) { return getOrder() - waveData.getOrder(); } }
Correct usage of generics into WaveData
JRebirth_JRebirth
train
java
9d702763118b132cbe9005a80625ba2160089c3d
diff --git a/manager/scheduler/filter.go b/manager/scheduler/filter.go index <HASH>..<HASH> 100644 --- a/manager/scheduler/filter.go +++ b/manager/scheduler/filter.go @@ -294,6 +294,14 @@ func (f *PlatformFilter) platformEqual(imgPlatform, nodePlatform api.Platform) b nodePlatform.Architecture = "amd64" } + // normalize "aarch64" architectures to "arm64" + if imgPlatform.Architecture == "aarch64" { + imgPlatform.Architecture = "arm64" + } + if nodePlatform.Architecture == "aarch64" { + nodePlatform.Architecture = "arm64" + } + if (imgPlatform.Architecture == "" || imgPlatform.Architecture == nodePlatform.Architecture) && (imgPlatform.OS == "" || imgPlatform.OS == nodePlatform.OS) { return true }
normalize "aarch<I>" architectures to "arm<I>"
docker_swarmkit
train
go
e33e2f9db4930e1af726a4cf05172a91d237a002
diff --git a/cloudflare.go b/cloudflare.go index <HASH>..<HASH> 100644 --- a/cloudflare.go +++ b/cloudflare.go @@ -21,7 +21,7 @@ import ( ) var ( - Version string = "dev" + Version string = "v4" // Deprecated: Use `client.New` configuration instead. apiURL = fmt.Sprintf("%s://%s%s", defaultScheme, defaultHostname, defaultBasePath) @@ -61,6 +61,7 @@ func newClient(opts ...Option) (*API, error) { api := &API{ BaseURL: fmt.Sprintf("%s://%s%s", defaultScheme, defaultHostname, defaultBasePath), + UserAgent: userAgent + "/" + Version, headers: make(http.Header), rateLimiter: rate.NewLimiter(rate.Limit(4), 1), // 4rps equates to default api limit (1200 req/5 min) retryPolicy: RetryPolicy{
cloudflare: actually use the default user agent Updates the (stable) HTTP client configuration to use the `userAgent` value for the request being made. Experimental already uses this correctly.
cloudflare_cloudflare-go
train
go
ecbb1deeac143f767a6c836d6cc56038ae55be06
diff --git a/spec/notification_spec.rb b/spec/notification_spec.rb index <HASH>..<HASH> 100644 --- a/spec/notification_spec.rb +++ b/spec/notification_spec.rb @@ -368,6 +368,18 @@ describe Bugsnag::Notification do Bugsnag.notify(BugsnagTestException.new("It crashed"), {:request => {:params => {:password => "1234", :other_password => "123456", :other_data => "123456"}}}) end + it "should not filter params from payload hashes if their values are nil" do + Bugsnag::Notification.should_receive(:deliver_exception_payload) do |endpoint, payload| + event = get_event_from_payload(payload) + event[:metaData].should_not be_nil + event[:metaData][:request].should_not be_nil + event[:metaData][:request][:params].should_not be_nil + event[:metaData][:request][:params].should have_key(:nil_param) + end + + Bugsnag.notify(BugsnagTestException.new("It crashed"), {:request => {:params => {:nil_param => nil}}}) + end + it "should not notify if the exception class is in the default ignore_classes list" do Bugsnag::Notification.should_not_receive(:deliver_exception_payload)
Failing test for null params stripping Bugsnag::Helpers.cleanup_obj removes any keys from a hash whose value is nil. As it is called on the notification metadata before sending, this removes any nil request params, e.g. a JSON POST of: { "nil_param": null } is reported as having an empty params hash.
bugsnag_bugsnag-ruby
train
rb
789326b67bfd18ddc89470e1968d38edeedd1271
diff --git a/src/component/Component.js b/src/component/Component.js index <HASH>..<HASH> 100644 --- a/src/component/Component.js +++ b/src/component/Component.js @@ -468,6 +468,7 @@ class Component { options = options || {} options.header = options.header || '' options.footer = options.footer || '' + options.static = options.static || false // During development you can serve JS and CSS for UI from local using the // the env var `STENCILA_WEB`. If not set then falls back to the CDN @@ -491,6 +492,7 @@ class Component { (this.url ? `<meta name="url" content="${this.url}">\n` : '') + (this.description ? `<meta name="description" content="${this.description}">\n` : '') + (this.keywords ? `<meta name="keywords" content="${this.keywords.join(', ')}">\n` : '') + + (options.static ? `<meta name="static" content="1">\n` : '') + `<meta name="generator" content="stencila-node-${version}">` + `<meta name="viewport" content="width=device-width, initial-scale=1">` } else if (part === 'main') {
Add a static option for page generation
stencila_node
train
js
8c91874c7ec750426aaf3a08d295f46148cb7d82
diff --git a/lib/ruby2d/sprite.rb b/lib/ruby2d/sprite.rb index <HASH>..<HASH> 100644 --- a/lib/ruby2d/sprite.rb +++ b/lib/ruby2d/sprite.rb @@ -3,7 +3,7 @@ module Ruby2D class Sprite - attr_accessor :x, :y, :data + attr_accessor :x, :y, :clip_x, :clip_y, :clip_w, :clip_h, :data def initialize(x, y, path)
Expose sprite attributes for native extensions
ruby2d_ruby2d
train
rb
e269cefe9cd0b16756c9d9283cec80ede66bfea7
diff --git a/src/repository.js b/src/repository.js index <HASH>..<HASH> 100644 --- a/src/repository.js +++ b/src/repository.js @@ -128,7 +128,7 @@ export class Repository { populatedData[key] = repository.populateEntities(value); } - return entity.setData(populatedData); + return entity.setData(populatedData).markClean(); } /**
refactor(repository): Mark populated entities as clean
SpoonX_aurelia-orm
train
js
25ad0bd9578a6d9059f2718bc1cde64f4a53a141
diff --git a/lib/active_scaffold/actions/batch_update.rb b/lib/active_scaffold/actions/batch_update.rb index <HASH>..<HASH> 100644 --- a/lib/active_scaffold/actions/batch_update.rb +++ b/lib/active_scaffold/actions/batch_update.rb @@ -40,7 +40,10 @@ module ActiveScaffold::Actions else @batch_successful = false end - do_list if batch_successful? + if batch_successful? + do_search if respond_to? :do_search + do_list + end respond_to_action(:batch_update) end
Bugfix: apply search conditions when refreshing list
vhochstein_active_scaffold_batch
train
rb
769fcb20d8977d6377b10da637a86131c0f1b9d3
diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.java index <HASH>..<HASH> 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.java @@ -43,7 +43,6 @@ import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; import java.util.ArrayList; import java.util.List; -import java.util.Locale; /** * Analyzer for getting company, product, and version information from a .NET assembly.
Removed a now unused import.
jeremylong_DependencyCheck
train
java
f66d72ec506ac2c77897ce4dc379e0a3617a28a8
diff --git a/public/js/editor.js b/public/js/editor.js index <HASH>..<HASH> 100644 --- a/public/js/editor.js +++ b/public/js/editor.js @@ -678,18 +678,7 @@ function AposSchemas() { // Used to search for elements without false positives from nested // schemas in unrelated fieldsets self.findSafe = function($el, sel) { - return $el.find(sel).filter(function() { - var $parents = $(this).parents(); - var i; - for (i = 0; (i < $parents.length); i++) { - if ($parents[i] === $el[0]) { - return true; - } - if ($($parents[i]).hasClass('apos-fieldset')) { - return false; - } - } - }); + return $el.findSafe(sel, '.apos-fieldset'); }; // Used to search for simple elements that have a
jquery findSafe is now an independent jquery plugin
apostrophecms-legacy_apostrophe-schemas
train
js
346eb85bb91e913f4b816a63ec187c36bcd52af2
diff --git a/spec/shared_stripe_examples/customer_examples.rb b/spec/shared_stripe_examples/customer_examples.rb index <HASH>..<HASH> 100644 --- a/spec/shared_stripe_examples/customer_examples.rb +++ b/spec/shared_stripe_examples/customer_examples.rb @@ -349,4 +349,13 @@ shared_examples 'Customer API' do customer = customer.delete expect(customer.deleted).to eq(true) end + + it 'works with the update_subscription method', focus:true do + stripe_helper.create_plan(id: 'silver') + cus = Stripe::Customer.create(source: gen_card_tk) + expect { + cus.update_subscription(plan: 'silver') + }.not_to raise_error + end + end
Add a spec that only passes with pull #<I>
rebelidealist_stripe-ruby-mock
train
rb
e613b4b894d9d0d8ee4fcf04791939f6789b7f4b
diff --git a/src/Graviton/CoreBundle/Controller/MainController.php b/src/Graviton/CoreBundle/Controller/MainController.php index <HASH>..<HASH> 100644 --- a/src/Graviton/CoreBundle/Controller/MainController.php +++ b/src/Graviton/CoreBundle/Controller/MainController.php @@ -148,6 +148,13 @@ class MainController array_keys($optionRoutes) ); + $services = array_filter( + $services, + function ($val) { + return !is_null($val); + } + ); + $sortArr = []; foreach ($services as $key => $val) { if ($this->isRelevantForMainPage($val) && !in_array($val['$ref'], $sortArr)) {
ensure no nulls in services array
libgraviton_graviton
train
php
611db19c5ab34ba740c0c5499d6dcfbfffd516e6
diff --git a/pac4j-saml/src/main/java/org/pac4j/saml/client/SAML2ClientConfiguration.java b/pac4j-saml/src/main/java/org/pac4j/saml/client/SAML2ClientConfiguration.java index <HASH>..<HASH> 100644 --- a/pac4j-saml/src/main/java/org/pac4j/saml/client/SAML2ClientConfiguration.java +++ b/pac4j-saml/src/main/java/org/pac4j/saml/client/SAML2ClientConfiguration.java @@ -479,7 +479,8 @@ public class SAML2ClientConfiguration extends InitializableObject { final PrivateKey signingKey = kp.getPrivate(); final X509Certificate certificate = cert.generate(signingKey, "BC"); - ks.setKeyEntry(this.keyStoreAlias, signingKey, password, new Certificate[]{certificate}); + final char[] keyPassword = this.privateKeyPassword.toCharArray(); + ks.setKeyEntry(this.keyStoreAlias, signingKey, keyPassword, new Certificate[]{certificate}); try (final FileOutputStream fos = new FileOutputStream(this.keystoreResource.getFile().getCanonicalPath())) { ks.store(fos, password);
ensure private key password is used when generating saml metadata
pac4j_pac4j
train
java
651c0f076dd1dc5d476c960f1a6dbeebf1a43c33
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -239,7 +239,6 @@ function Texture(opts) { 'vec2 texCoord = tileOffset + tileSize * fract(tileUV);', 'gl_FragColor = texture2D(tileMap, texCoord);'].join('\n')), '', -' if (gl_FragColor.a < 0.001) discard; // transparency', THREE.ShaderChunk[ "alphatest_fragment" ],
Remove alpha discard in fragment shader, since now using transparent: true for transparent materials. Ref GH-7
deathcap_voxel-texture-shader
train
js
5dd98ac6dfdfd7584f745faf28fcdd7c7bb1a57d
diff --git a/src/main/java/ninja/S3Dispatcher.java b/src/main/java/ninja/S3Dispatcher.java index <HASH>..<HASH> 100644 --- a/src/main/java/ninja/S3Dispatcher.java +++ b/src/main/java/ninja/S3Dispatcher.java @@ -994,7 +994,7 @@ public class S3Dispatcher implements WebDispatcher { } private File combineParts(String id, String uploadId, List<File> parts) { - File file = new File(getUploadDir(uploadId), id); + File file = new File(getUploadDir(uploadId), StoredObject.encodeKey(id)); try { if (!file.createNewFile()) {
Properly encodes file name when combining multi-part upload 👮‍♂️
scireum_s3ninja
train
java
d28438caf2342be3df8421ed92b95e0510be8ac0
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/schema/schema.rb +++ b/activerecord/test/schema/schema.rb @@ -233,7 +233,7 @@ ActiveRecord::Schema.define do end create_table :items, :force => true do |t| - t.column :name, :integer + t.column :name, :string end create_table :inept_wizards, :force => true do |t| @@ -343,8 +343,8 @@ ActiveRecord::Schema.define do t.decimal :my_house_population, :precision => 2, :scale => 0 t.decimal :decimal_number_with_default, :precision => 3, :scale => 2, :default => 2.78 t.float :temperature - # Oracle supports precision up to 38 - if current_adapter?(:OracleAdapter) + # Oracle/SQLServer supports precision up to 38 + if current_adapter?(:OracleAdapter,:SQLServerAdapter) t.decimal :atoms_in_universe, :precision => 38, :scale => 0 else t.decimal :atoms_in_universe, :precision => 55, :scale => 0
A few schema changes for the SQL Server adapter.
rails_rails
train
rb
de4f395d75d7307a79d8db44399a6feaa0118c0a
diff --git a/wrappers/python/setup.py b/wrappers/python/setup.py index <HASH>..<HASH> 100644 --- a/wrappers/python/setup.py +++ b/wrappers/python/setup.py @@ -9,6 +9,6 @@ setup( author='Vyacheslav Gudkov', author_email='[email protected]', description='This is the official SDK for Hyperledger Indy (https://www.hyperledger.org/projects), which provides a distributed-ledger-based foundation for self-sovereign identity (https://sovrin.org). The major artifact of the SDK is a c-callable library.', - install_requires=['pytest', 'pytest-asyncio', 'base58'], - tests_require=['pytest', 'pytest-asyncio', 'base58'] + install_requires=['pytest<3.7', 'pytest-asyncio', 'base58'], + tests_require=['pytest<3.7', 'pytest-asyncio', 'base58'] )
Fix pytest version in python wrapper deps.
hyperledger_indy-sdk
train
py
dfdd76025e8eb5d8c13f0210e7a6ef3a70d3fc94
diff --git a/lib/utorrent.js b/lib/utorrent.js index <HASH>..<HASH> 100644 --- a/lib/utorrent.js +++ b/lib/utorrent.js @@ -85,9 +85,11 @@ var uTorrentClient = module.exports = function(host, port) { } if('form' in options) { + // TODO: check why sometimes uTorrent returns error "Can\'t add torrent: torrent is not valid bencoding" when adding torrent. Error by our side, or malformed torrent file ? reqOptions.multipart = [ { 'Content-Disposition': 'form-data; name="torrent_file"; filename="torrent_file.torrent"', + /*'Content-Transfer-Encoding': 'binary',*/ 'Content-Type': 'application/x-bittorrent', 'body': options.form.torrent_file },
Add todo about some errors when uploading torrents
leeroybrun_node-utorrent-api
train
js
c09c337a0d594825952f797c8fa9de5d09fe890c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -429,11 +429,11 @@ def setup_args(): requires = [ 'boost_python (>=1.33)', 'numpy (>=1.1)', - 'six', + 'six (>=1.12)', ] install_requires = [ - 'six', + 'six (>=1.12)', ] if PYTHON_VERSION < (3, 4): install_requires.append('enum34')
Add six >= <I> requirement The method `six.ensure_binary` is only available since release <I>. Addresses issue #<I>
tango-controls_pytango
train
py
8c2a4423a68d941cd23f221ecf6a0571bb5e7597
diff --git a/session.go b/session.go index <HASH>..<HASH> 100644 --- a/session.go +++ b/session.go @@ -681,10 +681,15 @@ func (q *Query) defaultsFromSession() { q.rt = s.cfg.RetryPolicy q.serialCons = s.cfg.SerialConsistency q.defaultTimestamp = s.cfg.DefaultTimestamp - q.idempotent = s.cfg.DefaultIdempotence + q.idempotent = s.cfg.DefaultIdempotence s.mu.RUnlock() } +// Statement returns the statement that was used to generate this query. +func (q Query) Statement() string { + return q.stmt +} + // String implements the stringer interface. func (q Query) String() string { return fmt.Sprintf("[query statement=%q values=%+v consistency=%s]", q.stmt, q.values, q.cons)
query: add Statement method to return generated statement. (#<I>) Closes #<I>
gocql_gocql
train
go
c0fcfe95bb7ef1c457e3683ad1630c66b5a75178
diff --git a/lib/authlogic/acts_as_authentic/restful_authentication.rb b/lib/authlogic/acts_as_authentic/restful_authentication.rb index <HASH>..<HASH> 100644 --- a/lib/authlogic/acts_as_authentic/restful_authentication.rb +++ b/lib/authlogic/acts_as_authentic/restful_authentication.rb @@ -45,13 +45,21 @@ module Authlogic private def set_restful_authentication_config - crypto_provider_key = act_like_restful_authentication ? :crypto_provider : :transition_from_crypto_providers - self.send("#{crypto_provider_key}=", CryptoProviders::Sha1) + self.restful_auth_crypto_provider = CryptoProviders::Sha1 if !defined?(::REST_AUTH_SITE_KEY) || ::REST_AUTH_SITE_KEY.nil? class_eval("::REST_AUTH_SITE_KEY = ''") unless defined?(::REST_AUTH_SITE_KEY) CryptoProviders::Sha1.stretches = 1 end end + + # @api private + def restful_auth_crypto_provider=(provider) + if act_like_restful_authentication + self.crypto_provider = provider + else + self.transition_from_crypto_providers = provider + end + end end module InstanceMethods
Extract private method: restful_auth_crypto_provider= By extracting this method, we 1. avoid using send 2. break up a long line (the ternary)
binarylogic_authlogic
train
rb
4c2a10aee272d63d4d0eaf4748e3f9743d35b2c2
diff --git a/km3pipe/core.py b/km3pipe/core.py index <HASH>..<HASH> 100644 --- a/km3pipe/core.py +++ b/km3pipe/core.py @@ -43,7 +43,7 @@ class Pipeline(object): try: while True: self.cycle_count += 1 - log.info("Pumping blob #{0}".format(self.cycle_count)) + log.debug("Pumping blob #{0}".format(self.cycle_count)) for module in self.modules: log.debug("Processing {0} ".format(module.name)) self.blob = module.process(self.blob)
Decreases log level to debug for pump message
tamasgal_km3pipe
train
py
de539e49731038f86c199bac0892515805f66bbf
diff --git a/packages/ember-views/lib/views/view.js b/packages/ember-views/lib/views/view.js index <HASH>..<HASH> 100644 --- a/packages/ember-views/lib/views/view.js +++ b/packages/ember-views/lib/views/view.js @@ -202,7 +202,7 @@ Ember.View = Ember.Object.extend(Ember.Evented, @type Boolean @default null */ - isVisible: null, + isVisible: true, /** Array of child views. You should never edit this array directly. @@ -640,9 +640,6 @@ Ember.View = Ember.Object.extend(Ember.Evented, // Schedule the DOM element to be created and appended to the given // element after bindings have synchronized. this._insertElementLater(function() { - if (get(this, 'isVisible') === null) { - set(this, 'isVisible', true); - } this.$().appendTo(target); });
Setting isVisible here is expensive
emberjs_ember.js
train
js
5941943be838bcf0b2234f6d183c1a12e224e460
diff --git a/disk/datadog_checks/disk/__init__.py b/disk/datadog_checks/disk/__init__.py index <HASH>..<HASH> 100644 --- a/disk/datadog_checks/disk/__init__.py +++ b/disk/datadog_checks/disk/__init__.py @@ -2,6 +2,6 @@ from . import disk Disk = disk.Disk -__version__ = "1.0.2" +__version__ = "1.1.0" __all__ = ['disk']
[disk] fixing inconsistent versioning (#<I>)
DataDog_integrations-core
train
py
0e30442ca898c6599ad8a634a64c919a3874d576
diff --git a/question/type/edit_question_form.php b/question/type/edit_question_form.php index <HASH>..<HASH> 100644 --- a/question/type/edit_question_form.php +++ b/question/type/edit_question_form.php @@ -613,7 +613,7 @@ abstract class question_edit_form extends question_wizard_form { foreach ($question->options->answers as $answer) { foreach ($extraanswerfields as $field) { // See hack comment in {@link data_preprocessing_answers()}. - unset($this->_form->_defaultValues["$field[$key]"]); + unset($this->_form->_defaultValues["{$field}[{$key}]"]); $extrafieldsdata[$field][$key] = $this->data_preprocessing_extra_answer_field($answer, $field); } $key++;
MDL-<I> question editing: extra answer fields notice. It turns out that PHP does not interpret "$field[$key]" the way we were expecting.
moodle_moodle
train
php
383705ebd637a8e85ed0542efe48d11c3ccc5554
diff --git a/tests/all.js b/tests/all.js index <HASH>..<HASH> 100644 --- a/tests/all.js +++ b/tests/all.js @@ -315,3 +315,20 @@ test('throws when accessing parent module of root', function(){ require('bar/baz'); }, /Cannot access parent module of root/); }); + +test("relative CJS esq require", function() { + define('foo/a', ['require'], function(require) { + return require('./b'); + }); + + + define('foo/b', ['require'], function(require) { + return require('./c'); + }); + + define('foo/c', ['require'], function(require) { + return 'c-content'; + }); + + equal(require('foo/a'), 'c-content'); +});
add tests for relative CJS style require
ember-cli_loader.js
train
js
48629695b32379f2d0cc56988aca0748e2a98837
diff --git a/app/assets/javascripts/judge.js b/app/assets/javascripts/judge.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/judge.js +++ b/app/assets/javascripts/judge.js @@ -99,7 +99,7 @@ if (!!req) { req.onreadystatechange = function() { if (req.readyState === 4) { - req.onreadystatechange = void 0; + req.onreadystatechange = function() {}; var callback = /^20\d$/.test(req.status) ? callbacks.success : callbacks['error']; callback(req.status, req.responseHeaders, req.responseText); }
Fix IE XHR bug IE expects xhr.onreadystatechange to be a function and nothing else, so undefining it with `void 0` throws a type error. Let's set it to a no-op function instead.
joecorcoran_judge
train
js
7e9f1c2d0b34a8a6aa4bb2ac1b6b4f8145b0715b
diff --git a/src/Extension/ElementalFrontendCreateExtension.php b/src/Extension/ElementalFrontendCreateExtension.php index <HASH>..<HASH> 100644 --- a/src/Extension/ElementalFrontendCreateExtension.php +++ b/src/Extension/ElementalFrontendCreateExtension.php @@ -2,12 +2,12 @@ namespace Symbiote\FrontendObjects\Extension; -use Symbiote\Elemental\Form\MultiRecordEditingField; use SilverStripe\Forms\RequiredFields; use SilverStripe\Forms\FieldList; use SilverStripe\ORM\ArrayLib; use SilverStripe\Forms\GridField\GridField; use SilverStripe\ORM\DataExtension; +use Symbiote\MultiRecord\MultiRecordEditingField;
fix(ElementalFrontendCreateExtension) Update to use corrected multirecord editor
nyeholt_silverstripe-frontend-objects
train
php
d8615e1caeebb75c8f446b064996f0fa800802e2
diff --git a/app/Models/Incident.php b/app/Models/Incident.php index <HASH>..<HASH> 100644 --- a/app/Models/Incident.php +++ b/app/Models/Incident.php @@ -199,10 +199,10 @@ class Incident extends Model implements HasPresenter public function getIsResolvedAttribute() { if ($updates = $this->updates->first()) { - return intVal($updates->status) === self::FIXED; + return (int) $updates->status === self::FIXED; } - return intVal($this->status) === self::FIXED; + return (int) $this->status === self::FIXED; } /**
Replace intVal() with casting to int (int)
CachetHQ_Cachet
train
php
1ed53f9cddd630f3bcd98c908f4a5e114d97e33a
diff --git a/runner/v8js/v8js.go b/runner/v8js/v8js.go index <HASH>..<HASH> 100644 --- a/runner/v8js/v8js.go +++ b/runner/v8js/v8js.go @@ -87,19 +87,14 @@ func (r *Runner) Run(ctx context.Context, t loadtest.LoadTest, id int64) <-chan log.WithError(err).Error("Couldn't encode worker data") return } - println("setting constants") w.Load("internal:constants", fmt.Sprintf(`__internal__._data = %s;`, wjson)) - println("bridging api") if err := vu.bridgeAPI(w); err != nil { log.WithError(err).Error("Couldn't register bridged functions") return } - println("screaming internally") src := fmt.Sprintf(`function __run__(){var console=require('console');__internal__._data.Iteration++;try{%s}catch(e){console.error("Script Error",''+e);}}`, r.Source) - println("wtf lol") - println(src) if err := w.Load(r.Filename, src); err != nil { log.WithError(err).Error("Couldn't load JS") return
These do not need to be logged
loadimpact_k6
train
go
06082f66d541e581110406bbac3bc395bace3f86
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -592,13 +592,13 @@ module ActiveRecord FROM pg_type as t SQL end - ranges, nodes = result.partition { |row| row['typinput'] == 'range_in' } + ranges, nodes = result.partition { |row| row['typtype'] == 'r' } + enums, nodes = nodes.partition { |row| row['typtype'] == 'e' } domains, nodes = nodes.partition { |row| row['typtype'] == 'd' } - leaves, nodes = nodes.partition { |row| row['typelem'] == '0' } arrays, nodes = nodes.partition { |row| row['typinput'] == 'array_in' } + leaves, nodes = nodes.partition { |row| row['typelem'] == '0' } # populate the enum types - enums, leaves = leaves.partition { |row| row['typinput'] == 'enum_in' } enums.each do |row| type_map[row['oid'].to_i] = OID::Enum.new end
refactor, use `typtype` instead of `typinput` to segment PG types.
rails_rails
train
rb
8ef87fe4fecfc96247245377abae23e2be459dd4
diff --git a/source/awesome_tool/mvc/models/state_machine.py b/source/awesome_tool/mvc/models/state_machine.py index <HASH>..<HASH> 100755 --- a/source/awesome_tool/mvc/models/state_machine.py +++ b/source/awesome_tool/mvc/models/state_machine.py @@ -30,7 +30,7 @@ class StateMachineModel(ModelMT): self.state_machine = state_machine self.root_state = ContainerStateModel(self.state_machine.root_state) - #self.root_state.register_observer(self) + self.root_state.register_observer(self) self.selection = Selection()
Fix bug of non refreshing graphical editor The graphical editor was not redrawn when any change was done in the state machine. This was due to a commented line, preventing the state machine model from observing itself. This is now fixed by undoing the comment.
DLR-RM_RAFCON
train
py
e91dc7c8957d1a9875cc9e034fe575c79b5ad4b7
diff --git a/_pytest/__init__.py b/_pytest/__init__.py index <HASH>..<HASH> 100644 --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.1.0.dev7' +__version__ = '2.1.0.dev8' diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -22,14 +22,14 @@ def main(): name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.1.0.dev7', + version='2.1.0.dev8', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], author='Holger Krekel, Benjamin Peterson, Ronny Pfannschmidt, Floris Bruynooghe and others', author_email='holger at merlinux.eu', entry_points= make_entry_points(), - install_requires=['py>1.4.3'], + install_requires=['py>=1.4.4.dev2'], classifiers=['Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License',
up pytest version to <I>.dev8, depend on py-<I>.dev2
vmalloc_dessert
train
py,py
fde0c5dc5892cbb32ebf919f439d33a0fe8c34ff
diff --git a/classes/DCA_banner.php b/classes/DCA_banner.php index <HASH>..<HASH> 100644 --- a/classes/DCA_banner.php +++ b/classes/DCA_banner.php @@ -47,7 +47,7 @@ class DCA_banner extends \Backend { parent::__construct(); $this->import('BackendUser', 'User'); - $this->import('\Banner\BannerImage', 'BannerImage'); + $this->import('BugBuster\Banner\BannerImage', 'BannerImage'); } /**
Bugfix #<I>, Class \Banner\BannerImage not found
BugBuster1701_banner
train
php
15f9d637df28c179d1882428793ff4e01047cf78
diff --git a/src/parser/Parser.js b/src/parser/Parser.js index <HASH>..<HASH> 100644 --- a/src/parser/Parser.js +++ b/src/parser/Parser.js @@ -101,6 +101,12 @@ function Parser(source, pathname) { return funcNode; }; + let _stringExpression = function _stringExpression() { + node = new AstNode(NodeTypes.Constant, currentToken); + _expect(TokenTypes.QuotedString); + return node; + }; + let _simpleExpression = function _simpleExpression() { let node; if (_foundToBe(TokenTypes.Symbol, '(')) { @@ -109,6 +115,8 @@ function Parser(source, pathname) { _expectToBe(TokenTypes.Symbol, ')'); } else if (_found(TokenTypes.Constant)) { node = _functorExpression(); + } else if (_found(TokenTypes.QuotedString)) { + node = _stringExpression(); } else { node = _variableOrNumberValueExpression(); }
update parser to handle quotedstring
lps-js_lps.js
train
js
22440ad95114ce94704cd932f44b3551fac6fab2
diff --git a/js/kucoin.js b/js/kucoin.js index <HASH>..<HASH> 100644 --- a/js/kucoin.js +++ b/js/kucoin.js @@ -477,6 +477,9 @@ module.exports = class kucoin extends Exchange { 'min': quoteMinSize, 'max': quoteMaxSize, }, + 'leverage': { + 'max': this.safeNumber (market, 'maxLeverage', 1), // * Don't default to 1 for margin markets, leverage is located elsewhere + }, }; result.push ({ 'id': id,
Added describe.leverage.max to kucoin
ccxt_ccxt
train
js
c6d8a0344322fd7b5e91fa4fb2133d82a0e57173
diff --git a/txnserver/log_setup.py b/txnserver/log_setup.py index <HASH>..<HASH> 100644 --- a/txnserver/log_setup.py +++ b/txnserver/log_setup.py @@ -28,7 +28,7 @@ class LogWriter(object): def write(self, line): if line != '\n': - self.logger.log(self.level, line) + self.logger.log(self.level, line.rstrip()) def create_file_handler(logfile, loglevel):
Rstrip captured output to prevent extraneous lines
hyperledger_sawtooth-core
train
py
43e83f4d7bbf9a36c6ac83fa0c1617f25c1fb440
diff --git a/src/main/java/com/l2fprod/common/propertysheet/PropertyEditorRegistry.java b/src/main/java/com/l2fprod/common/propertysheet/PropertyEditorRegistry.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/l2fprod/common/propertysheet/PropertyEditorRegistry.java +++ b/src/main/java/com/l2fprod/common/propertysheet/PropertyEditorRegistry.java @@ -131,7 +131,7 @@ public final class PropertyEditorRegistry implements PropertyEditorFactory { public synchronized PropertyEditor getEditor(Class type) { PropertyEditor editor = null; Object value = typeToEditor.get(type); - if(type.isEnum()) { + if(value == null && type.isEnum()) { value = typeToEditor.get(Enum.class); } if (value instanceof PropertyEditor) {
Added check to see if a specific editor is added for an enum.
ZenHarbinger_l2fprod-properties-editor
train
java
1fccbe39e1df4b6c10788a825c4a361624f1feea
diff --git a/src/Http/Request.php b/src/Http/Request.php index <HASH>..<HASH> 100644 --- a/src/Http/Request.php +++ b/src/Http/Request.php @@ -292,7 +292,7 @@ class Request * * @return string */ - public static function buildQueryString(array $data = null) + public static function buildQueryString(array $data = null, $urlEncode = true) { if ($data === null) { $data = static::$get; @@ -301,7 +301,7 @@ class Request $query = []; foreach ($data as $name => $value) { - $query[] = "{$name}=" . urlencode($value); + $query[] = "{$name}=" . ($urlEncode ? urlencode($value) : $value); } if (count($query)) {
Add option to disable url encoding query string.
nirix_radium
train
php
d86a7af649d53a0535584c3b3b03528d5d01022a
diff --git a/stanza/utils/datasets/constituency/vtb_convert.py b/stanza/utils/datasets/constituency/vtb_convert.py index <HASH>..<HASH> 100644 --- a/stanza/utils/datasets/constituency/vtb_convert.py +++ b/stanza/utils/datasets/constituency/vtb_convert.py @@ -47,7 +47,8 @@ REMAPPING = { 'Np--H': 'Np-H', '(WHRPP': '(WHRP', # the only PV tags are after S, so this should be the right conversion - '(PV': '(S-PV', + #'(PV': '(S-PV', + '(Mpd': '(MDP', } def unify_label(tree):
Add an obvious fix for a broken bracket in <I> data. A little unsure of a previous fix, actually
stanfordnlp_stanza
train
py
ade564edbb905fde1dda03cbbc29a75b3a5bf39e
diff --git a/src/test/java/net/jodah/typetools/LambdaTest.java b/src/test/java/net/jodah/typetools/LambdaTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/net/jodah/typetools/LambdaTest.java +++ b/src/test/java/net/jodah/typetools/LambdaTest.java @@ -107,4 +107,14 @@ public class LambdaTest { assertEquals(TypeResolver.resolveRawArguments(Function.class, fn1.getClass()), new Class<?>[] { String.class, Integer.class }); } + + public void shouldHandlePassedLambda() { + handlePassedLambda((String s) -> Integer.valueOf(s)); + } + + private <T, R> void handlePassedLambda(Function<T, R> fn) { + Class<?>[] typeArgs = TypeResolver.resolveRawArguments(Function.class, fn.getClass()); + assertEquals(typeArgs[0], String.class); + assertEquals(typeArgs[1], Integer.class); + } }
Added tests and docs for passed lambdas
jhalterman_typetools
train
java
f71928b95621c7e168f5762b8954a8a490f5d5c4
diff --git a/lib/formtastic/inputs/boolean_input.rb b/lib/formtastic/inputs/boolean_input.rb index <HASH>..<HASH> 100644 --- a/lib/formtastic/inputs/boolean_input.rb +++ b/lib/formtastic/inputs/boolean_input.rb @@ -34,12 +34,12 @@ module Formtastic def to_html input_wrapping do - hidden_field << + hidden_field_html << label_with_nested_checkbox end end - def hidden_field + def hidden_field_html template.hidden_field_tag(input_html_options[:name], unchecked_value, :id => nil) end @@ -47,18 +47,22 @@ module Formtastic builder.label( method, label_text_with_embedded_checkbox, - input_html_options.merge( - :id => nil, - :for => input_html_options[:id] - ) + label_html_options + ) + end + + def label_html_options + input_html_options.merge( + :id => nil, + :for => input_html_options[:id] ) end def label_text_with_embedded_checkbox - label_text << " " << check_box + label_text << " " << check_box_html end - def check_box + def check_box_html template.check_box_tag("#{object_name}[#{method}]", checked_value, checked?, input_html_options) end
refactored BooleanInput a bit more
justinfrench_formtastic
train
rb
82ce546e182ce4b88f7afe188a1200f8a9d03f81
diff --git a/salt/client/ssh/ssh_py_shim.py b/salt/client/ssh/ssh_py_shim.py index <HASH>..<HASH> 100644 --- a/salt/client/ssh/ssh_py_shim.py +++ b/salt/client/ssh/ssh_py_shim.py @@ -106,8 +106,10 @@ def need_deployment(): if os.path.exists(OPTIONS.saltdir): shutil.rmtree(OPTIONS.saltdir) old_umask = os.umask(0o077) - os.makedirs(OPTIONS.saltdir) - os.umask(old_umask) + try: + os.makedirs(OPTIONS.saltdir) + finally: + os.umask(old_umask) # Verify perms on saltdir if not is_windows(): euid = os.geteuid()
Prevent failed os.makedirs from leaving modified umask in place
saltstack_salt
train
py
d6504d881b43f42f73a2ff809a922fbcb3e8d93f
diff --git a/method.py b/method.py index <HASH>..<HASH> 100755 --- a/method.py +++ b/method.py @@ -236,7 +236,7 @@ class Method(object): sample.general.complete = False allcomplete = False self.incomplete.append(sample.name) - except KeyError: + except AttributeError: sample.general.complete = True self.completemetadata.append(sample) else: diff --git a/requirements.txt b/requirements.txt index <HASH>..<HASH> 100644 --- a/requirements.txt +++ b/requirements.txt @@ -34,7 +34,7 @@ reportlab==3.4.0 requests==2.20.0 scipy==1.1.0 seaborn==0.9.0 -sipprverse==0.0.84 +sipprverse==0.0.85 six==1.11.0 statsmodels==0.9.0 tornado==5.1.1 diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ __author__ = 'adamkoziol' setup( name="sipprverse", - version="0.0.84", + version="0.0.85", packages=find_packages(), include_package_data=True, scripts=[
Updated error handling to reflect changes to metadataobjects
OLC-Bioinformatics_sipprverse
train
py,txt,py
7ed8f84e4a1b9f937d38173fae2b098580bfb5bf
diff --git a/lib/furnace/cfg/graph.rb b/lib/furnace/cfg/graph.rb index <HASH>..<HASH> 100644 --- a/lib/furnace/cfg/graph.rb +++ b/lib/furnace/cfg/graph.rb @@ -128,6 +128,8 @@ module Furnace::CFG # Are we computing dominators or postdominators? if forward edges = node.sources + node.exception_sources + elsif node.exception.nil? + edges = node.targets else edges = node.targets + [ node.exception ] end
Fixed CFG::Graph#postdominators choking on nodes without exceptions.
whitequark_furnace
train
rb
b3e944e6640919c782649828648de7feccf70266
diff --git a/lib/apn/notification.rb b/lib/apn/notification.rb index <HASH>..<HASH> 100644 --- a/lib/apn/notification.rb +++ b/lib/apn/notification.rb @@ -73,7 +73,9 @@ module APN if sound = opts.delete(:sound) hsh['aps']['sound'] = sound.is_a?(TrueClass) ? 'default' : sound.to_s end - hsh['aps']['content-available'] = opts.delete('content-available').to_i if opts['content-available'] + if content_avaliable = opts.delete(:content_available) + hsh['aps']['content-available'] = 1 if content_avaliable == (true || 1) + end hsh.merge!(opts) payload(hsh) end
use underscore convention for symbol, instead of API dash convention
arthurnn_apn_sender
train
rb
93af05ef78241d588931c5a7546069251cf2e604
diff --git a/server/rest/src/main/java/org/infinispan/rest/ServerRestBlockHoundIntegration.java b/server/rest/src/main/java/org/infinispan/rest/ServerRestBlockHoundIntegration.java index <HASH>..<HASH> 100644 --- a/server/rest/src/main/java/org/infinispan/rest/ServerRestBlockHoundIntegration.java +++ b/server/rest/src/main/java/org/infinispan/rest/ServerRestBlockHoundIntegration.java @@ -12,5 +12,7 @@ public class ServerRestBlockHoundIntegration implements BlockHoundIntegration { // ChunkedFile read is blocking - This can be fixed in // https://issues.redhat.com/browse/ISPN-11834 builder.allowBlockingCallsInside(ResponseWriter.CHUNKED_FILE.getClass().getName(), "writeResponse"); + // ChunkedInputStream read is blocking, see ISPN-13131 + builder.allowBlockingCallsInside(ResponseWriter.CHUNKED_STREAM.getClass().getName(), "writeResponse"); } }
ISPN-<I> REST keys operation blocks in a non-blocking thread Add workaround for ChunkedInputStream in ServerRestBlockHoundIntegration
infinispan_infinispan
train
java
f4b7420dfe419fe653908f091976517635a119e6
diff --git a/src/transformers/models/vit/configuration_vit.py b/src/transformers/models/vit/configuration_vit.py index <HASH>..<HASH> 100644 --- a/src/transformers/models/vit/configuration_vit.py +++ b/src/transformers/models/vit/configuration_vit.py @@ -21,7 +21,7 @@ from ...utils import logging logger = logging.get_logger(__name__) VIT_PRETRAINED_CONFIG_ARCHIVE_MAP = { - "nielsr/vit-base-patch16-224": "https://huggingface.co/vit-base-patch16-224/resolve/main/config.json", + "google/vit-base-patch16-224": "https://huggingface.co/vit-base-patch16-224/resolve/main/config.json", # See all ViT models at https://huggingface.co/models?filter=vit }
Fix checkpoint for ViT Config
huggingface_pytorch-pretrained-BERT
train
py
5b59f7a6364da0f477cdb2b695529d8576aefe84
diff --git a/tests/assert/database/migrations/20190825020232_test_procedure.php b/tests/assert/database/migrations/20190825020232_test_procedure.php index <HASH>..<HASH> 100644 --- a/tests/assert/database/migrations/20190825020232_test_procedure.php +++ b/tests/assert/database/migrations/20190825020232_test_procedure.php @@ -39,6 +39,9 @@ final class TestProcedure extends AbstractMigration private function struct(): void { $sql = <<<'EOT' + DROP PROCEDURE IF EXISTS `test_procedure`; + DROP PROCEDURE IF EXISTS `test_procedure2`; + CREATE PROCEDURE `test_procedure`(IN _min INT) BEGIN SELECT `name` FROM `guest_book` WHERE id > _min;
tests: refact test_procedure migrate
hunzhiwange_framework
train
php
d09ff2be62e9db7d42a9dfbe183c23df04ddd82a
diff --git a/docs/reference/themes/mongodb/static/js/scripts.js b/docs/reference/themes/mongodb/static/js/scripts.js index <HASH>..<HASH> 100644 --- a/docs/reference/themes/mongodb/static/js/scripts.js +++ b/docs/reference/themes/mongodb/static/js/scripts.js @@ -17,4 +17,10 @@ jQuery(document).ready(function(){ jQuery('[data-toggle="tooltip"]').tooltip(); jQuery("body").addClass("hljsCode"); hljs.initHighlightingOnLoad(); + var linkRegex = new RegExp('/' + window.location.host + '/'); + jQuery('a').not('[href*="mailto:"]').each(function () { + if ( ! linkRegex.test(this.href) ) { + $(this).attr('target', '_blank'); + } + }); });
Open external site links in a new window
mongodb_mongo-java-driver
train
js
6b32d399cb1d07e229e7f2f18e6eba30272e4cfc
diff --git a/lib/knife-solo/bootstraps/linux.rb b/lib/knife-solo/bootstraps/linux.rb index <HASH>..<HASH> 100644 --- a/lib/knife-solo/bootstraps/linux.rb +++ b/lib/knife-solo/bootstraps/linux.rb @@ -23,9 +23,10 @@ module KnifeSolo::Bootstraps gem_install end - def emerge_install + def emerge_gem_install ui.msg("Installing required packages...") run_command("sudo USE='-test' ACCEPT_KEYWORDS='~amd64' emerge -u chef") + gem_install end def add_yum_repos(repo_path) @@ -96,7 +97,7 @@ module KnifeSolo::Bootstraps when %r{openSUSE 11.4} {:type => "zypper_gem", :version => "openSUSE"} when %r{This is \\n\.\\O \(\\s \\m \\r\) \\t} - {:type => "emerge", :version => "Gentoo"} + {:type => "emerge_gem", :version => "Gentoo"} else raise "Distro not recognized from looking at /etc/issue. Please fork https://github.com/matschaffer/knife-solo and add support for your distro." end
Use rubygems on Gentoo. emerge chef is <I> :(
matschaffer_knife-solo
train
rb
7f94a0800f2f6a77c1af53c8d1497ce0ccce5d36
diff --git a/app/controllers/storytime/posts_controller.rb b/app/controllers/storytime/posts_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/storytime/posts_controller.rb +++ b/app/controllers/storytime/posts_controller.rb @@ -21,8 +21,8 @@ module Storytime content_for :title, "#{@site.title} | #{@post.title}" - if params[:preview].nil? && ((@site.post_slug_style != "post_id") && (params[:id] != @post.slug)) - return redirect_to @post, :status => :moved_permanently + if params[:preview].nil? && !view_context.current_page?(storytime.post_path(@post)) + redirect_to storytime.post_path(@post), :status => :moved_permanently end @comments = @post.comments.order("created_at DESC")
redirect to proper url if attempting to access a post at a different URL style
CultivateLabs_storytime
train
rb
c64a175e18cb9218d518d1dafc4207c31d7d5274
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index <HASH>..<HASH> 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -20,7 +20,7 @@ module ApplicationHelper end def gravatar(size, id = "gravatar", user = current_user) - image_tag(user.gravatar_url(:size => size, :secure => request.ssl?), :id => id, :width => size, :height => size) + image_tag(user.gravatar_url(:size => size, :secure => request.ssl?).html_safe, :id => id, :width => size, :height => size) end def ssl_url_for(options = {})
Treat Gravatar URLs as safe HTML This fixes invalid rating and size parameters that lead to incorrect image sizes (e.g. pixelated images) and unavailable PG-rated Gravatars.
rubygems_rubygems.org
train
rb
ad0bef335acd258a51858f5577cf49d5bfec5d75
diff --git a/src/Gitonomy/Git/Repository.php b/src/Gitonomy/Git/Repository.php index <HASH>..<HASH> 100644 --- a/src/Gitonomy/Git/Repository.php +++ b/src/Gitonomy/Git/Repository.php @@ -115,11 +115,12 @@ class Repository */ public function __construct($dir, $options = array()) { + $is_windows = defined( 'PHP_WINDOWS_VERSION_BUILD' ); $options = array_merge(array( 'working_dir' => null, 'debug' => true, 'logger' => null, - 'environment_variables' => array(), + 'environment_variables' => $is_windows ? array( 'PATH' => $_SERVER['PATH'] ) : array(), 'command' => 'git', 'process_timeout' => 3600 ), $options);
Added PATH to default environment in Windows. Fixes #<I>
gitonomy_gitlib
train
php
865842405927caf75a8242d5dd49eed2a3800f8d
diff --git a/backend/local/backend_plan_test.go b/backend/local/backend_plan_test.go index <HASH>..<HASH> 100644 --- a/backend/local/backend_plan_test.go +++ b/backend/local/backend_plan_test.go @@ -478,6 +478,12 @@ Plan: 1 to add, 0 to change, 1 to destroy.` } func TestLocal_planRefreshFalse(t *testing.T) { + // since there is no longer a separate Refresh walk, `-refresh=false + // doesn't do anything. + // FIXME: determine if we need a refresh option for the new plan, or remove + // this test + t.Skip() + b, cleanup := TestLocal(t) defer cleanup()
skip plan with no refresh test We still need to determine if `-refresh=false` is even useful with the new planning strategy.
hashicorp_terraform
train
go
de976756d5da89cf0b51c7927b51790393d41000
diff --git a/salt/netapi/__init__.py b/salt/netapi/__init__.py index <HASH>..<HASH> 100644 --- a/salt/netapi/__init__.py +++ b/salt/netapi/__init__.py @@ -31,7 +31,7 @@ class NetapiClient(object): def __init__(self, opts): self.opts = opts - def is_master_running(self): + def _is_master_running(self): ''' Perform a lightweight check to see if the master daemon is running @@ -50,7 +50,7 @@ class NetapiClient(object): # Eauth currently requires a running daemon and commands run through # this method require eauth so perform a quick check to raise a # more meaningful error. - if not self.is_master_running(): + if not self._is_master_running(): raise salt.exceptions.SaltDaemonNotRunning( 'Salt Master is not available.') diff --git a/salt/netapi/rest_cherrypy/app.py b/salt/netapi/rest_cherrypy/app.py index <HASH>..<HASH> 100644 --- a/salt/netapi/rest_cherrypy/app.py +++ b/salt/netapi/rest_cherrypy/app.py @@ -1401,7 +1401,7 @@ class Login(LowDataAdapter): ] }} ''' - if not self.api.is_master_running(): + if not self.api._is_master_running(): raise salt.exceptions.SaltDaemonNotRunning( 'Salt Master is not available.')
Switch is_master_running() to be a private method The list of available clients is generated from the public methods on the class.
saltstack_salt
train
py,py
afddc97ae35b19d9c94de8286f711c930828fb5d
diff --git a/example/rnn/lstm.py b/example/rnn/lstm.py index <HASH>..<HASH> 100644 --- a/example/rnn/lstm.py +++ b/example/rnn/lstm.py @@ -187,8 +187,8 @@ def calc_nll(seq_label_probs, X, begin): def train_lstm(model, X_train_batch, X_val_batch, num_round, update_period, optimizer='rmsprop', half_life=2,max_grad_norm = 5.0, **kwargs): - print("Training swith train.shape=%s" % str(X_train_batch.shape)) - print("Training swith val.shape=%s" % str(X_val_batch.shape)) + print("Training with train.shape=%s" % str(X_train_batch.shape)) + print("Training with val.shape=%s" % str(X_val_batch.shape)) m = model seq_len = len(m.seq_data) batch_size = m.seq_data[0].shape[0]
correct train's output change the swith to with
apache_incubator-mxnet
train
py
e4fa40277ed4facc3da35196a62be945143302b3
diff --git a/app/controllers/katello/api/v2/subscriptions_controller.rb b/app/controllers/katello/api/v2/subscriptions_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/katello/api/v2/subscriptions_controller.rb +++ b/app/controllers/katello/api/v2/subscriptions_controller.rb @@ -23,8 +23,6 @@ class Api::V2::SubscriptionsController < Api::V2::ApiController resource_description do description "Systems subscriptions management." - param :system_id, :identifier, :desc => "System uuid", :required => true - api_version 'v2' end @@ -144,7 +142,9 @@ class Api::V2::SubscriptionsController < Api::V2::ApiController end api :POST, "/organizations/:organization_id/subscriptions/upload", "Upload a subscription manifest" + api :POST, "/subscriptions/upload", "Upload a subscription manifest" param :organization_id, :identifier, :desc => "Organization id", :required => true + param :content, String, :desc => "Subscription manifest file", :required => true def upload fail HttpErrors::BadRequest, _("No manifest file uploaded") if params[:content].blank?
ref #<I> - hammer-manifest - update apipie for subscription upload
Katello_katello
train
rb
9112a8b5d50475f96ea7dfd74756cf0ec5eae5e8
diff --git a/src/Renderer.php b/src/Renderer.php index <HASH>..<HASH> 100644 --- a/src/Renderer.php +++ b/src/Renderer.php @@ -49,7 +49,7 @@ class Renderer { $this->url = $url; $this->plugins = $plugins; - $this->config = array_merge(self::$configDefaults, $config); + $this->config = array_merge(static::$configDefaults, $config); } /**
'static' reference to configDefaults rather than 'self' (#9)
wayfair_hypernova-php
train
php
43e30d7697af0a35c8cdbc25eb4a3819b6122577
diff --git a/rw/www.py b/rw/www.py index <HASH>..<HASH> 100644 --- a/rw/www.py +++ b/rw/www.py @@ -304,8 +304,8 @@ class HandlerBase(tornado.web.RequestHandler, dict): def _rw_get_path(cls, func, values={}): return cls._rw_routes[func].get_path(values) - def create_form(self, name, Form, db=None): - self[name] = Form() + def create_form(self, name, Form, db=None, **kwargs): + self[name] = Form(**kwargs) if db: self[name].process(obj=db) else:
Passing kwargs to Form.
FlorianLudwig_rueckenwind
train
py
0228e5b47df0e7cd019a1355ccf9bcd5334e29bf
diff --git a/src/Composer/Command/SelfUpdateCommand.php b/src/Composer/Command/SelfUpdateCommand.php index <HASH>..<HASH> 100644 --- a/src/Composer/Command/SelfUpdateCommand.php +++ b/src/Composer/Command/SelfUpdateCommand.php @@ -468,6 +468,7 @@ TAGSPUBKEY return $this->tryAsWindowsAdmin($localFilename, $newFilename); } + @unlink($newFilename); $action = 'Composer '.($backupTarget ? 'update' : 'rollback'); throw new FilesystemException($action.' failed: "'.$localFilename.'" could not be written.'.PHP_EOL.$e->getMessage()); } @@ -620,7 +621,7 @@ EOT; exec('"'.$script.'"'); @unlink($script); - // see if the file was moved and is still accessible + // see if the file was copied and is still accessible if ($result = Filesystem::isReadable($localFilename) && (hash_file('sha256', $localFilename) === $checksum)) { $io->writeError('<info>Operation succeeded.</info>'); @unlink($newFilename);
Clean up properly if self-update fails (#<I>)
composer_composer
train
php
a38d5910067fc7e6b541dc96cdcfe779aacdb05e
diff --git a/lib/Cell.js b/lib/Cell.js index <HASH>..<HASH> 100644 --- a/lib/Cell.js +++ b/lib/Cell.js @@ -56,6 +56,8 @@ exports.Cell = function(row1, col1, row2, col2, isMerged){ val = ''; } val=val.toString(); + // Remove Non-ASCII characters, they aren't understood by xmlbuilder + val=val.replace(/[^A-Za-z 0-9 \.,\?""!@#\$%\^&\*\(\)-_=\+;:<>\/\\\|\}\{\[\]`~]*/g, ''); theseCells.cells.forEach(function(c,i){ c.String(thisWS.wb.getStringIndex(val));
remove non-ASCII characters from strings. They aren't understood by xmlbuilder.
natergj_excel4node
train
js
8d336766725c1a91e378f96c49e12bae7f608593
diff --git a/src/AlgorithmNearestNeighbor.php b/src/AlgorithmNearestNeighbor.php index <HASH>..<HASH> 100644 --- a/src/AlgorithmNearestNeighbor.php +++ b/src/AlgorithmNearestNeighbor.php @@ -43,7 +43,7 @@ class AlgorithmNearestNeighbor{ } if ( isset( $visitedVertices[ $nextVertex->getId() ] ) ){ //check if there is a way i can use - throw new Exception("Graph is not connected - can't find an edge to unconnected vertex"); + throw new Exception("Graph is not complete - can't find an edge to unconnected vertex"); } $visitedVertices[ $nextVertex->getId() ] = TRUE; @@ -55,7 +55,7 @@ class AlgorithmNearestNeighbor{ $edges = $vertex->getEdgesTo($startVertex); if ( ! $edges ){ //check if there is a way from end edge to start edge - throw new Exception("Graph is not connected - can't find an edge to the start vertex"); + throw new Exception("Graph is not complete - can't find an edge to the start vertex"); } foreach ( $edges as $edge ){ //get first connecting edge
Change exception message from "Graph is not connected" to "Graph is not complete"
graphp_algorithms
train
php
8709696a8d125e123c71089ee4f830335978b131
diff --git a/generated_fakes_test.go b/generated_fakes_test.go index <HASH>..<HASH> 100644 --- a/generated_fakes_test.go +++ b/generated_fakes_test.go @@ -122,14 +122,9 @@ var _ = Describe("Fakes generated by counterfeiter", func() { }) Describe("implementing an interface to show recorded methoded invocations", func() { - var ( - invocationRecorder InvocationRecorder - ok bool - ) - BeforeEach(func() { var ifake interface{} = fake - invocationRecorder, ok = ifake.(InvocationRecorder) + _ , ok := ifake.(InvocationRecorder) Expect(ok).To(BeTrue()) })
Fix sundry type checking errors in generated fakes test
maxbrunsfeld_counterfeiter
train
go