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
cac4ef03087a4e8ffdc3139291919dcb48a12374
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,7 +20,8 @@ import mock MOCK_MODULES = ['numpy', 'scipy', 'matplotlib', 'matplotlib.pyplot', 'scipy.linalg', 'numpy.linalg', 'matplotlib.pyplot', - 'numpy.random'] + 'numpy.random', 'scipy.sparse', 'scipy.sparse.linalg', + 'scipy.stats', 'matplotlib.patches'] for mod_name in MOCK_MODULES: sys.modules[mod_name] = mock.Mock() @@ -34,6 +35,7 @@ sys.path.insert(0, os.path.abspath('../filterpy')) from filterpy import * import filterpy +import filterpy.kalman # -- General configuration ------------------------------------------------
Added mocks for scipy and matplotlib so docs will build.
rlabbe_filterpy
train
py
3b96355b6275da1eb2ddead1bb670ac84a775b67
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -100,7 +100,7 @@ function initJobDirs(base, job, cache, done) { Runner.prototype = { id: 'simple-runner', - + // public API loadExtensions: function (dirs, done) { var self = this @@ -350,6 +350,7 @@ Runner.prototype = { baseDir: dirs.base, dataDir: dirs.data, cacheDir: dirs.cache, + emitter: self.emitter, io: self.config.io, env: env, log: console.log,
Pass emitter through to core so that it can be used in plugins
Strider-CD_strider-simple-runner
train
js
d312d8f6cc53d19a21fda2a0900deac089439cae
diff --git a/src/Mouf/Reflection/MoufReflectionProxy.php b/src/Mouf/Reflection/MoufReflectionProxy.php index <HASH>..<HASH> 100755 --- a/src/Mouf/Reflection/MoufReflectionProxy.php +++ b/src/Mouf/Reflection/MoufReflectionProxy.php @@ -1,12 +1,12 @@ <?php -/* - * This file is part of the Mouf core package. - * - * (c) 2012 David Negrier <david@mouf-php.com> - * - * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. - */ +/* + * This file is part of the Mouf core package. + * + * (c) 2012 David Negrier <david@mouf-php.com> + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Mouf\Reflection; use Exception; @@ -226,7 +226,7 @@ class MoufReflectionProxy { curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); if($post) { curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); + curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post, '', '&')); } else { curl_setopt($ch, CURLOPT_POST, false); }
Force arg_separator.output in Proxy
thecodingmachine_mouf
train
php
1ced9d7b73193273373544f3c8ddf4ed3ebc81bc
diff --git a/lib/datalib.php b/lib/datalib.php index <HASH>..<HASH> 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -1763,7 +1763,7 @@ function get_all_instances_in_course($modulename, $course, $userid=NULL, $includ if ($includeinvisible) { $invisible = -1; - } else if (has_capability('moodle/course:viewhiddencourses', get_context_instance(CONTEXT_COURSE, $course->id), $userid)) { + } else if (has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_COURSE, $course->id), $userid)) { // Usually hide non-visible instances from students $invisible = -1; } else {
MDL-<I> - Wrong capability checked in get_all_instances_in_course should be moodle/course:viewhiddenactivities, not moodle/course:viewhiddencourses. Merged from MOODLE_<I>_STABLE.
moodle_moodle
train
php
cd8926779d2bab12434881973d2483b82c915b55
diff --git a/lib/jquery-ui-rails-cdn.rb b/lib/jquery-ui-rails-cdn.rb index <HASH>..<HASH> 100644 --- a/lib/jquery-ui-rails-cdn.rb +++ b/lib/jquery-ui-rails-cdn.rb @@ -19,10 +19,10 @@ module Jquery::Ui::Rails::Cdn end def jquery_ui_include_tag(name, options = {}) - return javascript_include_tag(:'jquery.ui.all') if OFFLINE and !options[:force] + return javascript_include_tag('jquery.ui.all') if !options.delete(:force) and OFFLINE [ javascript_include_tag(jquery_ui_url(name, options)), - javascript_tag("window.jQuery.ui || document.write(unescape('#{javascript_include_tag(:'jquery.ui.all').gsub('<','%3C').gsub("\n",'%0A')}'))") + javascript_tag("window.jQuery.ui || document.write(unescape('#{javascript_include_tag('jquery.ui.all').gsub('<','%3C').gsub("\n",'%0A')}'))") ].join("\n").html_safe end end
Always remove force from options hash This avoids force="true" on the script tags if force: true is set outside of OFFLINE environments.
styx_jquery-ui-rails-cdn
train
rb
3541e049e1298db53efc4f63245768353001c3bf
diff --git a/plotnine/stats/stat_quantile.py b/plotnine/stats/stat_quantile.py index <HASH>..<HASH> 100644 --- a/plotnine/stats/stat_quantile.py +++ b/plotnine/stats/stat_quantile.py @@ -20,7 +20,7 @@ class stat_quantile(stat): Parameters ---------- {common_parameters} - quatiles : tuple, optional (default: (0.25, 0.5, 0.75)) + quantiles : tuple, optional (default: (0.25, 0.5, 0.75)) Quantiles of y to compute formula : str, optional (default: 'y ~ x') Formula relating y variables to x variables
DOC: Fix Mispelling of quantile (#<I>)
has2k1_plotnine
train
py
becbc148471c7f3d488574ccd616216f79f4b61f
diff --git a/tensorlayer/layers.py b/tensorlayer/layers.py index <HASH>..<HASH> 100755 --- a/tensorlayer/layers.py +++ b/tensorlayer/layers.py @@ -2202,6 +2202,9 @@ class DynamicRNNLayer(Layer): your state at the begining of each epoch or iteration according to your training procedure. + sequence_length : a tensor or array, shape = [batch_size] + The sequence lengths computed by Advanced Opt or the given sequence lengths. + Notes ----- Input dimension should be rank 3 : [batch_size, n_steps(max), n_features], if no, please see :class:`ReshapeLayer`.
[LAYER] dynamic rnn advanced opt for computing the sequence length
tensorlayer_tensorlayer
train
py
7d1ffff1463738eba0ef9a08fec050a3ed8946a2
diff --git a/src/services/Export.php b/src/services/Export.php index <HASH>..<HASH> 100644 --- a/src/services/Export.php +++ b/src/services/Export.php @@ -2,6 +2,7 @@ namespace verbb\fieldmanager\services; use Craft; +use craft\helpers\ArrayHelper; use craft\helpers\Json; use yii\base\Component; @@ -76,6 +77,15 @@ class Export extends Component $settings = $blockField->settings; } + $width = 100; + $fieldLayout = $blockType->getFieldLayout(); + $fieldLayoutElements = $fieldLayout->getTabs()[0]->elements ?? []; + + if ($fieldLayoutElements) { + $fieldLayoutElement = ArrayHelper::firstWhere($fieldLayoutElements, 'field.uid', $blockField->uid); + $width = (int)($fieldLayoutElement->width ?? 0) ?: 100; + } + $fieldSettings['blockTypes']['new' . $blockCount]['fields']['new' . $fieldCount] = array( 'name' => $blockField->name, 'handle' => $blockField->handle, @@ -86,6 +96,7 @@ class Export extends Component 'translationKeyFormat' => $blockField->translationKeyFormat, 'type' => \get_class($blockField), 'typesettings' => $settings, + 'width' => $width, ); $fieldCount++;
Add width property to export for Matrix
verbb_field-manager
train
php
ad0f935e1799112b9740c6fadfe5df429950916b
diff --git a/lib/jira/resource/sprint.rb b/lib/jira/resource/sprint.rb index <HASH>..<HASH> 100644 --- a/lib/jira/resource/sprint.rb +++ b/lib/jira/resource/sprint.rb @@ -16,7 +16,7 @@ module JIRA def self.find(client, key, options = {}) options[:maxResults] ||= 100 fields = options[:fields].join(',') unless options[:fields].nil? - response = client.get("/rest/api/latest/search?jql=sprint=#{key}&fields=#{fields}&maxResults=#{options[:maxResults]}") + response = client.get("/rest/api/latest/search?jql=sprint=#{key}&fields=#{fields}&startAt=#{options[:startAt]}&maxResults=#{options[:maxResults]}") parse_json(response.body) end
Fixed a bug where the startAt field wasn’t being used for paginated sprint results.
sumoheavy_jira-ruby
train
rb
e0a07d9b2859e46748ff3a7f2190afe6b571d431
diff --git a/src/Client.php b/src/Client.php index <HASH>..<HASH> 100644 --- a/src/Client.php +++ b/src/Client.php @@ -161,7 +161,7 @@ class Client { */ public function setCookiePath($cookiePath) { - $this->cookiePath = $cookiePath; + $this->cookiePath = rtrim($cookiePath, '/') . '/'; return $this; }
[TASK] Ensure trailing slash on cookie path
xperseguers_doodle_client
train
php
2f8328eab2e9ee928af3ae0d1ff51f9c3bc7dbe4
diff --git a/tests/test_web.py b/tests/test_web.py index <HASH>..<HASH> 100644 --- a/tests/test_web.py +++ b/tests/test_web.py @@ -121,8 +121,8 @@ class TestHttps(unittest2.TestCase): options = {} if https: options = { - 'PSDASH_HTTPS_KEYFILE': 'keyfile', - 'PSDASH_HTTPS_CERTFILE': 'cacert.pem' + 'PSDASH_HTTPS_KEYFILE': os.path.join(os.path.dirname(__file__), 'keyfile'), + 'PSDASH_HTTPS_CERTFILE': os.path.join(os.path.dirname(__file__), 'cacert.pem') } self.r = PsDashRunner(options) self.runner = gevent.spawn(self.r.run)
Now properly specifying HTTPS option paths in tests.
Jahaja_psdash
train
py
396622e00607cc886b64269ab50adc7ff4879be4
diff --git a/commands/command_filter_process.go b/commands/command_filter_process.go index <HASH>..<HASH> 100644 --- a/commands/command_filter_process.go +++ b/commands/command_filter_process.go @@ -167,19 +167,26 @@ func filterCommand(cmd *cobra.Command, args []string) { malformedOnWindows = append(malformedOnWindows, req.Header["pathname"]) } - var status string if delayed { // If we delayed, there is no need to write a flush // packet since no content was written. - status = delayedStatusFromErr(err) - } else if ferr := w.Flush(); ferr != nil { - // Otherwise, assume that content was written and - // perform a flush operation. + w = nil + } + + var status string + if ferr := w.Flush(); ferr != nil { status = statusFromErr(ferr) } else { - // If the flush operation succeeded, write the status of - // the checkout operation. - status = statusFromErr(err) + if delayed { + // If the flush operation succeeded, write that + // we were delayed, or encountered an error. + // the checkout operation. + status = delayedStatusFromErr(err) + } else { + // If we responded with content, report the + // status of that operation instead. + status = statusFromErr(err) + } } s.WriteStatus(status)
commands: clarify err to status conversion
git-lfs_git-lfs
train
go
95602c43f890c40e5269a536c93979372f89ab6f
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -327,7 +327,6 @@ class CrawlKit { * @return {(Stream|Promise.<Object>)} By default a Promise object is returned that resolves to the result. If streaming is enabled it returns a JSON stream of the results. */ crawl(shouldStream) { - const crawlTimer = new NanoTimer(); let stream; if (shouldStream) { stream = JSONStream.stringifyObject(); @@ -341,7 +340,7 @@ class CrawlKit { throw new Error(`Defined url '${this.url}' is not valid.`); } const seen = new Map(); - crawlTimer.time((stopCrawlTimer) => { + new NanoTimer().time((stopCrawlTimer) => { let addUrl; const q = async.queue((scope, workerFinished) => { scope.tries++;
style: no need to put nanoTimer in symbol
crawlkit_crawlkit
train
js
24fa09b83749bbdd1a5b3eb563afc71f7d1f65e4
diff --git a/lib/ethon/easy/http/actionable.rb b/lib/ethon/easy/http/actionable.rb index <HASH>..<HASH> 100644 --- a/lib/ethon/easy/http/actionable.rb +++ b/lib/ethon/easy/http/actionable.rb @@ -8,6 +8,8 @@ module Ethon # for more real actions like GET, HEAD, POST and PUT. module Actionable + QUERY_OPTIONS = [ :params, :body, :params_encoding ] + # Create a new action. # # @example Create a new action. @@ -134,7 +136,7 @@ module Ethon query_options = {} options = options.dup - [ :params, :body, :params_encoding ].each do |query_option| + QUERY_OPTIONS.each do |query_option| if options.key?(query_option) query_options[query_option] = options.delete(query_option) end
Refactor: set query options in a Constant
typhoeus_ethon
train
rb
7edf89c54f37a4df960dd1af1e3ca688b6644ad6
diff --git a/src/Wrep/Notificato/Apns/Message.php b/src/Wrep/Notificato/Apns/Message.php index <HASH>..<HASH> 100644 --- a/src/Wrep/Notificato/Apns/Message.php +++ b/src/Wrep/Notificato/Apns/Message.php @@ -2,6 +2,10 @@ namespace Wrep\Notificato\Apns; +/** + * An APNS Message representation. + * Note: All strings given to this class must be in UTF-8 to create a valid message + */ class Message { // Attributes that go into the binary APNS comminucation @@ -340,6 +344,11 @@ class Message } // Encode as JSON object - return json_encode($message, JSON_FORCE_OBJECT); + $json = json_encode($message, JSON_FORCE_OBJECT); + if (false == $json) { + throw new \RuntimeException('Failed to convert APNS\Message to JSON, are all strings UTF-8?', json_last_error()); + } + + return $json; } } \ No newline at end of file
JSON output check and documented Message must be used with UTF-8 strings Fixes #<I>
mac-cain13_notificato
train
php
b0c1a8560617fd2ac04eff64d10c16d9244a1dc1
diff --git a/browserscripts/performance/resourceTimings.js b/browserscripts/performance/resourceTimings.js index <HASH>..<HASH> 100644 --- a/browserscripts/performance/resourceTimings.js +++ b/browserscripts/performance/resourceTimings.js @@ -1,21 +1,18 @@ (function() { - /** - * Browsertime (http://www.browsertime.com) - * Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog - * and other contributors - * Released under the Apache 2.0 License - */ - -// someway the get entries by type isn't working in IE using Selenium, -// will spend time fixing this later, now just return empty - if (navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0) { - return []; - } - if (window.performance && window.performance.getEntriesByType) { var timings = window.performance.getEntriesByType('resource'); - // workaround for issue with Firefox where each resource timing entry contains a toJSON entry. - return JSON.parse(JSON.stringify(timings)); + var resources = []; + // we can do more cool stuff with resouce timing v2 in the + // future + timings.forEach(function(resource) { + resources.push({ + name: resource.name, + startTime: resource.startTime, + duration: resource.duration + }); + }); + + return resources; } else { return []; }
use the same pattern as user timings
sitespeedio_browsertime
train
js
67da0581b193b62498927a6ba8b410c9977e5455
diff --git a/digitalocean/Metadata.py b/digitalocean/Metadata.py index <HASH>..<HASH> 100644 --- a/digitalocean/Metadata.py +++ b/digitalocean/Metadata.py @@ -19,7 +19,7 @@ class Metadata(BaseAPI): super(Metadata, self).__init__(*args, **kwargs) self.end_point = "http://169.254.169.254/metadata/v1" - def get_data(self, url, headers=dict(), params=dict()): + def get_data(self, url, headers=dict(), params=dict(), render_json=True): """ Customized version of get_data to directly get the data without using the authentication method. @@ -28,6 +28,9 @@ class Metadata(BaseAPI): url = urljoin(self.end_point, url) response = requests.get(url, headers=headers, params=params) + + if render_json: + return response.json() return response.content def load(self):
A new option will force or not the json rendering of the response.
koalalorenzo_python-digitalocean
train
py
ef0fad8ab85a98a2662328382b46b2cfd116737d
diff --git a/lib/sensu/config.rb b/lib/sensu/config.rb index <HASH>..<HASH> 100644 --- a/lib/sensu/config.rb +++ b/lib/sensu/config.rb @@ -197,7 +197,7 @@ module Sensu opts.on('-b', '--background', 'Fork into backgaround (daemon mode) (default: false)') do options[:daemonize] = true end - opts.on('-p', '--pid_file FILE', 'Sensu PID FILE (default: ' + DEFAULT_OPTIONS[:pid_file] + ')') do |file| + opts.on('-p', '--pid_file FILE', 'Sensu PID FILE (default: /tmp/' + File.basename($0) + '.pid)') do |file| options[:pid_file] = file end end
[fix-config-test] just needed to remove nonexistent constant from optparse
sensu_sensu
train
rb
d7962e8308d7fb7b96e0d0cae6c7075f8a4923fe
diff --git a/src/basis/animation.js b/src/basis/animation.js index <HASH>..<HASH> 100644 --- a/src/basis/animation.js +++ b/src/basis/animation.js @@ -50,7 +50,7 @@ } ); - var cancelAnimationFrame = createMethod('cancelRequestAnimationFrame') || createMethod('cancelAnimationFrame', + var cancelAnimationFrame = createMethod('cancelAnimationFrame') || createMethod('cancelRequestAnimationFrame', function(id){ clearTimeout(id); }
basis.animation: try to use `cancelAnimationFrame` first, instead of deprecated `cancelRequestAnimationFrame`
basisjs_basisjs
train
js
aabe4461ff3fae9ffa2fca43f83f53e0d874f3ae
diff --git a/scanpy/tests/test_read_10x.py b/scanpy/tests/test_read_10x.py index <HASH>..<HASH> 100644 --- a/scanpy/tests/test_read_10x.py +++ b/scanpy/tests/test_read_10x.py @@ -10,8 +10,8 @@ ROOT = os.path.join(ROOT, '_data', '10x_data') def assert_anndata_equal(a1, a2): assert a1.shape == a2.shape - assert all(a1.obs == a2.obs) - assert all(a1.var == a2.var) + assert (a1.obs == a2.obs).all(axis=None) + assert (a1.var == a2.var).all(axis=None) assert np.allclose(a1.X.todense(), a2.X.todense()) def test_read_10x_mtx():
I had forgotten what `all(dataframe)` does (#<I>)
theislab_scanpy
train
py
35978f237f38d9d80ad5a08d937eb48ee5e20ff8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,8 @@ setup( author_email='support@algorithmia.com', packages=['Algorithmia'], install_requires=[ - 'requests' + 'requests', + 'six' ], include_package_data=True, classifiers=[
add six as one of the dependencies for the project
algorithmiaio_algorithmia-python
train
py
8dd1657be7790a05775f4ddf9d01c27a4c22030b
diff --git a/uliweb/form/uliform.py b/uliweb/form/uliform.py index <HASH>..<HASH> 100644 --- a/uliweb/form/uliform.py +++ b/uliweb/form/uliform.py @@ -424,7 +424,7 @@ class IntField(BaseField): BaseField.__init__(self, label=label, default=default, required=required, validators=validators, name=name, html_attrs=html_attrs, help_string=help_string, build=build, **kwargs) def to_python(self, data): - return int(data) + return int(float(data)) def to_html(self, data): if data is None:
Form int field will convert value to float first
limodou_uliweb
train
py
0a10f2fab98ee3f920aad5a7efde9babc296a6c2
diff --git a/src/test/java/org/jooq/lambda/SeqTest.java b/src/test/java/org/jooq/lambda/SeqTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/jooq/lambda/SeqTest.java +++ b/src/test/java/org/jooq/lambda/SeqTest.java @@ -78,6 +78,7 @@ public class SeqTest { assertTrue(it1.hasNext()); Tuple2<Integer, Seq<Integer>> t11 = it1.next(); + assertTrue(it1.hasNext()); assertEquals(1, (int) t11.v1); Iterator<Integer> it11 = t11.v2.iterator(); assertTrue(it11.hasNext()); @@ -86,6 +87,7 @@ public class SeqTest { assertTrue(it1.hasNext()); Tuple2<Integer, Seq<Integer>> t12 = it1.next(); + assertFalse(it1.hasNext()); assertEquals(0, (int) t12.v1); Iterator<Integer> it12 = t12.v2.iterator(); assertTrue(it12.hasNext());
[#<I>] Failing test with Iterator.hasNext()
jOOQ_jOOL
train
java
2817865ddb4560be85570f35c8ca7d72452b46db
diff --git a/pkg/minikube/constants/constants.go b/pkg/minikube/constants/constants.go index <HASH>..<HASH> 100644 --- a/pkg/minikube/constants/constants.go +++ b/pkg/minikube/constants/constants.go @@ -119,7 +119,7 @@ const ( var DefaultIsoUrl = fmt.Sprintf("https://storage.googleapis.com/%s/minikube-%s.iso", minikubeVersion.GetIsoPath(), minikubeVersion.GetIsoVersion()) var DefaultIsoShaUrl = DefaultIsoUrl + ShaSuffix -var DefaultKubernetesVersion = "v1.12.0" +var DefaultKubernetesVersion = "v1.10.0" var ConfigFilePath = MakeMiniPath("config") var ConfigFile = MakeMiniPath("config", "config.json")
Keep <I> as default for now
kubernetes_minikube
train
go
45634f87f81eb9f2242c5ec4f74995fbc618bf1a
diff --git a/examples/distillation/run_squad_w_distillation.py b/examples/distillation/run_squad_w_distillation.py index <HASH>..<HASH> 100644 --- a/examples/distillation/run_squad_w_distillation.py +++ b/examples/distillation/run_squad_w_distillation.py @@ -264,7 +264,7 @@ def evaluate(args, model, tokenizer, prefix=""): args.eval_batch_size = args.per_gpu_eval_batch_size * max(1, args.n_gpu) # Note that DistributedSampler samples randomly - eval_sampler = SequentialSampler(dataset) if args.local_rank == -1 else DistributedSampler(dataset) + eval_sampler = SequentialSampler(dataset) eval_dataloader = DataLoader(dataset, sampler=eval_sampler, batch_size=args.eval_batch_size) # Eval!
fix Sampler in distributed training - evaluation
huggingface_pytorch-pretrained-BERT
train
py
e049d542b8f178c1e89504b71d5b16ad5d51202a
diff --git a/lib/pork/test.rb b/lib/pork/test.rb index <HASH>..<HASH> 100644 --- a/lib/pork/test.rb +++ b/lib/pork/test.rb @@ -1,21 +1,16 @@ require 'pork/auto' -Pork.autorun(false) +Pork.autorun Pork.show_source Pork.Rainbows! if rand(10) == 0 -at_exit do - Pork.module_eval do - execute_mode(ENV['PORK_MODE']) - report_mode(ENV['PORK_REPORT']) - trap - execute +Pork.singleton_class.prepend Module.new{ + def execute + super %w[sequential shuffled parallel].each do |mode| execute_mode(mode) - execute + super end - stat.report - exit stat.failures + stat.errors + ($! && 1).to_i end -end +}
so that we don't copy and paste
godfat_pork
train
rb
592382b5f30aa5d4f3a215bb79f909349f7771c8
diff --git a/tests/risk_job_unittest.py b/tests/risk_job_unittest.py index <HASH>..<HASH> 100644 --- a/tests/risk_job_unittest.py +++ b/tests/risk_job_unittest.py @@ -343,7 +343,7 @@ class RiskCalculatorTestCase(unittest.TestCase): GRID_ASSETS[gcoo] = asset self.grid = shapes.Grid(shapes.Region.from_coordinates( - [(1.0, 3.0), (1.0, 4.0), (2.0, 4.0), (2.0, 3.0)]), 1.0) + [(10.0, 10.0), (10.0, 10.1), (10.1, 10.1), (10.1, 10.0)]), 0.1) # this is the expected output of grid_assets_iterator and an input of # asset_losses_per_site @@ -357,6 +357,7 @@ class RiskCalculatorTestCase(unittest.TestCase): def row_col(item): return item[0].row, item[0].column + self.job.oq_job_profile.region_grid_spacing = 0.01 self.job.oq_job_profile.save() calculator = general.BaseRiskCalculator(self.job)
all tests pass Former-commit-id: 5dd<I>bafacfae7dc6a<I>d7a<I>b5db<I>f
gem_oq-engine
train
py
1bdcf29e7141165009fe642d95950f3038b8e13e
diff --git a/src/Tokenizer.php b/src/Tokenizer.php index <HASH>..<HASH> 100644 --- a/src/Tokenizer.php +++ b/src/Tokenizer.php @@ -115,7 +115,7 @@ class Tokenizer } if ($prepend !== '' || $html[$i] !== '') { - $newTokens[] = new Token($prepend, '', $html[$i], clone $this->defaultCompressor); + $newTokens[] = new Token($prepend, '', '', clone $this->defaultCompressor); } return $newTokens;
Don't reinject $html[$i] into the HTML again
WyriHaximus_HtmlCompress
train
php
67ebfa0e80f4711bd19f99525b3c47bbfd71ad91
diff --git a/validate.go b/validate.go index <HASH>..<HASH> 100644 --- a/validate.go +++ b/validate.go @@ -552,13 +552,9 @@ func isTransactionSpent(txD *TxData) bool { func (b *BlockChain) checkBIP0030(node *blockNode, block *btcutil.Block) error { // Attempt to fetch duplicate transactions for all of the transactions // in this block from the point of view of the parent node. - fetchList, err := block.TxShas() - if err != nil { - return nil - } fetchSet := make(map[btcwire.ShaHash]bool) - for _, txHash := range fetchList { - fetchSet[*txHash] = true + for _, tx := range block.Transactions() { + fetchSet[*tx.Sha()] = true } txResults, err := b.fetchTxStore(node, fetchSet) if err != nil {
Update checkBIP<I> to not use deprecated function. Rather than using the deprecated TxShas function on a btcutil.Block, convert the checkBIP<I> to use the newer preferred method of ranging over the Transactions to obtain the cached hash of each transaction. This is also a little more efficient since it can avoid creating and caching an extra slice to keep the hashes in addition to having the hash cached with each transaction.
btcsuite_btcd
train
go
c10e18c0eb497588f0f2e27590a6f6c6a9d23563
diff --git a/flink-tests/src/test/java/org/apache/flink/test/recovery/TaskManagerProcessFailureBatchRecoveryITCase.java b/flink-tests/src/test/java/org/apache/flink/test/recovery/TaskManagerProcessFailureBatchRecoveryITCase.java index <HASH>..<HASH> 100644 --- a/flink-tests/src/test/java/org/apache/flink/test/recovery/TaskManagerProcessFailureBatchRecoveryITCase.java +++ b/flink-tests/src/test/java/org/apache/flink/test/recovery/TaskManagerProcessFailureBatchRecoveryITCase.java @@ -68,7 +68,7 @@ public class TaskManagerProcessFailureBatchRecoveryITCase extends AbstractTaskMa ExecutionEnvironment env = ExecutionEnvironment.createRemoteEnvironment("localhost", 1337, configuration); env.setParallelism(PARALLELISM); - env.setRestartStrategy(RestartStrategies.fixedDelayRestart(1, 0L)); + env.setRestartStrategy(RestartStrategies.fixedDelayRestart(2, 0L)); env.getConfig().setExecutionMode(executionMode); env.getConfig().disableSysoutLogging();
[FLINK-<I>][tests] Allow multiple restarts For some reason this test could fail multiple times, instead of just once.
apache_flink
train
java
75de099261c5c50cd7fa68edd280f63345b9e676
diff --git a/src/Aggregate/AggregateRepository.php b/src/Aggregate/AggregateRepository.php index <HASH>..<HASH> 100644 --- a/src/Aggregate/AggregateRepository.php +++ b/src/Aggregate/AggregateRepository.php @@ -184,6 +184,11 @@ class AggregateRepository return $eventSourcedAggregateRoot; } + public function aggregateType(): AggregateType + { + return $this->aggregateType; + } + /** * @param object $aggregateRoot */ diff --git a/src/Aggregate/SnapshotReadModel.php b/src/Aggregate/SnapshotReadModel.php index <HASH>..<HASH> 100644 --- a/src/Aggregate/SnapshotReadModel.php +++ b/src/Aggregate/SnapshotReadModel.php @@ -83,7 +83,7 @@ final class SnapshotReadModel implements ReadModel foreach ($this->aggregateCache as $aggregateRoot) { $snapshots[] = new Snapshot( - $aggregateRoot, + $this->aggregateRepository->aggregateType()->toString(), $this->aggregateTranslator->extractAggregateId($aggregateRoot), $aggregateRoot, $this->aggregateTranslator->extractAggregateVersion($aggregateRoot),
fix snapshotting resolves <URL>
prooph_event-sourcing
train
php,php
deedd0313203c1c8331f199d2d3a08b8dec43d4b
diff --git a/openid/server/server.py b/openid/server/server.py index <HASH>..<HASH> 100644 --- a/openid/server/server.py +++ b/openid/server/server.py @@ -814,7 +814,11 @@ class LowLevelServer(object): modulus = args.get('openid.dh_modulus') generator = args.get('openid.dh_gen') - dh = DiffieHellman.fromBase64(modulus, generator) + try: + dh = DiffieHellman.fromBase64(modulus, generator) + except ValueError: + err = "Please convert to two's complement correctly" + return self.postError(err) consumer_public = args.get('openid.dh_consumer_public') if consumer_public is None: @@ -822,6 +826,10 @@ class LowLevelServer(object): return self.postError(err) cpub = cryptutil.base64ToLong(consumer_public) + if cpub < 0: + err = "Please convert to two's complement correctly" + return self.postError(err) + mac_key = dh.xorSecret(cpub, assoc.secret) reply.update({
[project @ Handle badly-encoded bigintegers better]
openid_python-openid
train
py
000d66ece6e17fda2256d4ed58393ca498dd051d
diff --git a/src/Calendar/Calendar.php b/src/Calendar/Calendar.php index <HASH>..<HASH> 100644 --- a/src/Calendar/Calendar.php +++ b/src/Calendar/Calendar.php @@ -60,6 +60,11 @@ class Calendar implements CalendarInterface, \IteratorAggregate public function sort() { - + usort($this->events, function($event1, $event2) { + if($event1->getStartDateFull() == $event2->getStartDateFull()) { + return 0; + } + return $event1->getStartDateFull() < $event2->getStartDateFull() ? -1 : 1; + }); } } \ No newline at end of file
Provide sorting implementation for the calendar class.
benplummer_calendarful
train
php
ce3a61d5128cb4367f2aa39ea23c583e5c6abd3b
diff --git a/src/brackets.js b/src/brackets.js index <HASH>..<HASH> 100644 --- a/src/brackets.js +++ b/src/brackets.js @@ -254,6 +254,11 @@ define(function (require, exports, module) { // check once a day, plus 2 minutes, // as the check will skip if the last check was not -24h ago window.setInterval(UpdateNotification.checkForUpdate, 86520000); + + // Check for updates on App Ready + AppInit.appReady(function () { + UpdateNotification.checkForUpdate(); + }); } } diff --git a/src/utils/UpdateNotification.js b/src/utils/UpdateNotification.js index <HASH>..<HASH> 100644 --- a/src/utils/UpdateNotification.js +++ b/src/utils/UpdateNotification.js @@ -330,11 +330,6 @@ define(function (require, exports, module) { // Append locale to version info URL _versionInfoURL = brackets.config.update_info_url + brackets.getLocale() + ".json"; - - // Check for updates on App Ready - AppInit.appReady(function () { - checkForUpdate(); - }); // Define public API exports.checkForUpdate = checkForUpdate;
Moved the app ready block to the previous location
adobe_brackets
train
js,js
e246a55a42330bd493bbc346a22188c052451a47
diff --git a/test/full_test.py b/test/full_test.py index <HASH>..<HASH> 100755 --- a/test/full_test.py +++ b/test/full_test.py @@ -314,7 +314,7 @@ def run_all_tests(mode, checker, protocol, cores, slices): "cores" : cores, "slices" : slices, "suite-test" : suite_test}, - repeat=3, timeout=240) + repeat=3, timeout=300) # Canonical tests are included in all tests run_canonical_tests(mode, checker, protocol, cores, slices) diff --git a/test/integration/memcached_suite.py b/test/integration/memcached_suite.py index <HASH>..<HASH> 100755 --- a/test/integration/memcached_suite.py +++ b/test/integration/memcached_suite.py @@ -12,4 +12,4 @@ def test(opts, port): if __name__ == "__main__": op = make_option_parser() op["suite-test"] = StringFlag("--suite-test") - auto_server_test_main(test, op.parse(sys.argv), timeout=120) + auto_server_test_main(test, op.parse(sys.argv), timeout=180)
Increased the timeout of memcached_suite still more, because it still seems to be timing out.
rethinkdb_rethinkdb
train
py,py
4200804a98d7063505c59a06ef7f381e45287502
diff --git a/holoviews/core/settings.py b/holoviews/core/settings.py index <HASH>..<HASH> 100644 --- a/holoviews/core/settings.py +++ b/holoviews/core/settings.py @@ -173,9 +173,9 @@ class SettingsTree(AttrTree): if groups is None: raise ValueError('Please supply groups dictionary') self.__dict__['groups'] = groups - self.__dict__['instantiated'] = False + self.__dict__['_instantiated'] = False AttrTree.__init__(self, items, identifier, parent) - self.__dict__['instantiated'] = True + self.__dict__['_instantiated'] = True def _inherited_settings(self, group_name, settings): @@ -184,7 +184,7 @@ class SettingsTree(AttrTree): name from the current node given a new set of settings. """ override_kwargs = settings.kwargs - if not self.instantiated: + if not self._instantiated: override_kwargs['allowed_keywords'] = settings.allowed_keywords override_kwargs['viewable_name'] = settings.viewable_name
Renamed instantiated to _instantiated
pyviz_holoviews
train
py
f125ca02f20fd011bee9a9cd801a47ce1e82409e
diff --git a/src/controllers/IpController.php b/src/controllers/IpController.php index <HASH>..<HASH> 100644 --- a/src/controllers/IpController.php +++ b/src/controllers/IpController.php @@ -149,6 +149,11 @@ class IpController extends \hipanel\base\CrudController 'class' => SmartUpdateAction::class, 'scenario' => 'set-ptr', ], + 'set-note' => [ + 'class' => SmartUpdateAction::class, + 'success' => Yii::t('hipanel:hosting', 'Note changed'), + 'error' => Yii::t('hipanel:hosting', 'Failed to change note'), + ], ]; }
Added set-note action to IpController
hiqdev_hipanel-module-hosting
train
php
21be02a9ba7065f880d0f1f2dabc7e2c381e0d74
diff --git a/pyfastaq/runners/to_random_subset.py b/pyfastaq/runners/to_random_subset.py index <HASH>..<HASH> 100644 --- a/pyfastaq/runners/to_random_subset.py +++ b/pyfastaq/runners/to_random_subset.py @@ -11,7 +11,7 @@ def run(description): parser.add_argument('--mate_file', help='Name of mates file') parser.add_argument('infile', help='Name of input file') parser.add_argument('outfile', help='Name of output file') - parser.add_argument('percent', type=int, help='Per cent probability of keeping any given read (pair) in [0,100]', metavar='INT') + parser.add_argument('percent', type=float, help='Per cent probability of keeping any given read (pair) in [0,100]', metavar='FLOAT') options = parser.parse_args() seq_reader = sequences.file_reader(options.infile) @@ -27,7 +27,7 @@ def run(description): except StopIteration: print('Error! Didn\'t get mate for read', seq.id, file=sys.stderr) sys.exit(1) - if random.randint(0, 100) <= options.percent: + if 100 * random.random() <= options.percent: print(seq, file=fout) if options.mate_file: print(mate_seq, file=fout)
Allow percent to be float, not just int
sanger-pathogens_Fastaq
train
py
d013b42ab1234585ec5285ed21fef119d23fac8c
diff --git a/src/binwalk/core/settings.py b/src/binwalk/core/settings.py index <HASH>..<HASH> 100644 --- a/src/binwalk/core/settings.py +++ b/src/binwalk/core/settings.py @@ -66,8 +66,8 @@ class Settings: system_binarch = self._system_path(self.BINWALK_MAGIC_DIR, self.BINARCH_MAGIC_FILE) def list_files(dir_path): - # Restrict files list to names starting with an alphanumeric - return [os.path.join(dir_path, x) for x in os.listdir(dir_path) if x[0].isalnum()] + # Ignore hidden dotfiles. + return [os.path.join(dir_path, x) for x in os.listdir(dir_path) if not x.startswith('.')] if not system_only: user_dir = os.path.join(self.user_dir, self.BINWALK_USER_DIR, self.BINWALK_MAGIC_DIR)
Ignore dotfiles only while discovering magic files Some programs (which?) might create temporary files like `~name` or `_name`, but maybe there are people who actually rely on names like `_name`. Let's restrict the filter to just dotfiles for now.
ReFirmLabs_binwalk
train
py
cb7b7847c3324bb5dbbea5b9e185cece8eaf2b96
diff --git a/lib/mincer.js b/lib/mincer.js index <HASH>..<HASH> 100644 --- a/lib/mincer.js +++ b/lib/mincer.js @@ -2,7 +2,8 @@ // internal -var mixin = require('./mincer/common'); +var mixin = require('./mincer/common').mixin; +var prop = require('./mincer/common').prop; module.exports = { @@ -14,5 +15,8 @@ module.exports = { }; +prop(module.exports, '__engines__', {}); + + mixin(module.exports, require('./mincer/engines')); mixin(module.exports, require('./mincer/paths'));
Add some mixins to main lib
nodeca_mincer
train
js
4eb2778defb489e5489ad082b7b91a806d87c2d4
diff --git a/src/Concerns/InteractsWithWebsocket.php b/src/Concerns/InteractsWithWebsocket.php index <HASH>..<HASH> 100644 --- a/src/Concerns/InteractsWithWebsocket.php +++ b/src/Concerns/InteractsWithWebsocket.php @@ -277,7 +277,7 @@ trait InteractsWithWebsocket protected function bindWebsocket() { $this->app->singleton(Websocket::class, function ($app) { - return $this->websocket = new Websocket($app['swoole.room'], new Pipeline); + return $this->websocket = new Websocket($app['swoole.room'], new Pipeline($app)); }); $this->app->alias(Websocket::class, 'swoole.websocket'); }
fix pipeline in websocket
swooletw_laravel-swoole
train
php
7f8e4fa74d241d14746b17be1ed0d7d5c8c96d20
diff --git a/lib/mapnik.js b/lib/mapnik.js index <HASH>..<HASH> 100644 --- a/lib/mapnik.js +++ b/lib/mapnik.js @@ -32,6 +32,10 @@ function MapnikSource(uri, callback) { var source = cache[key]; if (!source.open) { source.once('open', callback); + source.once('error', function(err) { + cache[key] = false; + callback(err); + }); } else { callback(null, source); } @@ -67,7 +71,7 @@ MapnikSource.prototype._open = function(uri) { var source = this; function error(err) { process.nextTick(function() { - source.emit('open', err); + source.emit('error', err); }); }
Clear cache key on error to prevent dud source objects.
mapbox_tilelive-mapnik
train
js
2640d2f30c3d851b831343bec6dbf528f630a1fe
diff --git a/src/Output/QRImage.php b/src/Output/QRImage.php index <HASH>..<HASH> 100644 --- a/src/Output/QRImage.php +++ b/src/Output/QRImage.php @@ -32,20 +32,6 @@ use function array_values, base64_encode, call_user_func, count, extension_loade class QRImage extends QROutputAbstract{ /** - * @inheritDoc - * - * @throws \chillerlan\QRCode\QRCodeException - */ - public function __construct(SettingsContainerInterface $options, QRMatrix $matrix){ - - if(!extension_loaded('gd')){ - throw new QRCodeException('ext-gd not loaded'); // @codeCoverageIgnore - } - - parent::__construct($options, $matrix); - } - - /** * GD image types that support transparency * * @var string[] @@ -67,6 +53,20 @@ class QRImage extends QROutputAbstract{ /** * @inheritDoc + * + * @throws \chillerlan\QRCode\QRCodeException + */ + public function __construct(SettingsContainerInterface $options, QRMatrix $matrix){ + + if(!extension_loaded('gd')){ + throw new QRCodeException('ext-gd not loaded'); // @codeCoverageIgnore + } + + parent::__construct($options, $matrix); + } + + /** + * @inheritDoc */ protected function setModuleValues():void{
:shower: why is this where?
chillerlan_php-qrcode
train
php
9460f427dcd715cc77aa5fdae983dc6d88cf5fcc
diff --git a/mockserver-integration-testing/src/main/java/org/mockserver/integration/server/AbstractMockingIntegrationTestBase.java b/mockserver-integration-testing/src/main/java/org/mockserver/integration/server/AbstractMockingIntegrationTestBase.java index <HASH>..<HASH> 100644 --- a/mockserver-integration-testing/src/main/java/org/mockserver/integration/server/AbstractMockingIntegrationTestBase.java +++ b/mockserver-integration-testing/src/main/java/org/mockserver/integration/server/AbstractMockingIntegrationTestBase.java @@ -134,7 +134,7 @@ public abstract class AbstractMockingIntegrationTestBase { } else { for (int i = 0; i < httpRequestMatchers.length; i++) { if (!new HttpRequestMatcher(MOCK_SERVER_LOGGER, httpRequestMatchers[i]).matches(null, httpRequests[i])) { - throw new AssertionError("Request does not match request matcher, expected:<" + httpRequestMatchers[i] + "> but was:<" + httpRequests[i] + ">"); + throw new AssertionError("Request does not match request matcher, expected <" + httpRequestMatchers[i] + "> but was:<" + httpRequests[i] + ">, full list requests is: " + httpRequestMatchers); } } }
added extra output to attempt to resolve race conditions only affecting WAR deployments
jamesdbloom_mockserver
train
java
513563644e175e1bfccbaaa0b1d89e7f2613ce0a
diff --git a/lib/alchemy/upgrader/tasks/cells_upgrader.rb b/lib/alchemy/upgrader/tasks/cells_upgrader.rb index <HASH>..<HASH> 100644 --- a/lib/alchemy/upgrader/tasks/cells_upgrader.rb +++ b/lib/alchemy/upgrader/tasks/cells_upgrader.rb @@ -129,6 +129,7 @@ module Alchemy::Upgrader::Tasks Dir.glob("#{alchemy_views_folder}/**/*").each do |view| next if File.directory?(view) gsub_file(view, /render_cell[\(\s]?([:'"]?[a-z_]+['"]?)\)?/, 'render_elements(only: \1, fixed: true)') + gsub_file(view, /render_elements[\(\s](.*):?from_cell:?\s?(=>)?\s?['"]([a-z_]+)['"]\)?/, 'render_elements(\1only: \3, fixed: true)') end end
Enhance cells upgrader to deal with render_elements from_page: x This helps deal with some more complicated calls to `render_elements`.
AlchemyCMS_alchemy_cms
train
rb
c3b38fdc87402c46ac0d29b8696b75cd19ffa32d
diff --git a/pkg/moq/testpackages/samenameimport/samename.go b/pkg/moq/testpackages/samenameimport/samename.go index <HASH>..<HASH> 100644 --- a/pkg/moq/testpackages/samenameimport/samename.go +++ b/pkg/moq/testpackages/samenameimport/samename.go @@ -1,6 +1,6 @@ package samename -import samename "github.com/fvosberg/moq/pkg/moq/testpackages/samenameimport/samenameimport" +import samename "github.com/matryer/moq/pkg/moq/testpackages/samenameimport/samenameimport" // Example is used to test issues with packages, which import another package with the same name type Example interface {
[FIX] import path of test package
matryer_moq
train
go
20458b19121ab48ae870e5bb7bac3bae06e4ab30
diff --git a/lib/elastomer/version.rb b/lib/elastomer/version.rb index <HASH>..<HASH> 100644 --- a/lib/elastomer/version.rb +++ b/lib/elastomer/version.rb @@ -1,5 +1,5 @@ module Elastomer - VERSION = "0.9.0" + VERSION = "2.0.0" def self.version VERSION
Preparing release <I> This release of `elastomer-client` is now compatible with the ES 2.X main major version. The decision was made to sync up the client version number with the Elasticsearch version number - at least the major number. Hence the jump from <I> to <I>
github_elastomer-client
train
rb
09acfae48e4c14c392c7acde98d653c20c710506
diff --git a/tests/unit/modules/boto_secgroup.py b/tests/unit/modules/boto_secgroup.py index <HASH>..<HASH> 100644 --- a/tests/unit/modules/boto_secgroup.py +++ b/tests/unit/modules/boto_secgroup.py @@ -6,17 +6,16 @@ import string from collections import OrderedDict from copy import deepcopy -HAS_BOTO = True -HAS_MOTO = True - # import Python Third Party Libs try: import boto + HAS_BOTO = True except ImportError: HAS_BOTO = False try: from moto import mock_ec2 + HAS_MOTO = True except ImportError: HAS_MOTO = False diff --git a/tests/unit/modules/boto_vpc.py b/tests/unit/modules/boto_vpc.py index <HASH>..<HASH> 100644 --- a/tests/unit/modules/boto_vpc.py +++ b/tests/unit/modules/boto_vpc.py @@ -1,16 +1,15 @@ # -*- coding: utf-8 -*- -HAS_BOTO = True -HAS_MOTO = True - # import Python Third Party Libs try: import boto + HAS_BOTO = True except ImportError: HAS_BOTO = False try: from moto import mock_ec2 + HAS_MOTO = True except ImportError: HAS_MOTO = False
Bring the global variables more into their context
saltstack_salt
train
py,py
37160335b6c2b65b4d14e8fe6c77df21ddafac01
diff --git a/src/spec/gocli/integration/orphaned_disks_spec.rb b/src/spec/gocli/integration/orphaned_disks_spec.rb index <HASH>..<HASH> 100644 --- a/src/spec/gocli/integration/orphaned_disks_spec.rb +++ b/src/spec/gocli/integration/orphaned_disks_spec.rb @@ -99,7 +99,9 @@ describe 'orphaned disks', type: :integration do cpi_invocations = current_sandbox.cpi.invocations.drop(first_deploy_invocations.size) # does not attach disk again, delete_vm - expect(cpi_invocations.map(&:method_name)).to eq(['snapshot_disk', 'delete_vm', 'create_vm', 'set_vm_metadata', 'detach_disk']) + expect(cpi_invocations.map(&:method_name)).to eq( + %w[snapshot_disk detach_disk delete_vm create_vm set_vm_metadata detach_disk], + ) end it 'should orhpan disk' do
Add additional detach_disk call to expectation - Previously we relied on the IaaS to detach disks during VM deletion - We now detach the disk before deleting VM, to allow shared paths with hotswap, and enable IaaSes that want disks detached before deleting VMs [#<I>](<URL>)
cloudfoundry_bosh
train
rb
7d4f4261eb7e664bd58af3288fe6043e46d6a4ac
diff --git a/src/components/number.js b/src/components/number.js index <HASH>..<HASH> 100644 --- a/src/components/number.js +++ b/src/components/number.js @@ -48,6 +48,8 @@ module.exports = function(app) { '<form-builder-option property="customClass"></form-builder-option>' + '<form-builder-option property="tabindex"></form-builder-option>' + '<form-builder-option property="multiple"></form-builder-option>' + + '<form-builder-option property="protected"></form-builder-option>' + + '<form-builder-option property="persistent"></form-builder-option>' + '<form-builder-option property="disabled"></form-builder-option>' + '<form-builder-option property="tableView"></form-builder-option>' + '</ng-form>'
FOR-<I> - Adding protected and persistent field to number components.
formio_ngFormBuilder
train
js
910794d3fe14b08b5699fdd377d8493fe71abb29
diff --git a/src/Codeception/Module/WordPress.php b/src/Codeception/Module/WordPress.php index <HASH>..<HASH> 100644 --- a/src/Codeception/Module/WordPress.php +++ b/src/Codeception/Module/WordPress.php @@ -167,6 +167,7 @@ EOF; public function _failed(TestInterface $test, $fail) { + parent::_failed($test, $fail); } public function _after(TestInterface $test)
Added parent call in _failed hook
lucatume_wp-browser
train
php
d99d6faef0b00b256c69889fb112aa15277c1f37
diff --git a/structr/structr-rest/src/test/java/org/structr/rest/test/CollectionResourceBasicTest.java b/structr/structr-rest/src/test/java/org/structr/rest/test/CollectionResourceBasicTest.java index <HASH>..<HASH> 100644 --- a/structr/structr-rest/src/test/java/org/structr/rest/test/CollectionResourceBasicTest.java +++ b/structr/structr-rest/src/test/java/org/structr/rest/test/CollectionResourceBasicTest.java @@ -61,7 +61,7 @@ public class CollectionResourceBasicTest extends StructrRestTest { .expect() .statusCode(200) .body("result_count", equalTo(0)) - .body("query_time", lessThan("0.2")) + .body("query_time", lessThan("0.5")) .body("serialization_time", lessThan("0.001")) .when() .get("/test_objects");
Relaxed query time requirement in basic collection test.
structr_structr
train
java
346a4e626c6ec454475f5dd11482af0ca67ccddf
diff --git a/hazelcast/src/main/java/com/hazelcast/map/impl/client/MapClearRequest.java b/hazelcast/src/main/java/com/hazelcast/map/impl/client/MapClearRequest.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/map/impl/client/MapClearRequest.java +++ b/hazelcast/src/main/java/com/hazelcast/map/impl/client/MapClearRequest.java @@ -35,7 +35,6 @@ import java.util.Map; public class MapClearRequest extends MapAllPartitionsClientRequest implements Portable, RetryableRequest, SecureRequest { - public MapClearRequest() { } diff --git a/hazelcast/src/main/java/com/hazelcast/map/impl/client/MapLoadGivenKeysRequest.java b/hazelcast/src/main/java/com/hazelcast/map/impl/client/MapLoadGivenKeysRequest.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/map/impl/client/MapLoadGivenKeysRequest.java +++ b/hazelcast/src/main/java/com/hazelcast/map/impl/client/MapLoadGivenKeysRequest.java @@ -42,8 +42,6 @@ import java.util.Map; */ public class MapLoadGivenKeysRequest extends MapAllPartitionsClientRequest implements Portable, RetryableRequest, SecureRequest { - private String name; - private List<Data> keys; private boolean replaceExistingValues;
Removed shadow name since it is already defined in MapAllPartitionsClientRequest
hazelcast_hazelcast
train
java,java
ff7724ad069a558873541edd025d314ab4f83ae3
diff --git a/src/Common/AppInjectableInterface.php b/src/Common/AppInjectableInterface.php index <HASH>..<HASH> 100644 --- a/src/Common/AppInjectableInterface.php +++ b/src/Common/AppInjectableInterface.php @@ -4,8 +4,7 @@ namespace Anax\Common; /** * Interface for classes needing injection of the $app object - * containingframework resources. - * + * containing framework resources. */ interface AppInjectableInterface { diff --git a/src/Common/ConfigureInterface.php b/src/Common/ConfigureInterface.php index <HASH>..<HASH> 100644 --- a/src/Common/ConfigureInterface.php +++ b/src/Common/ConfigureInterface.php @@ -3,9 +3,7 @@ namespace Anax\Common; /** - * Interface for classes needing injection of the $app object - * containingframework resources. - * + * Interface for classes needing access to configuration files. */ interface ConfigureInterface {
Minor edit of docblock comment.
canax_common
train
php,php
1c429b27bc425aa8ba0f8cc6b43887cfb91dcd15
diff --git a/superset/models.py b/superset/models.py index <HASH>..<HASH> 100644 --- a/superset/models.py +++ b/superset/models.py @@ -1063,9 +1063,9 @@ class SqlaTable(Model, Queryable, AuditMixinNullable, ImportMixin): dttm_col = cols[granularity] time_grain = extras.get('time_grain_sqla') - timestamp = dttm_col.get_timestamp_expression(time_grain) if is_timeseries: + timestamp = dttm_col.get_timestamp_expression(time_grain) select_exprs += [timestamp] groupby_exprs += [timestamp] @@ -1119,7 +1119,7 @@ class SqlaTable(Model, Queryable, AuditMixinNullable, ImportMixin): qry = qry.limit(row_limit) - if timeseries_limit and groupby: + if is_timeseries and timeseries_limit and groupby: # some sql dialects require for order by expressions # to also be in the select clause inner_select_exprs += [main_metric_expr]
Fixing issue #<I> (#<I>)
apache_incubator-superset
train
py
857949575022946cc60c7cd1d0d088246d3f7540
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index <HASH>..<HASH> 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -627,7 +627,7 @@ class easy_install(Command): ) def easy_install(self, spec, deps=False): - tmpdir = tempfile.mkdtemp(prefix="easy_install-") + tmpdir = tempfile.mkdtemp(prefix=six.u("easy_install-")) if not self.editable: self.install_site_py()
Ensure that tmpdir is unicode. Fixes #<I>.
pypa_setuptools
train
py
9d3d390ae641e8ebc289b1d1173f741a21bd5bc9
diff --git a/test/utils/clearStorage.js b/test/utils/clearStorage.js index <HASH>..<HASH> 100644 --- a/test/utils/clearStorage.js +++ b/test/utils/clearStorage.js @@ -9,7 +9,10 @@ module.exports = function clearStorage(domain) { var localStorageFilename = myDomain.replace('://', '_').replace('/', '') + '_0.localstorage'; } else { var userName = system.env['USER']; - if(userName === "root"){ + if(system.os.name === 'mac') { + var localstoragePath = '/Users/' + userName + '/Library/Application Support/Ofi Labs/PhantomJS/'; + } + else if(userName === "root"){ var localstoragePath = '/root/.local/share/Ofi Labs/PhantomJS/'; } else{
Adding OSX support for clearStorage on PhantomJS
Countly_countly-sdk-web
train
js
da79f386f6e825afde9dad2f3708fd8287aad695
diff --git a/lib/assets/javascripts/_modules/search.js b/lib/assets/javascripts/_modules/search.js index <HASH>..<HASH> 100644 --- a/lib/assets/javascripts/_modules/search.js +++ b/lib/assets/javascripts/_modules/search.js @@ -71,6 +71,11 @@ $searchInput.focus(); hideResults(); }); + + // When selecting navigation link, close the search results. + $('.toc').on('click','a', function(e) { + hideResults(); + }) } function changeSearchLabel() {
Close search results on heading navigation. Fixes alphagov/tech-docs-template/issues/<I>.
alphagov_tech-docs-gem
train
js
74da384ce040521bf63e2fa003114943e5478191
diff --git a/scripts/build-storybooks.js b/scripts/build-storybooks.js index <HASH>..<HASH> 100755 --- a/scripts/build-storybooks.js +++ b/scripts/build-storybooks.js @@ -127,7 +127,11 @@ const handleExamples = async (deployables) => { } await exec(`yarn`, [`build-storybook`, `--output-dir=${out}`, '--quiet'], { cwd }); - await exec(`npx`, [`sb`, 'extract', out, `${out}/stories.json`], { cwd }); + + // If the example uses `storyStoreV7` or `buildStoriesJson`, stories.json already exists + if (!existsSync(`${out}/stories.json`)) { + await exec(`npx`, [`sb`, 'extract', out, `${out}/stories.json`], { cwd }); + } logger.log('-------'); logger.log(`✅ ${d} built`);
Don't generate stories.json if we don't have to
storybooks_storybook
train
js
0ac3fe300714da4f667c5244b7bd190383840d13
diff --git a/src/Oci8/Schema/OracleBuilder.php b/src/Oci8/Schema/OracleBuilder.php index <HASH>..<HASH> 100644 --- a/src/Oci8/Schema/OracleBuilder.php +++ b/src/Oci8/Schema/OracleBuilder.php @@ -64,6 +64,14 @@ class OracleBuilder extends Builder $callback($blueprint); + foreach($blueprint->getCommands() as $command) + { + if ($command->get('name') == 'drop') + { + $this->helper->dropAutoIncrementObjects($table); + } + } + $this->build($blueprint); $this->comment->setComments($blueprint);
Drop sequence if table is dropped through Blueprint
yajra_laravel-oci8
train
php
af5ef66f9936d63191a5a857f2aed4227aedb3bc
diff --git a/lib/zold/metronome.rb b/lib/zold/metronome.rb index <HASH>..<HASH> 100644 --- a/lib/zold/metronome.rb +++ b/lib/zold/metronome.rb @@ -75,8 +75,12 @@ module Zold start = Time.now @threads.each do |t| tstart = Time.now - t.join - @log.info("Thread #{t.name} finished in #{(Time.now - tstart).round(2)}s") + if t.join(60) + @log.info("Thread #{t.name} finished in #{(Time.now - tstart).round(2)}s") + else + t.exit + @log.info("Thread #{t.name} killed in #{(Time.now - tstart).round(2)}s") + end end @log.info("Metronome stopped in #{(Time.now - start).round(2)}s, #{@failures.count} failures") end
#<I> kill metronome threads in 1 minute
zold-io_zold
train
rb
ba94780802be9c8e9bcb7b2f06101fc11385b460
diff --git a/src/humaninput.js b/src/humaninput.js index <HASH>..<HASH> 100644 --- a/src/humaninput.js +++ b/src/humaninput.js @@ -115,8 +115,8 @@ class HumanInput extends EventHandler { } // These functions need to be bound to work properly ('this' will be window or this.elem which isn't what we want) - ['_composition', '_contextmenu', '_holdCounter', '_resetStates', - '_keydown', '_keypress', '_keyup', 'trigger'].forEach((event) => { + ['_composition', '_contextmenu', '_holdCounter', '_resetSeqTimeout', + '_resetStates', '_keydown', '_keypress', '_keyup', 'trigger'].forEach((event) => { this[event] = this[event].bind(this); });
Added _resetSeqTimeout() to the list of functions that get bound to the HumanInput instance when it gets instantiated. The reason being that it *may* matter depending on how and when a plugin calls that function. Best to be safe.
liftoff_HumanInput
train
js
ed68ba7de0687850eb7778d8f9ca3052fad9193b
diff --git a/lib/adhearsion/initializer/punchblock.rb b/lib/adhearsion/initializer/punchblock.rb index <HASH>..<HASH> 100644 --- a/lib/adhearsion/initializer/punchblock.rb +++ b/lib/adhearsion/initializer/punchblock.rb @@ -1,5 +1,3 @@ -require 'timeout' - module Adhearsion class Initializer class Punchblock
Remove a require we don't need
adhearsion_adhearsion
train
rb
f3d82ce3e23012be4223f16b1c18b8e3fcb288e6
diff --git a/cli/src/index.js b/cli/src/index.js index <HASH>..<HASH> 100644 --- a/cli/src/index.js +++ b/cli/src/index.js @@ -1,3 +1,7 @@ +/** + * @flow + */ + import {ArgumentParser} from 'argparse'; import loadConfig from './config'; @@ -64,6 +68,7 @@ function loadPlugins(config: Config): {[key: string]: SubCommand} { for (let pluginPath of config.plugins) { let module; try { + // $FlowFixMe: Flow wants this to be a literal. module = require(pluginPath); } catch (err) { log.warn(`Failed to load plugin: '${pluginPath}' (${err.message}) ${err.stack}`);
Enable Flow for all files in cli
silklabs_silk
train
js
e3ca9570a5da118fbf1f5a89ee6c5dfc6d1f9e37
diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index <HASH>..<HASH> 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -3814,6 +3814,7 @@ func IssueSSHCommand(cmd, provider string, node *v1.Node) error { // NewHostExecPodSpec returns the pod spec of hostexec pod func NewHostExecPodSpec(ns, name string) *v1.Pod { + immediate := int64(0) pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: name, @@ -3827,8 +3828,9 @@ func NewHostExecPodSpec(ns, name string) *v1.Pod { ImagePullPolicy: v1.PullIfNotPresent, }, }, - HostNetwork: true, - SecurityContext: &v1.PodSecurityContext{}, + HostNetwork: true, + SecurityContext: &v1.PodSecurityContext{}, + TerminationGracePeriodSeconds: &immediate, }, } return pod
Delete host exec pods rapidly For some tests this makes namespace deletion faster (we poll for resources at 1/2 their innate termination grace period), thus speeding up the test.
kubernetes_kubernetes
train
go
f2b4957f6d118bc18402f2a6d963c4d75e0a133f
diff --git a/src/builders/polylines.js b/src/builders/polylines.js index <HASH>..<HASH> 100644 --- a/src/builders/polylines.js +++ b/src/builders/polylines.js @@ -21,7 +21,7 @@ const JOIN_TYPE = { const DEFAULT_MITER_LIMIT = 3; const MIN_FAN_WIDTH = 5; // Width of line in tile units to place 1 triangle per fan -const TEXCOORD_NORMALIZE = 65536; // Scaling factor for UV attribute values +const TEXCOORD_NORMALIZE = 65535; // Scaling factor for UV attribute values // Scaling factor to add precision to line texture V coordinate packed as normalized short const V_SCALE_ADJUST = Geo.tile_scale;
don't overflow line texture U coordinate
tangrams_tangram
train
js
d16203a89ed9ac8af19f92a11e4c2cea48744d99
diff --git a/common/py_utils/PRESUBMIT.py b/common/py_utils/PRESUBMIT.py index <HASH>..<HASH> 100644 --- a/common/py_utils/PRESUBMIT.py +++ b/common/py_utils/PRESUBMIT.py @@ -3,6 +3,10 @@ # found in the LICENSE file. # pylint: disable=invalid-name + +USE_PYTHON3 = True + + def CheckChangeOnUpload(input_api, output_api): return _CommonChecks(input_api, output_api)
[code-health] Run common/py_utils/PRESUBMIT.py under Python 3 The code is already Python 3-compatible, this makes the presubmit itself run under Python 3. Bug: chromium:<I> Change-Id: I<I>d<I>e<I>e<I>d8ff<I>da<I>a7fc<I>aa<I>e3 Reviewed-on: <URL>
catapult-project_catapult
train
py
8b0b50e4943eaaf95632891dd3918dd577c29806
diff --git a/lib/draper.rb b/lib/draper.rb index <HASH>..<HASH> 100644 --- a/lib/draper.rb +++ b/lib/draper.rb @@ -9,13 +9,3 @@ require 'draper/decorated_enumerable_proxy' require 'draper/rspec_integration' if defined?(RSpec) and RSpec.respond_to?(:configure) require 'draper/railtie' if defined?(Rails) -if defined?(Rails) - module ActiveModel - class Railtie < Rails::Railtie - generators do |app| - Rails::Generators.configure!(app.config.generators) - require "generators/resource_override" - end - end - end -end diff --git a/lib/draper/railtie.rb b/lib/draper/railtie.rb index <HASH>..<HASH> 100644 --- a/lib/draper/railtie.rb +++ b/lib/draper/railtie.rb @@ -1,5 +1,14 @@ require 'rails/railtie' +module ActiveModel + class Railtie < Rails::Railtie + generators do |app| + Rails::Generators.configure!(app.config.generators) + require "generators/resource_override" + end + end +end + module Draper class Railtie < Rails::Railtie
Move that railtie to where it belongs
drapergem_draper
train
rb,rb
44720726b67b247071aba1c69f8bd16a7b3781ee
diff --git a/nodes/config-server/config-server.js b/nodes/config-server/config-server.js index <HASH>..<HASH> 100644 --- a/nodes/config-server/config-server.js +++ b/nodes/config-server/config-server.js @@ -212,6 +212,7 @@ module.exports = function(RED) { getFromContext(key) { let haCtx = this.context().global.get('homeassistant'); + haCtx = haCtx || {}; return haCtx[this.nameAsCamelcase] ? haCtx[this.nameAsCamelcase][key] : null;
fix(config-server): trying to get global namespace before it created
zachowj_node-red-contrib-home-assistant-websocket
train
js
f7139defb81c3af0fa9e248c8e215e9229628393
diff --git a/src/modules/promise.js b/src/modules/promise.js index <HASH>..<HASH> 100755 --- a/src/modules/promise.js +++ b/src/modules/promise.js @@ -42,7 +42,7 @@ var propagateResults = function(callback, deferred) { }; }; -var createPromise = function(fn) { +var createPromise = function() { var deferred = {}; var state = PENDING_STATE; var result = null; @@ -105,9 +105,6 @@ var createPromise = function(fn) { deferred.reject = fail[1 /*fire*/ ]; promise.promise(deferred); - if (fn) { - fn.call(deferred, deferred); - } return deferred; };
Removing an unused feature in promise.js.
ariatemplates_noder-js
train
js
d75adc27a02020d0ca1a78688b5edfe0b2a18dca
diff --git a/modules/custom/social_demo/src/DemoContentParser.php b/modules/custom/social_demo/src/DemoContentParser.php index <HASH>..<HASH> 100644 --- a/modules/custom/social_demo/src/DemoContentParser.php +++ b/modules/custom/social_demo/src/DemoContentParser.php @@ -25,7 +25,7 @@ class DemoContentParser extends Yaml implements DemoContentParserInterface { * {@inheritdoc} */ public function parseFile($file, $module, $profile) { - return $this->parse($this->getPath($file, $module, $profile)); + return $this->parse(file_get_contents($this->getPath($file, $module, $profile))); } }
d<I> by jochemvn: Yml parser now expects yml instead of a yml file
goalgorilla_open_social
train
php
4c9973387932674f89f49276dfc26008dedeeb48
diff --git a/lib/cloud_formation_tool/cloud_formation/stack.rb b/lib/cloud_formation_tool/cloud_formation/stack.rb index <HASH>..<HASH> 100644 --- a/lib/cloud_formation_tool/cloud_formation/stack.rb +++ b/lib/cloud_formation_tool/cloud_formation/stack.rb @@ -101,6 +101,14 @@ module CloudFormationTool def asgroups resources.select do |res| res.resource_type == 'AWS::AutoScaling::AutoScalingGroup' + end.collect do |res| + res.extend(CloudFormationTool) + res.instance_eval do + def group + Aws::AutoScaling::AutoScalingGroup.new(self.physical_resource_id, client: awsas).reload + end + end + res end end
expose group instasnce from asgroups resources
GreenfieldTech_cloudformation-tool
train
rb
3461e05c367e96c9035b1a1574c42753557efe7f
diff --git a/code/object/bootstrapper/bootstrapper.php b/code/object/bootstrapper/bootstrapper.php index <HASH>..<HASH> 100644 --- a/code/object/bootstrapper/bootstrapper.php +++ b/code/object/bootstrapper/bootstrapper.php @@ -192,7 +192,7 @@ final class KObjectBootstrapper extends KObject implements KObjectBootstrapperIn $identifiers[$priority] = array(); } - $identifiers[$priority] = array_replace_recursive($identifiers[$priority], $array['identifiers']);; + $identifiers[$priority] = array_merge_recursive($identifiers[$priority], $array['identifiers']);; } } @@ -205,7 +205,7 @@ final class KObjectBootstrapper extends KObject implements KObjectBootstrapperIn krsort($identifiers); foreach ($identifiers as $priority => $merges) { - $identifiers_flat = array_replace_recursive($identifiers_flat, $merges); + $identifiers_flat = array_merge_recursive($identifiers_flat, $merges); } foreach ($identifiers_flat as $identifier => $config) {
Use array_merge_recursive to prevent overwritting values.
timble_kodekit
train
php
ddfd4c08e536130809fdcb7e1b8f8d8b13df2cd7
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -12,6 +12,7 @@ const PostcssCompiler = require('broccoli-postcss-single') function PostcssPlugin (addon) { this.name = 'ember-cli-postcss' this.addon = addon + this.ext = ['css', 'less', 'styl', 'scss', 'sass'] } PostcssPlugin.prototype.toTree = function (tree, inputPath, outputPath, inputOptions) {
allow more file extensions to be used and imported
jeffjewiss_ember-cli-postcss
train
js
22829434d4889d3e1b2c17b57ca5e575f3b87495
diff --git a/src/info.js b/src/info.js index <HASH>..<HASH> 100644 --- a/src/info.js +++ b/src/info.js @@ -107,6 +107,8 @@ const getInfoFromURL = (url) => { reject(new Error('[Mal-Scraper]: Invalid Url.')) } + url = encodeURI(url) + axios.get(url) .then(({data}) => { const res = parsePage(data)
Fixed a bug where getInfoFromURL would throw an UNESCAPEDCHAR error
Kylart_MalScraper
train
js
b043bfde0b419027c5a03e5181d5e5cfc38b985c
diff --git a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php +++ b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php @@ -128,7 +128,7 @@ class HttpKernel extends BaseHttpKernel } try { - $response = $this->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true); + $response = $this->handle($subRequest, HttpKernelInterface::SUB_REQUEST, false); if (!$response->isSuccessful()) { throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $request->getUri(), $response->getStatusCode()));
Do not catch subrequest exceptions, because it makes debugging hard.
symfony_symfony
train
php
29f01a71af4f58b609c4bac1c41fe9ae5c70a445
diff --git a/src/Web.php b/src/Web.php index <HASH>..<HASH> 100644 --- a/src/Web.php +++ b/src/Web.php @@ -160,10 +160,12 @@ class Web */ public function loadEnvironment($env_file) { + $env_file .= '.php'; if (!file_exists($env_file)) { return $this; } - $environments = (array)$this->configure($env_file); + /** @noinspection PhpIncludeInspection */ + $environments = (array)include($env_file); foreach ($environments as $env) { $this->configure($this->config_dir . "/{$env}/configure"); }
not to use configure to load environments (which throws an exception); just include it.
TuumPHP_Web
train
php
1c894458064b8073767e6aa401eeac02f6765b72
diff --git a/js/bootstrap-select.js b/js/bootstrap-select.js index <HASH>..<HASH> 100644 --- a/js/bootstrap-select.js +++ b/js/bootstrap-select.js @@ -1401,6 +1401,8 @@ inlineStyle = cssText ? htmlEscape(cssText) : '', optionClass = (option.className || '') + (config.optgroupClass || ''); + if (config.optID) optionClass = 'opt ' + optionClass; + config.text = option.textContent; config.content = option.getAttribute('data-content'); @@ -1415,7 +1417,7 @@ generateOption.li( generateOption.a( textElement, - 'opt ' + optionClass, + optionClass, inlineStyle ), '',
only add opt class to option if it's in an optgroup
snapappointments_bootstrap-select
train
js
50321d43ccd12e456eea32efe27e371de30ccd7e
diff --git a/lib/browser/managed-upload.js b/lib/browser/managed-upload.js index <HASH>..<HASH> 100644 --- a/lib/browser/managed-upload.js +++ b/lib/browser/managed-upload.js @@ -283,12 +283,6 @@ proto._createStream = function _createStream(file, start, end) { if (isBlob(file) || isFile(file)) { return new WebFileReadStream(file.slice(start, end)); } - // else if (is.string(file)) { - // return fs.createReadStream(file, { - // start: start, - // end: end - 1 - // }); - // } throw new Error('_createStream requires File/Blob.'); }; diff --git a/lib/managed-upload.js b/lib/managed-upload.js index <HASH>..<HASH> 100644 --- a/lib/managed-upload.js +++ b/lib/managed-upload.js @@ -253,7 +253,9 @@ WebFileReadStream.prototype._read = function _read(size) { }; proto._createStream = function _createStream(file, start, end) { - if (isFile(file)) { + if (is.readableStream(file)) { + return file; + } else if (isFile(file)) { return new WebFileReadStream(file.slice(start, end)); } else if (is.string(file)) { return fs.createReadStream(file, {
feat(node): uploadPart support file stream (#<I>)
ali-sdk_ali-oss
train
js,js
61ee24f3471a6a479b9e3fa57944cbd6e4c6a46c
diff --git a/chess/engine.py b/chess/engine.py index <HASH>..<HASH> 100644 --- a/chess/engine.py +++ b/chess/engine.py @@ -1568,7 +1568,7 @@ class XBoardProtocol(EngineProtocol): def line_received(self, engine, line): if line == self.pong: self.set_finished() - else: + elif not line.startswith("#"): LOGGER.warning("%s: Unexpected engine output: %s", engine, line) return (yield from self.communicate(Command))
ignore xboard debug output while waiting for pong
niklasf_python-chess
train
py
cbae3f3da1cb9d7ac2b0e7b1d4c6bfc21ae0e79c
diff --git a/widgets.py b/widgets.py index <HASH>..<HASH> 100644 --- a/widgets.py +++ b/widgets.py @@ -48,9 +48,11 @@ class Dialog(Widget): return None, None def find_focusable_by_xy(self, x, y): + i = 0 for w in self.childs: if w.focusable and w.inside(x, y): - return w + return i, w + i += 1 def loop(self): self.autosize() @@ -94,7 +96,7 @@ class Dialog(Widget): def handle_mouse(self, x, y): # Work in absolute coordinates if self.inside(x, y): - w = self.find_focusable_by_xy(x, y) + self.focus_idx, w = self.find_focusable_by_xy(x, y) # print(w) if w: self.change_focus(w)
widgets: Dialog: Properly update focus index for mouse navigation.
pfalcon_picotui
train
py
7eb92cd94112e886add146c50df6668959d4e977
diff --git a/lib/wed/modes/generic/generic.js b/lib/wed/modes/generic/generic.js index <HASH>..<HASH> 100644 --- a/lib/wed/modes/generic/generic.js +++ b/lib/wed/modes/generic/generic.js @@ -32,7 +32,7 @@ function GenericMode () { Mode.apply(this, arguments); this._resolver = new util.NameResolver(); this._meta = new this._options.meta.Meta(); - this._tr = new Registry(); + this._tr = this._getTransformationRegistry(); } oop.inherit(GenericMode, Mode); @@ -80,6 +80,23 @@ GenericMode.prototype.nodesAroundEditableContents = function (parent) { return ret; }; +var registry; + +/** + * Modes that derive from this mode should override this function to + * enable the creation of the correct registry needed by the mode. + * + * @returns {module:transformation~TransformationRegistry} A registry + * to use for this mode. The value returned here must be treated as + * immutable. This may be a singleton if the registry happens to be + * independent of context. + */ +GenericMode.prototype._getTransformationRegistry = function () { + if (!registry) + registry = new Registry(); + return registry; +}; + exports.Mode = GenericMode; });
Generic mode now uses _getTransformationRegistry to allow derived classes to provide their own registries.
mangalam-research_wed
train
js
7d1d786a45479300ae5b88ba5869d977cd5aee2d
diff --git a/openquake/calculators/post_risk.py b/openquake/calculators/post_risk.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/post_risk.py +++ b/openquake/calculators/post_risk.py @@ -180,12 +180,12 @@ class PostRiskCalculator(base.RiskCalculator): self.build_datasets(builder, oq.aggregate_by, 'agg_') self.build_datasets(builder, [], 'app_') self.build_datasets(builder, [], 'tot_') - ds = (self.datastore.parent if oq.hazard_calculation_id - else self.datastore) + ds = self.datastore + full_aggregate_by = (ds.parent['oqparam'].aggregate_by if ds.parent + else oq.aggregate_by) if oq.aggregate_by: - aggkeys = sorted(ds['event_loss_table']) aggkeys = build_aggkeys(oq.aggregate_by, self.tagcol, - ds['oqparam'].aggregate_by) + full_aggregate_by) if not oq.hazard_calculation_id: # no parent ds.swmr_on() smap = parallel.Starmap(
Fixed a small regression in ebrisk
gem_oq-engine
train
py
4cbf9a8bb16aa9af8ec347156e5b44d9f5900a06
diff --git a/ella/photos/admin.py b/ella/photos/admin.py index <HASH>..<HASH> 100644 --- a/ella/photos/admin.py +++ b/ella/photos/admin.py @@ -74,6 +74,13 @@ class PhotoOptions(EllaAdminOptionsMixin, admin.ModelAdmin): return super(PhotoOptions, self).__call__(request, url) + + def queryset(self, request): + return super(PhotoOptions, self).queryset(request).filter(width__gt=100, height__gt=100) + + + + class FormatedPhotoOptions(EllaAdminOptionsMixin, admin.ModelAdmin): base_form = FormatedPhotoForm list_display = ('image', 'format', 'width', 'height')
PhotoOptions@admin: queryset to show only photos with {width, height}><I>px
ella_ella
train
py
cf78b862675a635a7acb4b3efd8faf718b65ecc9
diff --git a/config/ember-try.js b/config/ember-try.js index <HASH>..<HASH> 100644 --- a/config/ember-try.js +++ b/config/ember-try.js @@ -6,6 +6,12 @@ module.exports = { dependencies: { } }, { + name: 'ember 1.13.x series', + dependencies: { + 'ember': '1.13.x' + } + }, + { name: 'ember-release', dependencies: { 'ember': 'components/ember#release'
Added <I>.x scenario to ember-try
sethbrasile_ember-remodal
train
js
db43632907db9514e2b9051388fe1cf6482fcf7b
diff --git a/constance/apps.py b/constance/apps.py index <HASH>..<HASH> 100644 --- a/constance/apps.py +++ b/constance/apps.py @@ -1,6 +1,6 @@ from django.apps import AppConfig from constance.config import Config -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ class ConstanceConfig(AppConfig): name = 'constance'
Fixed AppRegistryNotReady exception on runserver on Django <I>rc2.
jazzband_django-constance
train
py
35c2a7b33ae580f44dfda7788a07c5668f29b04a
diff --git a/geoviews/element/geo.py b/geoviews/element/geo.py index <HASH>..<HASH> 100644 --- a/geoviews/element/geo.py +++ b/geoviews/element/geo.py @@ -239,7 +239,6 @@ class Image(_Element, HvImage): group = param.String(default='Image') - class QuadMesh(_Element, HvQuadMesh): """ QuadMesh is a Raster type to hold x- and y- bin values @@ -262,6 +261,8 @@ class QuadMesh(_Element, HvQuadMesh): _binned = True + def trimesh(self): + return super(QuadMesh, self).trimesh().clone(crs=self.crs) class RGB(_Element, HvRGB):
Correctly subclassed QuadMesh.trimesh method
pyviz_geoviews
train
py
6c6b14f3bb45ffb9456c9d5e66e91d0bad5be950
diff --git a/src/main/webapp/js/Plugins/shapemenu.js b/src/main/webapp/js/Plugins/shapemenu.js index <HASH>..<HASH> 100644 --- a/src/main/webapp/js/Plugins/shapemenu.js +++ b/src/main/webapp/js/Plugins/shapemenu.js @@ -706,11 +706,14 @@ ORYX.Plugins.ShapeMenuPlugin = { stencil.properties().each((function(prop) { if(prop.readonly()) { serialized = serialized.reject(function(serProp) { + if(serProp.prefix === "oryx" && ( serProp.name === "type" || serProp.name === "tasktype")) { + return true; + } return serProp.name==prop.id(); }); } }).bind(this)); - + // Get shape if already created, otherwise create a new shape if (this.newShape){ newShape = this.newShape; @@ -814,7 +817,8 @@ ORYX.Plugins.ShapeMenuPlugin = { if(newShape.getStencil().property("oryx-bgcolor")){ newShape.setProperty("oryx-bgcolor", newShape.getStencil().property("oryx-bgcolor").value()); } - } + } + if(changedBounds !== null) { newShape.bounds.set(changedBounds); }
rejecting type and tasktype during shape morphing
kiegroup_jbpm-designer
train
js
f076a8dc2c60edff62a93ddb1abd0b32801a44e5
diff --git a/core/spec/controllers/refinery/admin/dummy_controller_spec.rb b/core/spec/controllers/refinery/admin/dummy_controller_spec.rb index <HASH>..<HASH> 100644 --- a/core/spec/controllers/refinery/admin/dummy_controller_spec.rb +++ b/core/spec/controllers/refinery/admin/dummy_controller_spec.rb @@ -2,6 +2,14 @@ require "spec_helper" module Refinery module Admin + class Engine < ::Rails::Engine + isolate_namespace Refinery::Admin + end + + Engine.routes.draw do + resources :dummy + end + class DummyController < Refinery::AdminController def index render :nothing => true @@ -13,6 +21,8 @@ end module Refinery module Admin describe DummyController, :type => :controller do + routes { Refinery::Admin::Engine.routes } + context "as refinery user" do refinery_login_with :refinery
Make dummy controller work without deprecation warnings
refinery_refinerycms
train
rb
79aac8872f7e3fc212d3849f6611ac23fe29e57e
diff --git a/view/attachments/tmpl/manage.html.php b/view/attachments/tmpl/manage.html.php index <HASH>..<HASH> 100644 --- a/view/attachments/tmpl/manage.html.php +++ b/view/attachments/tmpl/manage.html.php @@ -19,8 +19,7 @@ $component = isset($component) ? $component : substr($query['option'], 4); $callback = isset($query['callback']) ? $query['callback'] : null; ?> -<?= helper('bootstrap.load', array('class' => array('full_height', 'com_files--attachments'))); ?> -<?= helper('behavior.jquery'); ?> +<?= helper('behavior.ui', array('wrapper_class' => array('com_files--attachments'))); ?> <?= import('com:files.files.scripts.html'); ?>
Replace bootstrap.load calls with behavior.ui
joomlatools_joomlatools-framework
train
php
70ffdf6a4ea328745823c036f28596c1a946c181
diff --git a/taskforce/task.py b/taskforce/task.py index <HASH>..<HASH> 100644 --- a/taskforce/task.py +++ b/taskforce/task.py @@ -2365,9 +2365,9 @@ Params are: for event in self._config_running.get('events', []): ev_type = self._get(event.get('type')) if resetting and ev_type == 'restart': - restart_target = self._make_event_target(event) + restart_target = self._make_event_target(event, control) elif ev_type == 'stop': - stop_target = self._make_event_target(event) + stop_target = self._make_event_target(event, control) if restart_target: log.debug("%s Restart event on %d '%s' process%s", my(self), running, self._name, ses(running, 'es'))
incorrect calls to _make_event_target() in task stop
akfullfo_taskforce
train
py
3d9d62628c4fb1a651118913a8d684ae95af514e
diff --git a/spyderlib/utils/icon_manager.py b/spyderlib/utils/icon_manager.py index <HASH>..<HASH> 100644 --- a/spyderlib/utils/icon_manager.py +++ b/spyderlib/utils/icon_manager.py @@ -73,7 +73,7 @@ _qtaargs = { 'terminated': [('fa.circle',), {}], 'cmdprompt': [('fa.terminal',), {}], 'cmdprompt_t': [('fa.terminal',), {'color':'gray'}], - 'console': [('fa.terminal',), {}], + 'console': [('spyder.python-logo-up', 'spyder.python-logo-down'), {'options': [{'color': '#3775a9'}, {'color': '#ffd444'}]}], 'findf': [('fa.file-o', 'fa.search'), {'options': [{'scale_factor': 1.0}, {'scale_factor': 0.6}]}], 'history24': [('fa.history',), {}], 'history': [('fa.history',), {}],
Use python logo for console configuration
spyder-ide_spyder
train
py
2fb74325eb7369186a218c63f327d3428666c71d
diff --git a/tests/test_graph_api.py b/tests/test_graph_api.py index <HASH>..<HASH> 100644 --- a/tests/test_graph_api.py +++ b/tests/test_graph_api.py @@ -93,9 +93,6 @@ def test_get_with_appsecret(): graph.get('me') - def generate_appsecret_proof(appsecret, access_token): - return hmac.new(appsecret, access_token, hashlib.sha256).hexdigest() - mock_request.assert_called_with( 'GET', 'https://graph.facebook.com/me', @@ -103,7 +100,7 @@ def test_get_with_appsecret(): verify=True, params={ 'access_token': '<access token>', - 'appsecret_proof': generate_appsecret_proof('<appsecret>', '<access token>') + 'appsecret_proof': graph._generate_appsecret_proof() } )
Refactor tests to cover GraphAPI#_generate_appsecret_proof
jgorset_facepy
train
py
d309677f9dd631b6a956659dd45ef91e4944656d
diff --git a/pygerrit/stream.py b/pygerrit/stream.py index <HASH>..<HASH> 100644 --- a/pygerrit/stream.py +++ b/pygerrit/stream.py @@ -83,13 +83,12 @@ class GerritStream(Thread): while not self._stop.is_set(): data = poller.poll() for (handle, event) in data: - if handle == stdout.channel.fileno(): - if event == POLLIN: - try: - line = stdout.readline() - json_data = json.loads(line) - self._gerrit.put_event(json_data) - except (ValueError, IOError), err: - self._error_event(err) - except GerritError, err: - logging.error("Failed to put event: %s", err) + if handle == stdout.channel.fileno() and event == POLLIN: + try: + line = stdout.readline() + json_data = json.loads(line) + self._gerrit.put_event(json_data) + except (ValueError, IOError), err: + self._error_event(err) + except GerritError, err: + logging.error("Failed to put event: %s", err)
Reduce nested `if` blocks in stream handling Change-Id: I<I>fb6b<I>da<I>ede<I>d<I>b5b7d0aff<I>
dpursehouse_pygerrit2
train
py
971d257cddd271e1faec8ae1762915c4c27b2908
diff --git a/activesupport/lib/active_support/testing/performance.rb b/activesupport/lib/active_support/testing/performance.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/testing/performance.rb +++ b/activesupport/lib/active_support/testing/performance.rb @@ -161,8 +161,7 @@ module ActiveSupport end end - ruby = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby' - ruby += "-#{RUBY_VERSION}.#{RUBY_PATCHLEVEL}" + ruby = "#{RUBY_ENGINE}-#{RUBY_VERSION}.#{RUBY_PATCHLEVEL}" @env = [app, rails, ruby, RUBY_PLATFORM] * ',' end @@ -259,7 +258,6 @@ module ActiveSupport end end -RUBY_ENGINE = 'ruby' unless defined?(RUBY_ENGINE) # mri 1.8 case RUBY_ENGINE when 'ruby' then require 'active_support/testing/performance/ruby' when 'rbx' then require 'active_support/testing/performance/rubinius'
Removed RUBY_ENGINE checks for ruby<I>
rails_rails
train
rb
33240a6545efb42cc6d11ae27c92072f56fa610d
diff --git a/src/dependencies/_package.py b/src/dependencies/_package.py index <HASH>..<HASH> 100644 --- a/src/dependencies/_package.py +++ b/src/dependencies/_package.py @@ -5,15 +5,15 @@ from ._this import random_string class Package(object): def __init__(self, name): - self.__name = name + self.__name__ = name def __getattr__(self, attrname): - return Package(self.__name + "." + attrname) + return Package(self.__name__ + "." + attrname) def resolve_package_link(package, injector): - names = package._Package__name.split(".") + names = package.__name__.split(".") modulename, attributes = names[0], names[1:] result = importlib.import_module(modulename) do_import = True
Dependencies package is using dunder names.
dry-python_dependencies
train
py
5f1f31a39706ee3f4fe9079c93f14403337eaa85
diff --git a/lib/cronofy/client.rb b/lib/cronofy/client.rb index <HASH>..<HASH> 100644 --- a/lib/cronofy/client.rb +++ b/lib/cronofy/client.rb @@ -782,14 +782,9 @@ module Cronofy # Raises Cronofy::TooManyRequestsError if the request exceeds the rate # limits for the application. def add_to_calendar(args = {}) - body = { - client_id: @client_id, - client_secret: @client_secret, - oauth: args[:oauth], - event: args[:event], - } + body = args.merge(client_id: @client_id, client_secret: @client_secret) - if availability = args[:availability] + if availability = body[:availability] availability[:participants] = map_availability_participants(availability[:participants]) availability[:required_duration] = map_availability_required_duration(availability[:required_duration]) @@ -797,8 +792,6 @@ module Cronofy body[:availability] = availability end - body[:target_calendars] = args[:target_calendars] if args[:target_calendars] - body[:event][:start] = encode_event_time(body[:event][:start]) if body[:event][:start] body[:event][:end] = encode_event_time(body[:event][:end]) if body[:event][:end]
Merge hash args rather than whitelisting
cronofy_cronofy-ruby
train
rb
5c46252e4468e5dcbf4b0cd5291392ebca033dcc
diff --git a/lib-app/src/main/java/xdroid/app/FragmentExt.java b/lib-app/src/main/java/xdroid/app/FragmentExt.java index <HASH>..<HASH> 100644 --- a/lib-app/src/main/java/xdroid/app/FragmentExt.java +++ b/lib-app/src/main/java/xdroid/app/FragmentExt.java @@ -87,4 +87,47 @@ public class FragmentExt extends Fragment implements ActivityStarter, ContextOwn return null; } + + @Override + public void onStart() { + super.onStart(); + + ActionBar ab = getActionBar(); + if (ab != null) { + onInitActionBar(ab); + } + } + + @Override + public void onStop() { + ActionBar ab = getActionBar(); + if (ab != null) { + onRestoreActionBar(ab); + } + + super.onStop(); + } + + protected void invalidateActionBar() { + ActionBar ab = getActionBar(); + if (ab != null) { + onRestoreActionBar(ab); + onInitActionBar(ab); + } + } + + protected void onInitActionBar(ActionBar ab) { + // for inheritors + } + + protected void onRestoreActionBar(ActionBar ab) { + // for inheritors + } + + protected void invalidateOptionsMenu() { + Activity activity = getActivity(); + if (activity != null) { + activity.invalidateOptionsMenu(); + } + } }
Lib-App: added methods which allows to init ActionBar from Fragment.
shamanland_xdroid
train
java
4965c8660671a07db9daa7ca7e9fadc50ae073d6
diff --git a/cbamf/logger.py b/cbamf/logger.py index <HASH>..<HASH> 100644 --- a/cbamf/logger.py +++ b/cbamf/logger.py @@ -204,13 +204,19 @@ def add_handler(log, name='console-color', level='info', formatter='standard', * handler.setFormatter(logging.Formatter(formatters[formatter])) log.addHandler(handler) +def sanitize(v): + num = len(v) + num = min(max([0, num]), 5) + return 'v'*num + lexer = LogLexer() log = logging.getLogger('cbamf') log.setLevel(1) conf = conf.load_conf() -level = v2l.get(conf.get('verbosity'), 'info') -form = v2f.get(conf.get('verbosity'), 'standard') +verbosity = sanitize(conf.get('verbosity')) +level = v2l.get(verbosity, 'info') +form = v2f.get(verbosity, 'standard') color = 'console-color' if conf.get('log-colors') else 'console-bw' if conf.get('log-to-file'):
sanitize verbosity to allowed values
peri-source_peri
train
py
24614137f8c2b5ea1f321878450a01bcb24aa949
diff --git a/http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java b/http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java index <HASH>..<HASH> 100644 --- a/http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java +++ b/http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java @@ -276,7 +276,7 @@ class RoutingInBoundHandler extends SimpleChannelInboundHandler<io.micronaut.htt public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { NettyHttpRequest nettyHttpRequest = NettyHttpRequest.remove(ctx); if (nettyHttpRequest == null) { - if (cause instanceof SSLException || cause.getCause() instanceof SSLException) { + if (cause instanceof SSLException || cause.getCause() instanceof SSLException || isIgnorable(cause)) { if (LOG.isDebugEnabled()) { LOG.debug("Micronaut Server Error - No request state present. Cause: " + cause.getMessage(), cause); }
Also handle ignorable exceptions for no request state errors. Fixes #<I> (#<I>)
micronaut-projects_micronaut-core
train
java