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
1adfcd8f343c2169282a5a6b23fb462019c94ddf
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -166,7 +166,7 @@ def setupNupic(): "Topic :: Scientific/Engineering :: Artificial Intelligence" ], long_description = """\ -Numenta Platform for Intelligent Computing: a brain-inspired machine intelligence platform, and biologically accurate neural network based on cortical learning algorithms. +Numenta Platform for Intelligent Computing: a machine intelligence platform that implements the HTM learning algorithms. HTM is a detailed computational theory of the neocortex. At the core of HTM are time-based continuous learning algorithms that store and recall spatial and temporal patterns. NuPIC is suited to a variety of problems, particularly anomaly detection and prediction of streaming data sources. For more information, see http://numenta.org or the NuPIC wiki at https://github.com/numenta/nupic/wiki. """
Using text from numenta.com for description
numenta_nupic
train
py
b959be6c3e3d27ff071b59aec8e82cca4660ba9a
diff --git a/pymatgen/symmetry/analyzer.py b/pymatgen/symmetry/analyzer.py index <HASH>..<HASH> 100644 --- a/pymatgen/symmetry/analyzer.py +++ b/pymatgen/symmetry/analyzer.py @@ -770,7 +770,6 @@ class SpacegroupAnalyzer: List of weights, in the SAME order as kpoints. """ kpts = np.array(kpoints) - print("KPOINTS ARE", kpts) shift = [] mesh = [] for i in range(3):
remove accidental print statement from symmetry.analyzer
materialsproject_pymatgen
train
py
5a0569228eb5d4a8c1babb855f5c3588f7f8b075
diff --git a/libraries/ui-shared/index.js b/libraries/ui-shared/index.js index <HASH>..<HASH> 100644 --- a/libraries/ui-shared/index.js +++ b/libraries/ui-shared/index.js @@ -1,4 +1,4 @@ -export { default as Accordion } from './icons/Accordion'; +export { default as Accordion } from './Accordion'; export { default as ArrowIcon } from './icons/ArrowIcon'; export { default as BurgerIcon } from './icons/BurgerIcon'; export { default as CrossIcon } from './icons/CrossIcon';
PWA-<I> Corrected export path
shopgate_pwa
train
js
f099cdcdbf76a66cc5188a9bf22c47fed1692a65
diff --git a/lib/disney/disneylegacyapi.js b/lib/disney/disneylegacyapi.js index <HASH>..<HASH> 100644 --- a/lib/disney/disneylegacyapi.js +++ b/lib/disney/disneylegacyapi.js @@ -10,11 +10,6 @@ const Location = require('../location'); class DisneyLegacyPark extends DisneyAPIBase { constructor(options = {}) { - // stop the facility channel from being created - // the facility channel is the main bit missing from the non US Disney parks - // offline_facilities just stops the facility channel from starting up - options.offlineFacilities = options.offlineFacilities !== undefined ? options.offlineFacilities : true; - super(options); }
[!] Need the facility channel for the calendar data. Add back in!
cubehouse_themeparks
train
js
5900713f19bfeb57f90437d061d3ad1d2336389d
diff --git a/spec/support/coverage_loader.rb b/spec/support/coverage_loader.rb index <HASH>..<HASH> 100644 --- a/spec/support/coverage_loader.rb +++ b/spec/support/coverage_loader.rb @@ -3,4 +3,4 @@ require 'simplecov-rcov' require 'coveralls' require 'coverage/kit' -Coverage::Kit.setup(minimum_coverage: 70.25) +Coverage::Kit.setup(minimum_coverage: 70.20)
TT-<I>: don't bump coverage as much
sealink_timely
train
rb
d6ee11a5e62c950391efb8322220704ab705a5aa
diff --git a/plaso/multi_processing/analysis_process.py b/plaso/multi_processing/analysis_process.py index <HASH>..<HASH> 100644 --- a/plaso/multi_processing/analysis_process.py +++ b/plaso/multi_processing/analysis_process.py @@ -79,6 +79,10 @@ class AnalysisProcess(base_process.MultiProcessBaseProcess): if self._memory_profiler: self._memory_profiler.Sample('main', used_memory) + # XML RPC does not support integer values > 2 GiB so we format them + # as a string. + used_memory = '{0:d}'.format(used_memory) + status = { 'display_name': '', 'identifier': self._name,
Changes to analysis process RPC support #<I> (#<I>)
log2timeline_plaso
train
py
90d54e41e7fa39e1f26fe50e5322db42c518f480
diff --git a/openid/consumer/parse.py b/openid/consumer/parse.py index <HASH>..<HASH> 100644 --- a/openid/consumer/parse.py +++ b/openid/consumer/parse.py @@ -247,3 +247,26 @@ def findFirstHref(link_attrs_list, target_rel): return None first = matches[0] return first.get('href') + +class ParseError(ValueError): + """Exception for errors in parsing the HTML text for OpenID + settings""" + +def openIDDiscover(canonical_url, html_text): + """Parse OpenID settings out of the gived HTML text + + @raises: ParseError + # XXX: document interface + # XXX: TESTME + """ + link_attrs = parseLinkAttrs(html_text) + + server_url = findFirstHref(link_attrs, 'openid.server') + if server_url is None: + raise ParseError('No openid.server found') + + delegate_url = findFirstHref(link_attrs, 'openid.delegate') + if delegate_url is None: + delegate_url = canonical_url + + return canonical_url, delegate_url, server_url
[project @ Add implementation of OpenID settings parsing as an independent function]
openid_python-openid
train
py
b4885b9a371858cc4448a04a903f25e2973302b9
diff --git a/script/upload.py b/script/upload.py index <HASH>..<HASH> 100755 --- a/script/upload.py +++ b/script/upload.py @@ -14,7 +14,7 @@ from lib.util import atom_gyp, execute, get_atom_shell_version, parse_version, \ from lib.github import GitHub -ATOM_SHELL_REPO = 'atom/electron' +ATOM_SHELL_REPO = 'electron/electron' ATOM_SHELL_VERSION = get_atom_shell_version() PROJECT_NAME = atom_gyp()['project_name%']
atom => electron in upload script
electron_electron
train
py
a0484f80816231667fc71ea1068a703f4d6a38a2
diff --git a/tests/transliterator.php b/tests/transliterator.php index <HASH>..<HASH> 100644 --- a/tests/transliterator.php +++ b/tests/transliterator.php @@ -222,6 +222,19 @@ $data = array( ), ), ), + array( + 'description' => 'hotfix #14', + 'cases' => array( + array( + 'input' => array('some words here'), + 'expected' => 'some words here', + ), + array( + 'input' => array('yahoo'), + 'expected' => 'yahoo', + ), + ), + ), ), 'toKana' => array( array(
Add unit test for issue #<I>
mbilbille_jpnforphp
train
php
3bf9f0ab1ce962a1a4c6bfbeaee97f9e6bf2708c
diff --git a/src/Medoo.php b/src/Medoo.php index <HASH>..<HASH> 100644 --- a/src/Medoo.php +++ b/src/Medoo.php @@ -1482,7 +1482,7 @@ class Medoo } } - public function aggregate($type, $table, $join = null, $column = null, $where = null) + private function aggregate($type, $table, $join = null, $column = null, $where = null) { $map = [];
[update] Make aggregate as private
catfan_Medoo
train
php
8e8bc765b1de0bdbef69f6cfb892f59b3a0f4bd6
diff --git a/SwatDB/SwatDB.php b/SwatDB/SwatDB.php index <HASH>..<HASH> 100644 --- a/SwatDB/SwatDB.php +++ b/SwatDB/SwatDB.php @@ -1044,11 +1044,18 @@ class SwatDB // }}} // {{{ private static function initFields() + /** + * Transforms an array of text field identifiers ('type:name') into + * an array of SwatDBField objects. + * + * The array is passed by reference and modified in-place. Nothing is + * returned by this method. + * + * @param array $fields a reference to the array of field identifiers to + * transform. + */ private function initFields(&$fields) { - /* Transforms an array of text field identifiers ('text:title') into - * an array of SwatDBField objects. - */ if (count($fields) == 0) // TODO: throw exception instead of returning return;
Update documentation. svn commit r<I>
silverorange_swat
train
php
804272e960bd869927b4abe7e5c3bd77dd452aac
diff --git a/src/main/java/org/asciidoctor/Asciidoctor.java b/src/main/java/org/asciidoctor/Asciidoctor.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/asciidoctor/Asciidoctor.java +++ b/src/main/java/org/asciidoctor/Asciidoctor.java @@ -5,6 +5,7 @@ import java.io.IOException; import java.io.Reader; import java.io.Writer; import java.util.Collection; +import java.util.List; import java.util.Map; import org.asciidoctor.extension.JavaExtensionRegistry; @@ -399,6 +400,21 @@ public interface Asciidoctor { public static Asciidoctor create(String gemPath) { return JRubyAsciidoctor.create(gemPath); } + + /** + * Creates a new instance of Asciidoctor and sets loadPath to provided paths. This method is mostly used in OSGi + * environments. + * + * @param gemPath + * where gems are located. + * + * @return Asciidoctor instance which uses JRuby to wraps Asciidoctor + * Ruby calls. + */ + public static Asciidoctor create(List<String> loadPaths) { + return JRubyAsciidoctor.create(loadPaths); + } + }
Asciidoctor Factory can be used to create an instance of Asciidoctor setting gem path or load path
asciidoctor_asciidoctorj
train
java
0f2662e22c7a4ab8987b7d37247d071eb6d6d181
diff --git a/lib/overcommit/hook/base.rb b/lib/overcommit/hook/base.rb index <HASH>..<HASH> 100644 --- a/lib/overcommit/hook/base.rb +++ b/lib/overcommit/hook/base.rb @@ -111,6 +111,10 @@ module Overcommit::Hook Overcommit::Utils.execute(cmd) end + def execute_in_background(cmd) + Overcommit::Utils.execute_in_background(cmd) + end + def required_executable @config['required_executable'] end
Expose execute_in_background in hooks This was forgotten in f2c<I>ef. Add it. Change-Id: Iff<I>f1a6b<I>e<I>daba<I>ac6b1d3a Reviewed-on: <URL>
sds_overcommit
train
rb
7dd3d995ffb7ddbf491393fac606c9811fe70cb8
diff --git a/src/js/pannellum.js b/src/js/pannellum.js index <HASH>..<HASH> 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -1988,6 +1988,7 @@ function load() { */ function loadScene(sceneId, targetPitch, targetYaw, targetHfov, fadeDone) { loaded = false; + animatedMove = {}; // Set up fade if specified var fadeImg, workingPitch, workingYaw, workingHfov;
Clear move animation when changing scenes (fixes #<I>).
mpetroff_pannellum
train
js
5176ceee6e625cdd3baecbac95d095e8f00ce85b
diff --git a/code/jobs/ScheduledExecutionJob.php b/code/jobs/ScheduledExecutionJob.php index <HASH>..<HASH> 100644 --- a/code/jobs/ScheduledExecutionJob.php +++ b/code/jobs/ScheduledExecutionJob.php @@ -11,7 +11,7 @@ class ScheduledExecutionJob extends AbstractQueuedJob { /** * @param DataObject $dataObject - * @param integer $timesExecuted + * @param int $timesExecuted */ public function __construct($dataObject = null, $timesExecuted = 0) { if ($dataObject) {
minor codestyle: Fixing integer to int in phpdoc block
symbiote_silverstripe-queuedjobs
train
php
f329ddc1055f6b524460ff61fcd79bc85308cfcf
diff --git a/action/find.go b/action/find.go index <HASH>..<HASH> 100644 --- a/action/find.go +++ b/action/find.go @@ -17,8 +17,9 @@ func (s *Action) Find(c *cli.Context) error { if err != nil { return err } + needle := strings.ToLower(c.Args().First()) for _, value := range l { - if strings.Contains(value, c.Args().First()) { + if strings.Contains(strings.ToLower(value), needle) { fmt.Println(value) } } diff --git a/tests/find_test.go b/tests/find_test.go index <HASH>..<HASH> 100644 --- a/tests/find_test.go +++ b/tests/find_test.go @@ -26,6 +26,10 @@ func TestFind(t *testing.T) { assert.NoError(t, err) assert.Equal(t, "foo/bar", out) + out, err = ts.run("find Bar") + assert.NoError(t, err) + assert.Equal(t, "foo/bar", out) + out, err = ts.run("find b") assert.NoError(t, err) assert.Equal(t, "baz\nfoo/bar", out)
Make find compare entries case insensitive Fixes #<I>
gopasspw_gopass
train
go,go
ae8a2d5de6404ec54c979e3683a6f20e9c7ac3d9
diff --git a/admin_site_config.php b/admin_site_config.php index <HASH>..<HASH> 100644 --- a/admin_site_config.php +++ b/admin_site_config.php @@ -44,7 +44,7 @@ case 'site': Site::setPreference('TIMEZONE', Filter::post('TIMEZONE')); FlashMessages::addMessage(I18N::translate('The website preferences have been updated.'), 'success'); } - header('Location: ' + route('admin-control-panel')); + header('Location: ' . route('admin-control-panel')); return;
Should fix: #<I> - wrong addition operator
fisharebest_webtrees
train
php
9446f07536473791e10de52355c4503e812661ad
diff --git a/src/toil/lib/docker.py b/src/toil/lib/docker.py index <HASH>..<HASH> 100644 --- a/src/toil/lib/docker.py +++ b/src/toil/lib/docker.py @@ -160,7 +160,7 @@ def subprocessDockerCall(job, 'set -eo pipefail && {}'.format(' | '.join(chain_params))] else: call = baseDockerCall + [tool] + parameters - _logger.info("Calling docker with " + repr(call)) + logger.info("Calling docker with " + repr(call)) params = {} if outfile:
_logger -> logger.
DataBiosphere_toil
train
py
381c16c7e0c8c6bf5aa25cf8ab6b62e2dba6318f
diff --git a/guppi.py b/guppi.py index <HASH>..<HASH> 100644 --- a/guppi.py +++ b/guppi.py @@ -60,6 +60,7 @@ class GuppiRaw(object): def __init__(self, filename, n_blocks=None): self.filename = filename self.file_obj = open(filename, 'r') + self.filesize = os.path.getsize(filename) if not n_blocks: self.n_blocks = self.find_n_data_blocks() @@ -88,13 +89,20 @@ class GuppiRaw(object): start_idx = self.file_obj.tell() key, val = '', '' + header_dict = {} + keep_reading = True + + first_line = self.file_obj + + try: - header_dict = {} - keep_reading = True while keep_reading: + if start_idx + 80 > self.filesize: + keep_reading = False + raise EndOfFileError line = self.file_obj.read(80) #print line - if 'END ' in line: + if line.startswith('END'): keep_reading = False break else: @@ -113,7 +121,8 @@ class GuppiRaw(object): header_dict[key] = val except ValueError: - raise EndOfFileError + print line, start_idx, self.filesize + raise data_idx = self.file_obj.tell()
Updated file read logic for better compatibility
UCBerkeleySETI_blimpy
train
py
d44d9c32bbcef592804efb2d25a93877f1b6fba9
diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java b/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java @@ -160,6 +160,7 @@ public final class WellKnownMutability implements ThreadSafety.KnownTypes { .add(com.google.common.graph.ImmutableGraph.class, "N") .add(com.google.common.graph.ImmutableNetwork.class, "N", "E") .add(com.google.common.graph.ImmutableValueGraph.class, "N", "V") + .add("com.google.common.hash.AbstractHashFunction") // package-private .add(com.google.common.hash.HashCode.class) .add(com.google.common.io.BaseEncoding.class) .add(com.google.common.net.MediaType.class)
Mark AbstractHashFunction as a well-known Immutable type. RELNOTES: N/A ------------- Created by MOE: <URL>
google_error-prone
train
java
aa5848a2b530838b0be2dfb4531a10141d85b4f9
diff --git a/lib/gds_api/json_client.rb b/lib/gds_api/json_client.rb index <HASH>..<HASH> 100644 --- a/lib/gds_api/json_client.rb +++ b/lib/gds_api/json_client.rb @@ -88,7 +88,7 @@ module GdsApi end def delete_json!(url, params = nil, additional_headers = {}) - do_request(:delete, url, params, additional_headers) + do_json_request(:delete, url, params, additional_headers) end def post_multipart(url, params)
Fix delete_json to actually call do_json_request. This makes it consistent with put_json, post_json, and is the expected behaviour given the method name.
alphagov_gds-api-adapters
train
rb
59a78f1a7135407a4708005119fbda09f52efef8
diff --git a/lib/tessel/deploy.js b/lib/tessel/deploy.js index <HASH>..<HASH> 100644 --- a/lib/tessel/deploy.js +++ b/lib/tessel/deploy.js @@ -69,10 +69,13 @@ Tessel.prototype.deployScript = function(opts, push) { self.connection.end(); }); streams.stdin.on('data', function(data) { - console.log(data.toString()); + process.stdout.write(data); }); streams.stderr.on('data', function(data) { - console.log("Err: ", data.toString()); + process.stderr.write(data); + }); + + process.on('SIGINT', function () { streams.stdout.signal('KILL'); self.connection.end(); });
Supports full stdout/stderr. Kills conn on CTRL+C.
tessel_t2-cli
train
js
5016649f470615cea149a727d628abbca3cee823
diff --git a/cmd/gateway-main.go b/cmd/gateway-main.go index <HASH>..<HASH> 100644 --- a/cmd/gateway-main.go +++ b/cmd/gateway-main.go @@ -38,6 +38,7 @@ FLAGS: {{end}}{{end}} BACKEND: azure: Microsoft Azure Blob Storage. Default ENDPOINT is https://core.windows.net + s3: Amazon Simple Storage Service (S3). ENVIRONMENT VARIABLES: ACCESS: @@ -49,6 +50,16 @@ EXAMPLES: $ export MINIO_ACCESS_KEY=azureaccountname $ export MINIO_SECRET_KEY=azureaccountkey $ {{.HelpName}} azure + + 2. Start minio gateway server for S3 backend. + $ export MINIO_ACCESS_KEY=accesskey + $ export MINIO_SECRET_KEY=secretkey + $ {{.HelpName}} s3 + + 3. Start minio gateway server for S3 backend on custom endpoint. + $ export MINIO_ACCESS_KEY=Q3AM3UQ867SPQQA43P2F + $ export MINIO_SECRET_KEY=zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG + $ {{.HelpName}} s3 https://play.minio.io:9000 ` var gatewayCmd = cli.Command{
Add s3 backend to help, fixes #<I> (#<I>) * Add s3 backend to help, fixes #<I> * Add samples for Gateway usage with S3
minio_minio
train
go
1d6f46abcdf5020d08afbec810be54d4b22694fb
diff --git a/src/bosh-director/spec/unit/worker_spec.rb b/src/bosh-director/spec/unit/worker_spec.rb index <HASH>..<HASH> 100644 --- a/src/bosh-director/spec/unit/worker_spec.rb +++ b/src/bosh-director/spec/unit/worker_spec.rb @@ -86,7 +86,11 @@ module Bosh::Director it 'raises error if migrations are never current' do allow(migrator).to receive(:current?).exactly(Worker::MAX_MIGRATION_ATTEMPTS).times.and_return(false) + logger = double(Logging::Logger) + allow(config).to receive(:worker_logger).and_return(logger.tap { |l| allow(l).to receive(:error) }) allow(djworker).to receive(:start) + + expect(logger).to receive(:error).with(/Migrations not current during worker start after #{Worker::MAX_MIGRATION_ATTEMPTS} attempts./) expect { worker.prep }.to raise_error(/Migrations not current after #{Worker::MAX_MIGRATION_ATTEMPTS} retries/) expect(djworker).not_to have_received(:start) end
Capture error log in test vs printing to console for worker [#<I>](<URL>)
cloudfoundry_bosh
train
rb
558690c486959ad1ca89226af5a0449d8f0ac482
diff --git a/switch/core.js b/switch/core.js index <HASH>..<HASH> 100644 --- a/switch/core.js +++ b/switch/core.js @@ -116,24 +116,24 @@ Switch = new Class({ bind('init', self); // initialization queue for dynamicly loading plugins - self._initializer = new ASQueue.Converter(self, [{ - name: 'plugin', + self._initializer = new ASQueue.Converter([{ + method: 'plugin', auto: false, // after initialization, registering new plugin is forbidden before: 'init' }, { - name: 'init', + method: 'init', // method init should be executed only once - once: true + once: true }, 'switchTo', 'prev', 'next' - ]).on(); + ], self).on(); // processing queue for switch life cycle - self._lifeCycle = new ASQueue.Runner(self, self._lifeCycle); + self._lifeCycle = new ASQueue.Runner(self._lifeCycle, self); }, // @private
change switch/core according to the API alternation of ASQueue
kaelzhang_neuron.js
train
js
22f6a585a7f0d1b67178066b287c485c93764da9
diff --git a/chevron/renderer.py b/chevron/renderer.py index <HASH>..<HASH> 100644 --- a/chevron/renderer.py +++ b/chevron/renderer.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # -*- coding: utf-8 -*- try: diff --git a/chevron/tokenizer.py b/chevron/tokenizer.py index <HASH>..<HASH> 100644 --- a/chevron/tokenizer.py +++ b/chevron/tokenizer.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - # Globals _CURRENT_LINE = 1 _LAST_TAG_LINE = None
Remove shebang from renderer and tokenizer These files are not intended to be run by themselves anyways
noahmorrison_chevron
train
py,py
5e6208e061325855fa521d5436b334c713910044
diff --git a/core-bundle/src/Resources/contao/modules/Module.php b/core-bundle/src/Resources/contao/modules/Module.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/modules/Module.php +++ b/core-bundle/src/Resources/contao/modules/Module.php @@ -203,6 +203,7 @@ abstract class Module extends \Frontend $objTemplate = new \FrontendTemplate($this->navigationTpl); $objTemplate->type = get_class($this); + $objTemplate->cssID = $this->cssID; // see #4897 $objTemplate->level = 'level_' . $level++; // Get page object
[Core] Pass the CSS ID of the navigation module to the partial (see #<I>)
contao_contao
train
php
4c25ae60bcf65d206e9bb3ee7467a2106021a490
diff --git a/vcstool/clients/svn.py b/vcstool/clients/svn.py index <HASH>..<HASH> 100644 --- a/vcstool/clients/svn.py +++ b/vcstool/clients/svn.py @@ -125,7 +125,7 @@ class SvnClient(VcsClientBase): url = command.url if command.version: - url += '@%d' % command.version + url += '@%s' % command.version cmd_checkout = [ SvnClient._executable, '--non-interactive', 'checkout', url, '.']
fix usage of version with svn import (#<I>)
dirk-thomas_vcstool
train
py
9e9edd2da4dd8ee6363fcd4f2072db45336b7728
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -1120,27 +1120,27 @@ describe('TeslaJS', function () { }); }); - describe('#startStreaming()', function () { - it('should succeed', function (done) { - tjs.startStreaming(options, - function (err, response, body) { - if (response) { - done(); - } else { - done(err); - } - }, - function(data) { - // do nothing! - } - ); - }); - - it('should succeed with no callback', function (done) { - tjs.startStreaming(options); - done(); - }); - }); + // describe('#startStreaming()', function () { + // it('should succeed', function (done) { + // tjs.startStreaming(options, + // function (err, response, body) { + // if (response) { + // done(); + // } else { + // done(err); + // } + // }, + // function(data) { + // // do nothing! + // } + // ); + // }); + + // it('should succeed with no callback', function (done) { + // tjs.startStreaming(options); + // done(); + // }); + // }); describe('#scheduleSoftwareUpdate()', function () { it('should succeed', function (done) {
removed streaming tests for now #<I>
mseminatore_TeslaJS
train
js
72c5301ec183dca6e73928075c12b1227fef9de4
diff --git a/plugins/rest/rest.go b/plugins/rest/rest.go index <HASH>..<HASH> 100644 --- a/plugins/rest/rest.go +++ b/plugins/rest/rest.go @@ -151,5 +151,17 @@ func (c Client) Do(ctx context.Context, method, path string) (*http.Response, er "headers": req.Header, }).Debug("Sending request.") - return c.Client.Do(req) + resp, err := c.Client.Do(req) + if resp != nil { + // Only log for debug purposes. If an error occurred, the caller should handle + // that. In the non-error case, the caller may not do anything. + logrus.WithFields(logrus.Fields{ + "method": method, + "url": url, + "status": resp.Status, + "headers": resp.Header, + }).Debug("Received response.") + } + + return resp, err }
Add response debug logging to REST client
open-policy-agent_opa
train
go
2e1a2d999977c16f5d47be5ed3b4ace79511bdf8
diff --git a/lib/gcli/commands/help.js b/lib/gcli/commands/help.js index <HASH>..<HASH> 100644 --- a/lib/gcli/commands/help.js +++ b/lib/gcli/commands/help.js @@ -51,16 +51,16 @@ function getHelpManData(commandData, context) { }.bind(this)); }, getSynopsis: function(param) { - var short = param.short ? '|-' + param.short : ''; - if (param.isPositionalAllowed) { + var name = param.name + (param.short ? '|-' + param.short : ''); + if (param.option == null) { return param.defaultValue !== undefined ? - '[' + param.name + short + ']' : - '<' + param.name + short + '>'; + '[' + name + ']' : + '<' + name + '>'; } else { - return param.type.name === 'boolean' ? - '[--' + param.name + short + ']' : - '[--' + param.name + short + ' ...]'; + return param.type === 'boolean' || param.type.name === 'boolean' ? + '[--' + name + ']' : + '[--' + name + ' ...]'; } }, command: commandData.command,
refactor-<I>: Simplify how we create param name in help A small simplification to create the name at the top rather than in 2 parts which we concatenate later.
joewalker_gcli
train
js
45fdddc73c62eca55976c22214ff7b801351ef97
diff --git a/azurerm/internal/services/frontdoor/tests/front_door_resource_test.go b/azurerm/internal/services/frontdoor/tests/front_door_resource_test.go index <HASH>..<HASH> 100644 --- a/azurerm/internal/services/frontdoor/tests/front_door_resource_test.go +++ b/azurerm/internal/services/frontdoor/tests/front_door_resource_test.go @@ -267,7 +267,7 @@ func testCheckAzureRMFrontDoorDestroy(s *terraform.State) error { ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext for _, rs := range s.RootModule().Resources { - if rs.Type != "azurerm_front_door" { + if rs.Type != "azurerm_frontdoor" { continue }
r/frontdoor: fixing an issue where the checkdestroy function was checking the wrong resource name
terraform-providers_terraform-provider-azurerm
train
go
a495a014afd5037b3f4fe6ccfdbabd4cec640c1a
diff --git a/exchange/bitswap/bitswap.go b/exchange/bitswap/bitswap.go index <HASH>..<HASH> 100644 --- a/exchange/bitswap/bitswap.go +++ b/exchange/bitswap/bitswap.go @@ -24,13 +24,17 @@ import ( var log = eventlog.Logger("bitswap") -// Number of providers to request for sending a wantlist to -// TODO: if a 'non-nice' strategy is implemented, consider increasing this value -const maxProvidersPerRequest = 3 +const ( + // Number of providers to request for sending a wantlist to + // TODO: if a 'non-nice' strategy is implemented, consider increasing this value + maxProvidersPerRequest = 3 + providerRequestTimeout = time.Second * 10 + hasBlockTimeout = time.Second * 15 +) -var providerRequestTimeout = time.Second * 10 -var hasBlockTimeout = time.Second * 15 -var rebroadcastDelay = time.Second * 10 +var ( + rebroadcastDelay = time.Second * 10 +) // New initializes a BitSwap instance that communicates over the provided // BitSwapNetwork. This function registers the returned instance as the network
style constify variables good to const until it's required for them to be variable. TODO pass them in as configuration options
ipfs_go-ipfs
train
go
047ded63874aba76907926092c49a5cbeb026ca1
diff --git a/cicoclient/wrapper.py b/cicoclient/wrapper.py index <HASH>..<HASH> 100644 --- a/cicoclient/wrapper.py +++ b/cicoclient/wrapper.py @@ -97,7 +97,7 @@ class CicoWrapper(client.CicoClient): real_self_inventory = dict() for host in self_inventory: - real_self_inventory[host[0]] = self.full_inventory[host[0]] + real_self_inventory[host[1]] = self.full_inventory[host[1]] self._self_inventory = real_self_inventory
fix bug in self_inventory
CentOS_python-cicoclient
train
py
4861bb577cd7e9820f60b7e3652332244956b467
diff --git a/tests/test_fixtures.py b/tests/test_fixtures.py index <HASH>..<HASH> 100644 --- a/tests/test_fixtures.py +++ b/tests/test_fixtures.py @@ -21,9 +21,28 @@ class TestFoo(unittest.TestCase, FixturesMixin): # Your tests go here + def setUp(self): + # Make sure that the user defined setUp method runs after the fixtures + # setup function (i.e., the database should be setup already) + assert Author.query.count() == 1 + assert Book.query.count() == 3 + + # Add another author on the fly + author = Author() + author.first_name = 'George' + author.last_name = 'Orwell' + self.db.session.add(author) + self.db.session.commit() + + def tearDown(self): + # This should run before the fixtures tear down function, so the + # database should still contain all the fixtures data + assert Author.query.count() == 2 + assert Book.query.count() == 3 + def test_authors(self): authors = Author.query.all() - assert len(authors) == Author.query.count() == 1 + assert len(authors) == Author.query.count() == 2 assert len(authors[0].books) == 3 def test_books(self):
Modified the tests to make sure that setup and tear down functions work properly
croach_Flask-Fixtures
train
py
656efe05029c31744a112eb2125051df8cbfd702
diff --git a/app/form_builders/monologue_admin_form_builder.rb b/app/form_builders/monologue_admin_form_builder.rb index <HASH>..<HASH> 100644 --- a/app/form_builders/monologue_admin_form_builder.rb +++ b/app/form_builders/monologue_admin_form_builder.rb @@ -29,7 +29,7 @@ class MonologueAdminFormBuilder < ActionView::Helpers::FormBuilder end def submit(*args) - content_tag :div, class: "actions" do + content_tag :div, class: "form-actions" do super end end
Making the layout consistent throughout -- using the twitter-bootstrap class.
jipiboily_monologue
train
rb
d89b2fcfd96a84bf62136db16407c701587077f6
diff --git a/src/pixi/renderers/canvas/CanvasRenderer.js b/src/pixi/renderers/canvas/CanvasRenderer.js index <HASH>..<HASH> 100644 --- a/src/pixi/renderers/canvas/CanvasRenderer.js +++ b/src/pixi/renderers/canvas/CanvasRenderer.js @@ -23,7 +23,7 @@ PIXI.CanvasRenderer = function(width, height, options) { for (var i in PIXI.defaultRenderOptions) { - options[i] = options[i] || PIXI.defaultRenderOptions[i]; + if (!(i in options)) options[i] = PIXI.defaultRenderOptions[i]; } } else
Fix for overwriting falsy values.. or even (possibly) undefined ones.
pixijs_pixi.js
train
js
0d5dbe88c5513fda1a0f7d73b0b420d3a1b875d8
diff --git a/ruby_event_store/lib/ruby_event_store/client.rb b/ruby_event_store/lib/ruby_event_store/client.rb index <HASH>..<HASH> 100644 --- a/ruby_event_store/lib/ruby_event_store/client.rb +++ b/ruby_event_store/lib/ruby_event_store/client.rb @@ -17,6 +17,12 @@ module RubyEventStore end + # Persists events and notifies subscribed handlers about them + # + # @param events [Array<Event, Proto>, Event, Proto] event(s) + # @param stream_name [String] name of the stream for persisting events. + # @param expected_version [:any, :auto, :none, Integer] controls optimistic locking strategy. {http://railseventstore.org/docs/expected_version/ Read more} + # @return [:ok] def publish(events, stream_name: GLOBAL_STREAM, expected_version: :any) enriched_events = enrich_events_metadata(events) serialized_events = serialize_events(enriched_events)
Document #publish Issue: #<I> [ci skip]
RailsEventStore_rails_event_store
train
rb
d401327319fcd3766fe6fe5767c6dd66cccf26c4
diff --git a/lib/sof/writer.rb b/lib/sof/writer.rb index <HASH>..<HASH> 100644 --- a/lib/sof/writer.rb +++ b/lib/sof/writer.rb @@ -42,6 +42,7 @@ module Sof end immediate , extended = atts.partition {|a,val| val.is_a?(SimpleNode) } head += immediate.collect {|a,val| "#{a.to_sof()} => #{val.data}"}.join(", ") + ")" + return SimpleNode.new(head) if( ref.nil? and extended.empty? and head.length < 30 ) node = ObjectNode.new(head , ref) extended.each do |a , val| node.add( to_sof_node(a,level + 1) , val )
made a simple node for small objects. bad news is that tests pass unchanged
ruby-x_rubyx
train
rb
f944d0cbf55332bae7f02611ee11b7353e15e526
diff --git a/Auth/OpenID/DiffieHellman.php b/Auth/OpenID/DiffieHellman.php index <HASH>..<HASH> 100644 --- a/Auth/OpenID/DiffieHellman.php +++ b/Auth/OpenID/DiffieHellman.php @@ -61,15 +61,6 @@ class Auth_OpenID_DiffieHellman { $this->lib =& Auth_OpenID_getMathLib(); - if (!$this->lib) { - // This should NEVER occur because even if no math - // extensions can be found, we should get an instance of - // Auth_OpenID_MathWrapper, but if there's a bug in - // Auth_OpenID_getMathLib, it might. - trigger_error("Big integer fallback implementation unavailable.", - E_USER_ERROR); - } - if ($mod === null) { $this->mod = $this->lib->init($_Auth_OpenID_DEFAULT_MOD); } else { @@ -82,10 +73,12 @@ class Auth_OpenID_DiffieHellman { $this->gen = $gen; } - $this->private = - ($private === null) ? - Auth_OpenID_CryptUtil::randrange(1, $this->mod) : - $private; + if ($private === null) { + $r = Auth_OpenID_CryptUtil::randrange($this->mod); + $this->private = $this->lib->add($r, 1); + } else { + $this->private = $private; + } $this->public = $this->lib->powmod($this->gen, $this->private, $this->mod);
[project @ Remove unnecessary code from DiffieHellman.php]
openid_php-openid
train
php
2c9ae5e9b8216f6f4378de2fb97541e1ddfa8d17
diff --git a/lib/ohai/plugins/chef.rb b/lib/ohai/plugins/chef.rb index <HASH>..<HASH> 100644 --- a/lib/ohai/plugins/chef.rb +++ b/lib/ohai/plugins/chef.rb @@ -33,7 +33,7 @@ Ohai.plugin(:Chef) do begin require "chef/version" require "chef-config/config" unless defined?(ChefConfig::Config) - rescue Gem::LoadError + rescue LoadError logger.trace("Plugin Chef: Unable to load the chef gem to determine the version") # this catches when you've done a major version bump of ohai, but # your chef gem is incompatible, so we can't load it in the same VM
Fix the exception handling in the chef plugin This wasn't actually rescuing.
chef_ohai
train
rb
70da550dc305fe91040e425367f34c6f7adadc67
diff --git a/py/nupic/research/flat_spatial_pooler.py b/py/nupic/research/flat_spatial_pooler.py index <HASH>..<HASH> 100644 --- a/py/nupic/research/flat_spatial_pooler.py +++ b/py/nupic/research/flat_spatial_pooler.py @@ -109,7 +109,9 @@ class FlatSpatialPooler(SpatialPooler): # set of columns to be 'hungry' for learning self._boostFactors *= maxFiringBoost - + # This constructor is a minimal, stripped down version of the + # constructure above. The constructor above is only used to + # provid backwards compatibility to the old spatial pooler. # def __init__(self, # numInputs, # numColumns,
added comments to flat spatial pooler constructor
numenta_nupic
train
py
7de7de3c861ca2deed44fc8b31815120b13c9f77
diff --git a/src/Leaves/CrudLeaf.php b/src/Leaves/CrudLeaf.php index <HASH>..<HASH> 100644 --- a/src/Leaves/CrudLeaf.php +++ b/src/Leaves/CrudLeaf.php @@ -25,7 +25,7 @@ abstract class CrudLeaf extends ModelBoundLeaf protected function saveRestModel() { $this->model->restModel->save(); - + return $this->model->restModel; } @@ -48,24 +48,30 @@ abstract class CrudLeaf extends ModelBoundLeaf protected function createModel() { - $model = new CrudModel(); - $model->savePressedEvent->attachHandler( + return new CrudModel(); + + } + + protected function onModelCreated() + { + parent::onModelCreated(); + + $this->model->savePressedEvent->attachHandler( function () { $this->save(); } ); - $model->cancelPressedEvent->attachHandler( + $this->model->cancelPressedEvent->attachHandler( function () { $this->cancel(); } ); - $model->deletePressedEvent->attachHandler( + $this->model->deletePressedEvent->attachHandler( function () { $this->delete(); } ); - return $model; } } \ No newline at end of file
small refactor of crudleaf as agreed with AC
RhubarbPHP_Module.Leaf.Crud
train
php
fdc87a89422e9cc299ca24e2cf210b4053a07ea2
diff --git a/xwiki-rendering-syntaxes/xwiki-rendering-syntax-event/src/main/java/org/xwiki/rendering/internal/renderer/event/EventsChainingRenderer.java b/xwiki-rendering-syntaxes/xwiki-rendering-syntax-event/src/main/java/org/xwiki/rendering/internal/renderer/event/EventsChainingRenderer.java index <HASH>..<HASH> 100644 --- a/xwiki-rendering-syntaxes/xwiki-rendering-syntax-event/src/main/java/org/xwiki/rendering/internal/renderer/event/EventsChainingRenderer.java +++ b/xwiki-rendering-syntaxes/xwiki-rendering-syntax-event/src/main/java/org/xwiki/rendering/internal/renderer/event/EventsChainingRenderer.java @@ -194,7 +194,7 @@ public class EventsChainingRenderer extends AbstractChainingPrintRenderer @Override public void onSpecialSymbol(char symbol) { - getPrinter().println("onSpecialSymbol [" + symbol + "]"); + getPrinter().println("onSpecialSymbol [" + getEscaped(Character.toString(symbol)) + "]"); } @Override
[Misc] Also escape chars in special symbol event
xwiki_xwiki-rendering
train
java
d56dcdd60818068f7bb39cd35c8138471553f243
diff --git a/tests/runtests.py b/tests/runtests.py index <HASH>..<HASH> 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -160,7 +160,7 @@ TEST_SUITES = { 'path': 'integration/netapi'}, 'cloud_provider': {'display_name': 'Cloud Provider', - 'path': 'integration/cloud/providers'}, + 'path': 'integration/cloud/clouds'}, 'minion': {'display_name': 'Minion', 'path': 'integration/minion'},
Rename "providers" dir to "clouds" to respect naming convention
saltstack_salt
train
py
c1c7078323ca382dd6ce2011bf1ec91495e498d2
diff --git a/src/fkooman/Rest/Plugin/IndieAuth/IndieAuthAuthentication.php b/src/fkooman/Rest/Plugin/IndieAuth/IndieAuthAuthentication.php index <HASH>..<HASH> 100644 --- a/src/fkooman/Rest/Plugin/IndieAuth/IndieAuthAuthentication.php +++ b/src/fkooman/Rest/Plugin/IndieAuth/IndieAuthAuthentication.php @@ -179,6 +179,7 @@ class IndieAuthAuthentication implements AuthenticationPluginInterface }, array( __CLASS__ => array('enabled' => false), + 'fkooman\Rest\Plugin\Authentication\AuthenticationPlugin' => array('enabled' => false), 'fkooman\Rest\Plugin\ReferrerCheckPlugin' => array('enabled' => true), ) ); @@ -241,6 +242,7 @@ class IndieAuthAuthentication implements AuthenticationPluginInterface }, array( __CLASS__ => array('enabled' => false), + 'fkooman\Rest\Plugin\Authentication\AuthenticationPlugin' => array('enabled' => false), ) ); @@ -254,6 +256,7 @@ class IndieAuthAuthentication implements AuthenticationPluginInterface }, array( __CLASS__ => array('enabled' => false), + 'fkooman\Rest\Plugin\Authentication\AuthenticationPlugin' => array('enabled' => false), 'fkooman\Rest\Plugin\ReferrerCheckPlugin' => array('enabled' => true), ) );
also disable authentication plugin on registered URLs
fkooman_php-lib-rest-plugin-authentication-indieauth
train
php
0d66c5a0b635cac043d32cde1a1942e78cdcd315
diff --git a/core/src/main/java/com/google/common/truth/TruthJUnit.java b/core/src/main/java/com/google/common/truth/TruthJUnit.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/common/truth/TruthJUnit.java +++ b/core/src/main/java/com/google/common/truth/TruthJUnit.java @@ -58,18 +58,6 @@ public final class TruthJUnit { } }; - /** - * @deprecated If you are passing this to a {@link Subject} constructor, instead call {@link - * #assume()}{@code .about(...).that(...)}, passing its associated {@link SubjectFactory} - * (which you might need to create). If you are calling {@code fail} on this object directly, - * instead use {@link #assume()}{@code .fail()}, or {@code throw new - * AssumptionViolatedException()} directly. - */ - @Deprecated - public static final FailureStrategy throwAssumptionError() { - return THROW_ASSUMPTION_ERROR; - } - private static final StandardSubjectBuilder ASSUME = StandardSubjectBuilder.forCustomFailureStrategy(THROW_ASSUMPTION_ERROR);
Remove throwAssumptionError, which was deprecated in Truth <I>. ------------- Created by MOE: <URL>
google_truth
train
java
b32ba481f2f8dd63826afde5286ff0db61fdf5b3
diff --git a/library/src/com/sothree/slidinguppanel/SlidingUpPanelLayout.java b/library/src/com/sothree/slidinguppanel/SlidingUpPanelLayout.java index <HASH>..<HASH> 100644 --- a/library/src/com/sothree/slidinguppanel/SlidingUpPanelLayout.java +++ b/library/src/com/sothree/slidinguppanel/SlidingUpPanelLayout.java @@ -1102,6 +1102,13 @@ public class SlidingUpPanelLayout extends ViewGroup { int anchoredTop = (int)(mAnchorPoint*mSlideRange); if (mDragHelper.getViewDragState() == ViewDragHelper.STATE_IDLE) { + final int newTop = mSlideableView.getTop(); + final int topBound = getSlidingTop(); + Log.d(TAG, "onViewDragStateChange newTop " + newTop + " topBound " + topBound); + mSlideOffset = mIsSlidingUp + ? (float) (newTop - topBound) / mSlideRange + : (float) (topBound - newTop) / mSlideRange; + if (mSlideOffset == 0) { if (mSlideState != SlideState.EXPANDED) { updateObscuredViewVisibility();
Recompute slide offset from sliding view top when drag state becomes idle. Some slower devices were missing the final onPanelDragged events so the onPanelExpanded, onPanelAnchored & onPanelCollapsed events were not being fired.
umano_AndroidSlidingUpPanel
train
java
049a856cd93c14e6a2efdbf6f5e02b028885a544
diff --git a/dvc/version.py b/dvc/version.py index <HASH>..<HASH> 100644 --- a/dvc/version.py +++ b/dvc/version.py @@ -6,7 +6,7 @@ import os import subprocess -_BASE_VERSION = "2.7.2" +_BASE_VERSION = "2.7.3" def _generate_version(base_version):
dvc: bump to <I>
iterative_dvc
train
py
b6762799ae9dde8fdd84e1ff1593895b3b79a33d
diff --git a/sikuli.py b/sikuli.py index <HASH>..<HASH> 100644 --- a/sikuli.py +++ b/sikuli.py @@ -23,5 +23,5 @@ mouseMove = global_screen.mouseMove wheel = global_screen.wheel keyDown = global_screen.keyDown keyUp = global_screen.keyUp -debug_preview = global_screen.debugPreview +debugPreview = global_screen.debugPreview sleep = time.sleep \ No newline at end of file
Fixed refactoring (again)
glitchassassin_lackey
train
py
725a79caff86cab22555aa51612d2548d31abe30
diff --git a/opal/clearwater/application.rb b/opal/clearwater/application.rb index <HASH>..<HASH> 100644 --- a/opal/clearwater/application.rb +++ b/opal/clearwater/application.rb @@ -20,6 +20,7 @@ module Clearwater router.set_outlets controller.call trap_clicks + watch_url end def trap_clicks @@ -37,6 +38,19 @@ module Clearwater router.navigate_to href end end + + def watch_url + @path = router.current_path + check_rerender = proc do + if @path != router.current_path + router.set_outlets + controller && controller.call + @path = router.current_path + end + end + set_interval = Native(`window.setInterval`) + set_interval.call check_rerender, 100 + end end end end
Watch URL for changes This helps keep us from breaking the back button. I'd like to come up with a better way to do this, though, since executing a callback function every <I>ms can wake up the process unnecessarily, leading to battery drain.
clearwater-rb_clearwater
train
rb
8ee3f1a811a5f3ee8db212b2bc971c8b611706a7
diff --git a/lib/support/cli.js b/lib/support/cli.js index <HASH>..<HASH> 100644 --- a/lib/support/cli.js +++ b/lib/support/cli.js @@ -204,7 +204,7 @@ module.exports.parseCommandLine = function parseCommandLine() { }) .option('chrome.traceCategory', { describe: - 'Add a trace category to the default ones. Use --chrome.traceCategory multiple times if you want to add multiple categories', + 'Add a trace category to the default ones. Use --chrome.traceCategory multiple times if you want to add multiple categories. Example: --chrome.traceCategory disabled-by-default-v8.cpu_profiler', type: 'string', group: 'chrome' })
Add example how to add your own trace category
sitespeedio_browsertime
train
js
f7fcbad44de2420f565ac95b4e3ca2132005e83a
diff --git a/lib/dev_mode_app.js b/lib/dev_mode_app.js index <HASH>..<HASH> 100644 --- a/lib/dev_mode_app.js +++ b/lib/dev_mode_app.js @@ -178,9 +178,12 @@ App.prototype = { } , onInputChar: function(chr, i) { var self = this - if (chr === 'q') + if (chr === 'q') { + log.info('Got keyboard Quit command') this.quit() + } else if (i === 13){ // ENTER + log.info('Got keyboard Start Tests command') this.startTests() } } @@ -195,6 +198,7 @@ App.prototype = { var errMsgs = StyledString('\n' + stdout).foreground('yellow') .concat(StyledString('\n' + stderr).foreground('red')) view.setErrorPopupMessage(title.concat(errMsgs)) + log.log('error', titleText, { stdout: stdout, stderr: stderr }) return }else{ view.clearErrorPopupMessage()
Make keyboard commands and compile errors show up in the debug log
testem_testem
train
js
45258461b51f23b6c9f63f58018b9f90204baf5b
diff --git a/clc-java-sdk/sdk/src/test/java/com/centurylink/cloud/sdk/tests/mocks/BindMocksModule.java b/clc-java-sdk/sdk/src/test/java/com/centurylink/cloud/sdk/tests/mocks/BindMocksModule.java index <HASH>..<HASH> 100644 --- a/clc-java-sdk/sdk/src/test/java/com/centurylink/cloud/sdk/tests/mocks/BindMocksModule.java +++ b/clc-java-sdk/sdk/src/test/java/com/centurylink/cloud/sdk/tests/mocks/BindMocksModule.java @@ -23,6 +23,7 @@ public class BindMocksModule extends TestModule { overrideInjectedMocksBinding(); } + @SuppressWarnings("unchecked") private void overrideInjectedMocksBinding() { Stream .of(declaredFields())
<I> design and implement integration tests framework
CenturyLinkCloud_clc-java-sdk
train
java
4e7e9e6178b0af21de95d0c90fc402d791aad49a
diff --git a/tests/e2e/PestTestFramework/tests/ForPestWithDataProviderTest.php b/tests/e2e/PestTestFramework/tests/ForPestWithDataProviderTest.php index <HASH>..<HASH> 100644 --- a/tests/e2e/PestTestFramework/tests/ForPestWithDataProviderTest.php +++ b/tests/e2e/PestTestFramework/tests/ForPestWithDataProviderTest.php @@ -10,7 +10,7 @@ test('tests division with inline dataset', function (float $a, float $b, float $ [2.0, 4.0, 0.5] ]); -test('tests division with shared dataset', function (float $a, float $b, float $expectedResult) { +test('tests division with shared dataset, with special | char', function (float $a, float $b, float $expectedResult) { $sourceClass = new ForPestWithDataProvider(); expect($sourceClass->div($a, $b))->toBe($expectedResult);
Add special char for Pest e2e test to make sure it works as expected
infection_infection
train
php
98776bb5db336aa242ce860ff3b11366c4f07ef7
diff --git a/lib/text_helpers/translation.rb b/lib/text_helpers/translation.rb index <HASH>..<HASH> 100644 --- a/lib/text_helpers/translation.rb +++ b/lib/text_helpers/translation.rb @@ -35,7 +35,7 @@ module TextHelpers def html(key, options = {}) rendered = GitHub::Markdown.render(text(key, options)) if options[:inline] - rendered.match(/\A<p>(.*)<\/p>\Z/)[1].html_safe + rendered.gsub(/<\/?p>/, '').html_safe else rendered.html_safe end
Handle `p` tag stripping in a more robust manner
ahorner_text-helpers
train
rb
87334b1b0c3dba34788be4559e1e1d50bdb31fbf
diff --git a/features/edb/core/src/test/java/org/openengsb/edb/core/test/unit/repository/GitRepositoryTest.java b/features/edb/core/src/test/java/org/openengsb/edb/core/test/unit/repository/GitRepositoryTest.java index <HASH>..<HASH> 100644 --- a/features/edb/core/src/test/java/org/openengsb/edb/core/test/unit/repository/GitRepositoryTest.java +++ b/features/edb/core/src/test/java/org/openengsb/edb/core/test/unit/repository/GitRepositoryTest.java @@ -19,6 +19,7 @@ package org.openengsb.edb.core.test.unit.repository; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import java.io.File; @@ -76,7 +77,7 @@ public class GitRepositoryTest { Repository repo = factory.loadRepository("target/testDeleteRepo"); assertEquals(true, new File("target/testDeleteRepo").exists()); repo.removeRepository(); - assertEquals(false, new File("target/testDeleteRepo").exists()); + assertFalse(new File("target/testDeleteRepo").exists()); } }
replaced assertEquals with assertFalse
openengsb_openengsb
train
java
31e3c8cac753f77dee29130774810ea6011ce2ba
diff --git a/test/unit/test_service_models.py b/test/unit/test_service_models.py index <HASH>..<HASH> 100644 --- a/test/unit/test_service_models.py +++ b/test/unit/test_service_models.py @@ -41,7 +41,7 @@ class UrlTesterTestMixin(UrlTesterTestBase): ('filter_matching') ]) @patch('spam_lists.validation.is_valid_url') - def test_invalid_url_error_is_raised_by(self, function_name, is_valid_url_mock): + def test_query_for_invalid_url_with(self, function_name, is_valid_url_mock): invalid_url = 'http://invalid.url.com' is_valid_url_mock.side_effect = lambda u: u != invalid_url
Rename test_invalid_url_error_is_raised_by The method is being renamed to test_query_for_invalid_url_with
piotr-rusin_spam-lists
train
py
4a43211d6e720cea730e8a48611be17bf4337848
diff --git a/kong/management/commands/assume.py b/kong/management/commands/assume.py index <HASH>..<HASH> 100644 --- a/kong/management/commands/assume.py +++ b/kong/management/commands/assume.py @@ -26,6 +26,9 @@ class Command(BaseCommand): help="Print all options"), ) + def complete(self): + return [(h.slug, 0) for h in HostedSite.objects.all()] + def handle(self, *args, **options): LIST = options.get('list') if LIST:
Add bash completion (with a patched django). Otherwise this should just be ignored.
ericholscher_django-kong
train
py
7c2a2524083633e12f718164ef419bbe237e97b0
diff --git a/lib/driver/mysql.js b/lib/driver/mysql.js index <HASH>..<HASH> 100644 --- a/lib/driver/mysql.js +++ b/lib/driver/mysql.js @@ -403,8 +403,8 @@ var MysqlDriver = Base.extend({ var columns = Object.keys(fieldMapping); var referencedColumns = columns.map(function (key) { return fieldMapping[key]; }); var sql = util.format('ALTER TABLE `%s` ADD CONSTRAINT `%s` FOREIGN KEY (%s) REFERENCES `%s` (%s) ON DELETE %s ON UPDATE %s', - tableName, keyName, this.quoteArr( columns ), referencedTableName, - this.quoteArr( referencedColumns ), rules.onDelete || 'NO ACTION', rules.onUpdate || 'NO ACTION'); + tableName, keyName, this.quoteDDLArr( columns ), referencedTableName, + this.quoteDDLArr( referencedColumns ), rules.onDelete || 'NO ACTION', rules.onUpdate || 'NO ACTION'); return this.runSql(sql).nodeify(callback); },
fix wrong quoting resulted from wrong quotationFunction
db-migrate_node-db-migrate
train
js
95b99c987753af978ca568939ee7a6808ffea8f8
diff --git a/enhydrator/src/main/java/com/airhacks/enhydrator/transform/ColumnTransformer.java b/enhydrator/src/main/java/com/airhacks/enhydrator/transform/ColumnTransformer.java index <HASH>..<HASH> 100644 --- a/enhydrator/src/main/java/com/airhacks/enhydrator/transform/ColumnTransformer.java +++ b/enhydrator/src/main/java/com/airhacks/enhydrator/transform/ColumnTransformer.java @@ -1,5 +1,7 @@ package com.airhacks.enhydrator.transform; +import java.util.Map; + /* * #%L * enhydrator @@ -26,6 +28,9 @@ package com.airhacks.enhydrator.transform; @FunctionalInterface public interface ColumnTransformer { + default void init(Map<String, Object> scriptEngineBindings) { + } + Object execute(Object entry); }
ColumnTransformer got initialization with bindings for consistency sake
AdamBien_enhydrator
train
java
9d7fff1f77bd39694c8fdba8d98c291207e3e659
diff --git a/src/Controller.js b/src/Controller.js index <HASH>..<HASH> 100644 --- a/src/Controller.js +++ b/src/Controller.js @@ -296,8 +296,7 @@ meta.ctrl = loadCtrls: function() { var ctrl; - var numCtrl = this._ctrlsLoad.length; - for(var i = 0; i < numCtrl; i++) { + for(var i = 0; i < this._ctrlsLoad.length; i++) { this._ctrlsLoad[i]._load(); } },
Controllers loaded in another controllers load should now work properly.
tenjou_meta2d
train
js
ec8aab5f8af516ba8710dec11b60b359d0483c2c
diff --git a/inc/roots-cleanup.php b/inc/roots-cleanup.php index <HASH>..<HASH> 100644 --- a/inc/roots-cleanup.php +++ b/inc/roots-cleanup.php @@ -176,7 +176,7 @@ function roots_remove_recent_comments_style() { // remove CSS from gallery function roots_gallery_style($css) { - return preg_replace("/<style type='text/css'>(.*?)</style>/s", '', $css); + return preg_replace("/<style type='text\/css'>(.*?)<\/style>/s", '', $css); } function roots_head_cleanup() {
escaped slashes in preg_replace pattern
roots_sage
train
php
5abd0115ab6b3412b7403e1fe5c4e74f04d90146
diff --git a/tinybus/src/com/halfbit/tinybus/TinyBus.java b/tinybus/src/com/halfbit/tinybus/TinyBus.java index <HASH>..<HASH> 100644 --- a/tinybus/src/com/halfbit/tinybus/TinyBus.java +++ b/tinybus/src/com/halfbit/tinybus/TinyBus.java @@ -150,10 +150,9 @@ public class TinyBus implements Bus { private void processQueue() { mProcessing = true; - Object obj; + Task task; - while((obj = poll()) != null) { - Task task = (Task) obj; + while((task = poll()) != null) { switch (task.code) { case Task.CODE_REGISTER: registerInternal(task.obj); break; case Task.CODE_UNREGISTER: unregisterInternal(task.obj); break;
removing unnesseary object cast
beworker_tinybus
train
java
c47e49f659701e6460436187c206ac7a616c0131
diff --git a/app/src/Bolt/Config.php b/app/src/Bolt/Config.php index <HASH>..<HASH> 100644 --- a/app/src/Bolt/Config.php +++ b/app/src/Bolt/Config.php @@ -612,7 +612,7 @@ class Config $this->paths['app'] . 'view/css/ckeditor.css' )); $this->set('general/wysiwyg/filebrowser/browseUrl', $this->paths['async'] . 'filebrowser/'); - $this->set('general/wysiwyg/filebrowser/imageBrowseUrl', $this->paths['bolt'] . 'files/files'); + $this->set('general/wysiwyg/filebrowser/imageBrowseUrl', $this->paths['files']); } private function loadCache()
in setCkPath use the request to files url instead of constructing it here
bolt_bolt
train
php
13ae5017c75365399a2ccc61262b615dcbc57030
diff --git a/components/Kladr/util.js b/components/Kladr/util.js index <HASH>..<HASH> 100644 --- a/components/Kladr/util.js +++ b/components/Kladr/util.js @@ -34,6 +34,21 @@ export function placeName(region: PlaceDescription, _for: ?Place = null) { case 'ул': return (_for !== 'street' ? 'улица ' : '') + region.name; + case 'пл': + return 'площадь ' + region.name; + + case 'пр-кт': + return 'проспект ' + region.name; + + case 'проезд': + return 'проезд ' + region.name; + + case 'тер': + return 'тер ' + region.name; + + case 'кв-л': + return region.name + ' квартал'; + case 'пер': return region.name + ' переулок'; }
[Kladr] More abbreviations.
skbkontur_retail-ui
train
js
6233a8e412118f4d27d03761086750e232e9562b
diff --git a/core/Version.php b/core/Version.php index <HASH>..<HASH> 100644 --- a/core/Version.php +++ b/core/Version.php @@ -20,7 +20,7 @@ final class Version * The current Piwik version. * @var string */ - const VERSION = '3.0.0-rc5'; + const VERSION = '3.0.0-rc4'; public function isStableVersion($version) {
<I>-rc4 was never released
matomo-org_matomo
train
php
0caafb377de03e8848e2f0133753911c3759e984
diff --git a/fireplace/cards/classic/rogue.py b/fireplace/cards/classic/rogue.py index <HASH>..<HASH> 100644 --- a/fireplace/cards/classic/rogue.py +++ b/fireplace/cards/classic/rogue.py @@ -34,7 +34,7 @@ class NEW1_005: # Master of Disguise class NEW1_014: - play = SetTag(TARGET, {GameTag.STEALTH: False}) + play = SetTag(TARGET, {GameTag.STEALTH: True}) ## diff --git a/tests/test_main.py b/tests/test_main.py index <HASH>..<HASH> 100755 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -1767,6 +1767,17 @@ def test_mana_wyrm(): assert wyrm.atk == 3 +def test_master_of_disguise(): + game = prepare_game() + wisp = game.player1.give(WISP) + wisp.play() + masterofdisguise = game.player1.give("NEW1_014") + masterofdisguise.play(target=wisp) + assert wisp.stealthed + game.end_turn(); game.end_turn() + assert wisp.stealthed + + def test_old_murkeye(): game = prepare_game() murkeye = game.player1.give("EX1_062")
Fix Master of Disguise and add test
jleclanche_fireplace
train
py,py
0bffca6e0cfc9e69a6a75956322a6d7d06b2ca33
diff --git a/example.py b/example.py index <HASH>..<HASH> 100644 --- a/example.py +++ b/example.py @@ -12,11 +12,10 @@ bot = SirBot(token) # Example quote of the day plugin async def get_quote_of_the_day(): url = 'http://api.theysaidso.com/qod.json' - async with aiohttp.ClientSession() as session: - async with session.get(url) as response: - if response.status != 200: - raise Exception('Error talking to quote api') - quote_r = await response.json() + async with aiohttp.get(url) as response: + if response.status != 200: + raise Exception('Error talking to quote api') + quote_r = await response.json() quote = quote_r['contents']['quotes'][0]['quote'] author = quote_r['contents']['quotes'][0]['author']
Remove client session from example bot, we only need a single request
pyslackers_sir-bot-a-lot
train
py
84fcd9703dbd94672e472c928743509e85d21cdf
diff --git a/lib/rubylog/context_modules/predicates.rb b/lib/rubylog/context_modules/predicates.rb index <HASH>..<HASH> 100644 --- a/lib/rubylog/context_modules/predicates.rb +++ b/lib/rubylog/context_modules/predicates.rb @@ -11,12 +11,6 @@ module Rubylog super end - - - - - # directives - # def predicate *indicators each_indicator(indicators) do |indicator| create_procedure(indicator).functor_for [@default_subject, Variable] @@ -31,23 +25,13 @@ module Rubylog attr_accessor :default_subject - # predicates + protected def create_procedure indicator Rubylog::SimpleProcedure.new indicator[0], indicator[1] end - - protected - - - def check_modules modules - modules.each do |m| - raise ArgumentError, "#{m.inspect} is not a class or module", caller[1..-1] unless m.is_a? Module - end - end - def each_indicator indicators # TODO check if not empty #
removed check_modules, made create_procedure protected
cie_rubylog
train
rb
2f37e1083b1e478fe3820418b6e53279bc703f03
diff --git a/course/index.php b/course/index.php index <HASH>..<HASH> 100644 --- a/course/index.php +++ b/course/index.php @@ -116,7 +116,7 @@ print_category_edit_header(); print_heading($heading); - if ($datadelete) { + if ($data->fulldelete) { category_delete_full($deletecat, true); } else { category_delete_move($deletecat, $data->newparent, true);
course categories: fix typo introduced when fixing MDL-<I>
moodle_moodle
train
php
33d96e9101064b9417a0ad940a4cd0f311e5f512
diff --git a/.rspec b/.rspec index <HASH>..<HASH> 100644 --- a/.rspec +++ b/.rspec @@ -1 +1,2 @@ ---color \ No newline at end of file +--color +--format documentation diff --git a/lib/storify/client.rb b/lib/storify/client.rb index <HASH>..<HASH> 100644 --- a/lib/storify/client.rb +++ b/lib/storify/client.rb @@ -27,4 +27,8 @@ class Storify::Client self end + + def authenticated + !@token.nil? + end end \ No newline at end of file diff --git a/spec/client_auth_spec.rb b/spec/client_auth_spec.rb index <HASH>..<HASH> 100644 --- a/spec/client_auth_spec.rb +++ b/spec/client_auth_spec.rb @@ -7,6 +7,7 @@ describe "Storify::Client -- Authentication" do it "should retrieve an auth token on success" do @client.auth(get_password).token.should_not be_nil + @client.authenticated.should be_true end it "should raise an API error on failure" do
additional auth spec and interface refactoring
natural-affinity_storify
train
rspec,rb,rb
e180f2b4b5b7ea109cc8c68724f8cff9220f061a
diff --git a/base/project.js b/base/project.js index <HASH>..<HASH> 100644 --- a/base/project.js +++ b/base/project.js @@ -202,10 +202,9 @@ Project.prototype.route = function project_route (request, view, next) { var parts = request.url.pathname.split('/'); // if the uri starts wiht a forward slash, we will have an empty string at the start of the array var part = parts.shift(); - console.log(parts); + // loop through every part separated by slashes and incrementally check them against the routes while (part = parts.shift()) { - console.log('checking part:' + part + ' [' + parts.length + ']'); route = this._partMatches(routes, part, request); // if we found a matching route @@ -213,7 +212,6 @@ Project.prototype.route = function project_route (request, view, next) { break; } - console.log('route found'); // if we need to dig deeper if (route.routes && parts.length) { routes = route.routes; @@ -248,7 +246,7 @@ Project.prototype._partMatches = function project__partMatches (routes, request_ } if (url_part[0] === '#') { - if (Number(request_url) != NaN) { + if (!isNaN(Number(request_url))) { request.url.query[url_part.substring(1)] = request_url; return routes[url_part]; }
remove some logging and fix the url routing on digits
Dashron_roads
train
js
48a0995c7ec6485a227d296c09035ed55ad5ac8b
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index <HASH>..<HASH> 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -54,10 +54,8 @@ I18n.enforce_available_locales = false # Register danish language for testing I18n.backend.store_translations 'da', {} I18n.backend.store_translations 'pt-BR', {} -ORIGINAL_LOCALES = I18n.available_locales.map(&:to_s).sort FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures') -FIXTURES = Pathname.new(FIXTURE_LOAD_PATH) module RackTestUtils def body_to_string(body)
Removing unused constants from abstract_unit
rails_rails
train
rb
b9e09143431872631fb3e77157d1ac9e87591af5
diff --git a/spec/integration/deployment_spec.rb b/spec/integration/deployment_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/deployment_spec.rb +++ b/spec/integration/deployment_spec.rb @@ -88,7 +88,6 @@ describe 'deployment integrations' do context 'canceling a deploy job' do it 'should spawn a job and then successfully cancel it' do - pending 'hangs when canceling during or before package compilation' deploy_result = deploy_simple(no_track: true) task_id = get_task_id(deploy_result, 'running') @@ -106,4 +105,4 @@ describe 'deployment integrations' do expect(error_event['message']).to eq("Task #{task_id} cancelled") end end -end \ No newline at end of file +end
Re-enable pending spec since [#<I>] was fixed
cloudfoundry_bosh
train
rb
ff4b182580758823e753bdc9e84edc02a95cf8f7
diff --git a/karma.conf.js b/karma.conf.js index <HASH>..<HASH> 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,13 +1,12 @@ module.exports = function(config) { + var browsers = process.env.TRAVIS + ? [ 'PhantomJS' ] + : [ 'PhantomJS', 'Chrome', 'Firefox', 'Safari' ]; + config.set({ frameworks: [ 'hydro' ], singleRun: true, - browsers: [ - 'PhantomJS', - 'Chrome', - 'Firefox', - 'Safari' - ], + browsers: browsers, files: [ 'test/*.js' ],
Make karma pick up only PhantomJS when on Travis CI
hydrojs_require
train
js
57ae64b600b9882af1d1acf837b4eba1aadc125e
diff --git a/lib/rom/repository/version.rb b/lib/rom/repository/version.rb index <HASH>..<HASH> 100644 --- a/lib/rom/repository/version.rb +++ b/lib/rom/repository/version.rb @@ -1,5 +1,5 @@ module ROM class Repository - VERSION = '0.3.1'.freeze + VERSION = '1.0.0.beta1'.freeze end end
Bump to <I>.beta1
rom-rb_rom
train
rb
351b476d6230182b88c1849d6812b837ba8b0659
diff --git a/docs/source/conf.py b/docs/source/conf.py index <HASH>..<HASH> 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -64,9 +64,9 @@ copyright = u'2012, BNPB/AIFDR/GFDRR' # built documents. # # The short X.Y version. -version = '0.2.0' +version = '0.3.0' # The full version, including alpha/beta/rc tags. -release = '0.2.0' +release = '0.3.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.
Updated source version in master to <I>
inasafe_inasafe
train
py
0fd4fa0b7e6249cb12cae62f1b3209280fedca1f
diff --git a/lib/ovirt_metrics.rb b/lib/ovirt_metrics.rb index <HASH>..<HASH> 100644 --- a/lib/ovirt_metrics.rb +++ b/lib/ovirt_metrics.rb @@ -43,7 +43,7 @@ module OvirtMetrics end def self.disconnect - OvirtHistory.connection.disconnect! + OvirtHistory.remove_connection end def self.vm_realtime(vm_id, start_time = nil, end_time = nil)
Properly disconnect disconnect! disconnects the only the adapter connection; remove_connection removes the connection for this class and will disconnect the correct connection pool. <URL>
ManageIQ_ovirt_metrics
train
rb
185a282c43ec25f488fa1171e5b41e990253c2be
diff --git a/orderer/consensus/etcdraft/chain_test.go b/orderer/consensus/etcdraft/chain_test.go index <HASH>..<HASH> 100644 --- a/orderer/consensus/etcdraft/chain_test.go +++ b/orderer/consensus/etcdraft/chain_test.go @@ -465,15 +465,18 @@ var _ = Describe("Chain", func() { // use to prepare the Orderer Values BeforeEach(func() { chainID := "mychannel" + values := make(map[string]*common.ConfigValue) configEnv = newConfigEnv(chainID, - common.HeaderType_ORDERER_TRANSACTION, - &common.ConfigUpdateEnvelope{ConfigUpdate: []byte("test channel creation envelope")}) + common.HeaderType_CONFIG, + newConfigUpdateEnv(chainID, values), + ) configSeq = 0 }) // BeforeEach block It("should be able to create a channel", func() { err := chain.Configure(configEnv, configSeq) Expect(err).NotTo(HaveOccurred()) + Eventually(support.WriteConfigBlockCallCount).Should(Equal(1)) }) }) }) // Context block for type A config
[FAB-<I>] Fix failed UT The UT being fixed in this CR submits a malformed config env, which crashes test. It passed because we never wait for the block to be committed and shut down test early. Change-Id: I<I>ccbf<I>d8ffb<I>d<I>e<I>a<I>b<I>d<I>e
hyperledger_fabric
train
go
c7f78b184df5cdeee301af06472f7f14465ed7e4
diff --git a/activerecord/lib/active_record/dynamic_scope_match.rb b/activerecord/lib/active_record/dynamic_scope_match.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/dynamic_scope_match.rb +++ b/activerecord/lib/active_record/dynamic_scope_match.rb @@ -1,4 +1,11 @@ module ActiveRecord + + # = Active Record Dynamic Scope Match + # + # Provides dynamic attribute-based scopes such as <tt>scoped_by_price(4.99)</tt> + # if, for example, the <tt>Product</tt> has an attribute with that name. You can + # chain more <tt>scoped_by_* </tt> methods after the other. It acts like a named + # scope except that it's dynamic. class DynamicScopeMatch def self.match(method) ds_match = self.new(method)
Added description and title to Dynamic Scope Match
rails_rails
train
rb
9cc5a0d8eea79c9031ffeafae75b5a998011be71
diff --git a/lib/util/escape-path.js b/lib/util/escape-path.js index <HASH>..<HASH> 100644 --- a/lib/util/escape-path.js +++ b/lib/util/escape-path.js @@ -3,7 +3,8 @@ module.exports = function escapePath(p) { var p = encodeURIComponent(p) .replace(/%2F/g, '/') .replace(/\)/g, '%29') - .replace(/\(/g, '%28'); + .replace(/\(/g, '%28') + .replace(/!/g,'%21'); if (p[0] === '/') { p = p.slice(1); } return p; }
Added support to ! in path
evnm_dropbox-node
train
js
ad8a8cccd7120856dbaeca898b1906ada6b8b26d
diff --git a/Processor.php b/Processor.php index <HASH>..<HASH> 100644 --- a/Processor.php +++ b/Processor.php @@ -449,6 +449,16 @@ class Processor $target->{'@reverse'} = new Object(); } $target = $target->{'@reverse'}; + + if (false === is_array($value)) { + $value = array($value); + } + + foreach ($value as $val) { + if (property_exists($val, '@value') || property_exists($val, '@list')) { + throw new SyntaxException('Detected invalid value in @reverse-map (only nodes are allowed', $val); + } + } } if (is_array($expProperty)) { @@ -649,7 +659,7 @@ class Processor if ('@reverse' === $keyword) { if (false === is_object($value)) { - throw new SyntaxException("Invalid value for $keyword detected (must be an object).", $value); + throw new SyntaxException('Detected invalid value for @reverse (must be an object).', $value); } $this->expand($value, $activectx, $keyword, $frame);
Ensure reverse properties only contain nodes
lanthaler_JsonLD
train
php
4c00f41200a035242cdcbf46daba8aec31538415
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -255,11 +255,11 @@ BitArray.from32Integer = function(num) { BitArray.fromRedis = BitArray.fromBuffer = function(buf) { - var bits = [] + var bits = '' for (var i = 0; i < buf.length; i++) { - bits = bits.concat(BitArray.from32Integer(buf[i]).toJSON()) + bits += BitArray.from32Integer(buf[i]).__bits.join('') } - return new BitArray().set(bits) + return new BitArray().set(bits.split('').map(i => parseInt(i))) } /**
Performance enhancement on fromBuffer The performance of Array.concat was taking a hit when using a buffer that <I> bytes in length. Appending to a string is faster
sorensen_node-bitarray
train
js
36de8d631dcd2334583f1c0c4235e3deec87b52f
diff --git a/src/Illuminate/Foundation/Http/FormRequest.php b/src/Illuminate/Foundation/Http/FormRequest.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Foundation/Http/FormRequest.php +++ b/src/Illuminate/Foundation/Http/FormRequest.php @@ -207,7 +207,7 @@ class FormRequest extends Request implements ValidatesWhenResolved * Get the validated data from the request. * * @param string|null $key - * @param string|array|null $default + * @param mixed $default * @return mixed */ public function validated($key = null, $default = null)
Update FormRequest.php (#<I>)
laravel_framework
train
php
9c870be54b38f92a5b189e7d4b977e7a521539ef
diff --git a/tests/PoolTest.php b/tests/PoolTest.php index <HASH>..<HASH> 100644 --- a/tests/PoolTest.php +++ b/tests/PoolTest.php @@ -149,6 +149,13 @@ class PoolTest extends \PHPUnit_Framework_TestCase */ public function testReserveWithNoJobsDoesNotTakeLongerThanTimeout() { + $connection = $this->createMockConnection('host:123'); + $this->collection->expects($this->any()) + ->method('getAvailableKeys') + ->will($this->returnValue(['host:123', 'host:456'])); + $this->collection->expects($this->any()) + ->method('sendToExact') + ->will($this->returnValue(['connection' => $connection, 'response' => false])); $startTime = time(); $this->pool->reserve(2); $totalTime = time() - $startTime;
Fix failing pool test requiring returns from the mocks
phlib_beanstalk
train
php
803dc07443a5508327b981afe7b272dbaaefd4e8
diff --git a/lib/ajax/ajaxlib.php b/lib/ajax/ajaxlib.php index <HASH>..<HASH> 100644 --- a/lib/ajax/ajaxlib.php +++ b/lib/ajax/ajaxlib.php @@ -1285,7 +1285,7 @@ class jsportal { * Prints the JavaScript code needed to set up AJAX for the course. */ function print_javascript($courseid, $return=false) { - global $CFG, $USER; + global $CFG, $USER, $OUTPUT; $blocksoutput = $output = ''; for ($i=0; $i<count($this->blocks); $i++) {
ajaxlib MDL-<I> Fixed minor bug because of missing global
moodle_moodle
train
php
22b918a938d476ce45e5582dbd1d0eb68678508c
diff --git a/mambustruct.py b/mambustruct.py index <HASH>..<HASH> 100644 --- a/mambustruct.py +++ b/mambustruct.py @@ -15,6 +15,12 @@ class MambuStructIterator: return item class MambuStruct(object): + def __getitem__(self, key): + return self.attrs[key] + + def __str__(self): + return self.__class__.__name__ + " - " + str(self.attrs) + # Initializa a partir de un diccionario con los elementos de la cuenta def init(self, attrs={}): self.attrs = attrs
MambuStructs get array and printable functionality
jstitch_MambuPy
train
py
1ac1f3d6494042014a32bf43971b491e5e1e2353
diff --git a/spec/core/nil/and_spec.rb b/spec/core/nil/and_spec.rb index <HASH>..<HASH> 100644 --- a/spec/core/nil/and_spec.rb +++ b/spec/core/nil/and_spec.rb @@ -6,7 +6,7 @@ describe "NilClass#&" do (nil & true).should == false (nil & false).should == false (nil & "").should == false - (nil & 'x').should == false + (nil & mock('x')).should == false end end
fix typo in NilClass#and spec
opal_opal
train
rb
c9a02edc3020a82991df74a671dca9ce3a8302a0
diff --git a/tests/LCRun2Test.php b/tests/LCRun2Test.php index <HASH>..<HASH> 100644 --- a/tests/LCRun2Test.php +++ b/tests/LCRun2Test.php @@ -1,6 +1,6 @@ <?php /** - * Generated by build/gen_test on 2014-02-26 at 05:34:15. + * Generated by build/gen_test */ require_once('src/lightncandy.php'); diff --git a/tests/LightnCandyTest.php b/tests/LightnCandyTest.php index <HASH>..<HASH> 100644 --- a/tests/LightnCandyTest.php +++ b/tests/LightnCandyTest.php @@ -1,6 +1,6 @@ <?php /** - * Generated by build/gen_test on 2014-02-26 at 05:34:15. + * Generated by build/gen_test */ require_once('src/lightncandy.php');
Auto generated tests from Travis [ci skip]
zordius_lightncandy
train
php,php
8980de32ee379aeba94e817d9e93828caf665712
diff --git a/addok/core.py b/addok/core.py index <HASH>..<HASH> 100644 --- a/addok/core.py +++ b/addok/core.py @@ -303,8 +303,6 @@ class Search(BaseHelper): self.step_only_commons, self.step_no_meaningful_but_common_try_autocomplete, self.step_bucket_with_meaningful, - self.step_check_bucket_full, - self.step_check_cream, self.step_reduce_with_other_commons, self.step_autocomplete, self.step_check_bucket_full,
Always try to autocomplete while bucket is not overflown
addok_addok
train
py
de57087bf674ad8f8a3d17d41868e412b14de213
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,10 @@ ENCODING = "utf8" pkg_info = {} +def need_pytest(): + return set(["pytest", "test", "ptr"]).intersection(sys.argv) + + with open(os.path.join(MODULE_NAME, "__version__.py")) as f: exec(f.read(), pkg_info) @@ -40,8 +44,7 @@ with open(os.path.join(REQUIREMENT_DIR, "docs_requirements.txt")) as f: DOCS_REQUIRES = [line.strip() for line in f if line.strip()] SETUPTOOLS_REQUIRES = ["setuptools>=38.3.0"] -NEEDS_PYTEST = set(["pytest", "test", "ptr"]).intersection(sys.argv) -PYTEST_RUNNER_REQUIRES = ["pytest-runner"] if NEEDS_PYTEST else [] +PYTEST_RUNNER_REQUIRES = ["pytest-runner"] if need_pytest() else [] setuptools.setup( name=MODULE_NAME,
Extract a function that gets pytest-runner requirement
thombashi_tabledata
train
py
4c837e0d4513974b5cc64f6905d2fe1c78d4a2ad
diff --git a/tests/test_symbolic.py b/tests/test_symbolic.py index <HASH>..<HASH> 100644 --- a/tests/test_symbolic.py +++ b/tests/test_symbolic.py @@ -20,10 +20,10 @@ import nose def test_concretization_strategies(): initial_memory = {0: b'A', 1: b'B', 2: b'C', 3: b'D'} - s = angr.SimState(arch='AMD64', memory_backer=initial_memory) + s = angr.SimState(arch='AMD64', dict_memory_backer=initial_memory) # sanity check - nose.tools.assert_equal(s.solver.eval_upto(s.memory.load(3, 1), 2, cast_to=bytes), [b'D']) + nose.tools.assert_equal(s.solver.eval_upto(s.memory.load(3, size=1), 2, cast_to=bytes), [b'D']) x = s.solver.BVS('x', s.arch.bits) s.add_constraints(x >= 1)
Fix test_symbolic.
angr_angr
train
py
f6f35bccbdb2dd359a98bcad07d2d6c59d649461
diff --git a/src/test/java/hex/DeepLearningSpiralsTest.java b/src/test/java/hex/DeepLearningSpiralsTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/hex/DeepLearningSpiralsTest.java +++ b/src/test/java/hex/DeepLearningSpiralsTest.java @@ -47,7 +47,7 @@ public class DeepLearningSpiralsTest extends TestUtil { p.source = frame; p.response = frame.lastVec(); p.validation = null; - p.score_interval = 10; + p.score_interval = 2; p.ignored_cols = null; p.train_samples_per_iteration = 0; //sync once per period p.quiet_mode = true;
Speed up DLSpiralsTest by scoring more often and triggering early stopping more likely.
h2oai_h2o-2
train
java
0e0a5e60c2e98afdfbc7d30c561fbb245ad02673
diff --git a/lib/Cpdf.php b/lib/Cpdf.php index <HASH>..<HASH> 100644 --- a/lib/Cpdf.php +++ b/lib/Cpdf.php @@ -5763,7 +5763,7 @@ EOT; if ($eight_bit) { // with gamma correction $gammacorr = 2.2; - $pixel = pow((((127 - $alpha) * 255 / 127) / 255), $gammacorr) * 255; + $pixel = round(pow((((127 - $alpha) * 255 / 127) / 255), $gammacorr) * 255); } else { // without gamma correction $pixel = (127 - $alpha) * 2;
Round pixel color for 8-bit PNG with transparency When processing the alpha channel in CPDF. Addresses PHP <I> compatibility issue.
dompdf_dompdf
train
php
4070d3ba4d84cbcb04ba525964203d9988062914
diff --git a/psiturk/experiment.py b/psiturk/experiment.py index <HASH>..<HASH> 100644 --- a/psiturk/experiment.py +++ b/psiturk/experiment.py @@ -491,7 +491,8 @@ def start_exp(): condition=part.cond, counterbalance=part.counterbalance, adServerLoc=ad_server_location, - mode = mode + mode = mode, + contact_address=CONFIG.get('HIT Configuration', 'contact_email_on_error') ) @app.route('/inexp', methods=['POST'])
make contact_address available to exp.html
NYUCCL_psiTurk
train
py
ab31e7763bd20dd5cbb66e6d2a8f748d771d1f94
diff --git a/task/backend/analytical_storage_test.go b/task/backend/analytical_storage_test.go index <HASH>..<HASH> 100644 --- a/task/backend/analytical_storage_test.go +++ b/task/backend/analytical_storage_test.go @@ -66,24 +66,22 @@ func TestAnalyticalStore(t *testing.T) { ts.BucketService = storage.NewBucketService(ts.BucketService, ab.storageEngine) - go func() { - <-ctx.Done() - ab.Close(t) - }() - authCtx := icontext.SetAuthorizer(ctx, &influxdb.Authorization{ Permissions: influxdb.OperPermissions(), }) return &servicetest.System{ - TaskControlService: svcStack, - TaskService: svcStack, - OrganizationService: ts.OrganizationService, - UserService: ts.UserService, - UserResourceMappingService: ts.UserResourceMappingService, - AuthorizationService: authSvc, - Ctx: authCtx, - }, cancelFunc + TaskControlService: svcStack, + TaskService: svcStack, + OrganizationService: ts.OrganizationService, + UserService: ts.UserService, + UserResourceMappingService: ts.UserResourceMappingService, + AuthorizationService: authSvc, + Ctx: authCtx, + }, func() { + cancelFunc() + ab.Close(t) + } }, ) }
chore: Closing in goroutine causes race with logging framework
influxdata_influxdb
train
go
10994c24f3588c2966341d64e4cada5982e8ea34
diff --git a/lib/SiftResponse.php b/lib/SiftResponse.php index <HASH>..<HASH> 100644 --- a/lib/SiftResponse.php +++ b/lib/SiftResponse.php @@ -17,6 +17,6 @@ class SiftResponse { } public function isOk() { - return $this->apiStatus == 0; + return $this->apiStatus === 0; } } \ No newline at end of file
Using === to compare apiStatus
SiftScience_sift-php
train
php
1e2dd8c90d6a74e7cbe89ba6776c5394d6cd5ee3
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -55,13 +55,9 @@ function DubAPI(auth, callback) { that._.self = new SelfModel(body.data); - that._.reqHandler.queue({method: 'GET', url: endpoints.authToken}, function(code, body) { - if (code !== 200) return callback(new DubAPIRequestError(code, that._.reqHandler.endpoint(endpoints.authToken))); + that._.sokHandler.connect(); - that._.sokHandler.connect(body.data.token); - - callback(undefined, that); - }); + callback(undefined, that); }); }); }
Removed extra authToken request
anjanms_DubAPI
train
js
24c4ac0227146b5f45697fe3fb4be05cb81b9728
diff --git a/src/cli/commands/parseOptions.js b/src/cli/commands/parseOptions.js index <HASH>..<HASH> 100644 --- a/src/cli/commands/parseOptions.js +++ b/src/cli/commands/parseOptions.js @@ -115,11 +115,11 @@ function parseCommandOptions(command, notManaged) { let name; // See if we can match the option against anything. - if (notManaged[option.name]) { + if (notManaged[option.name] !== undefined) { value = notManaged[option.name]; delete notManaged[option.name]; name = option.name; - } else if (notManaged[option.alias]) { + } else if (notManaged[option.alias] !== undefined) { value = notManaged[option.alias]; delete notManaged[option.alias]; name = option.alias;
Fixed a problem where an option was false, when using --no-option
rocjs_roc
train
js