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
bac3f32ab49d5d94112c1c55e9d93299de52e187
diff --git a/src/adapters/pouch.leveldb.js b/src/adapters/pouch.leveldb.js index <HASH>..<HASH> 100644 --- a/src/adapters/pouch.leveldb.js +++ b/src/adapters/pouch.leveldb.js @@ -282,15 +282,21 @@ LevelPouch = module.exports = function(opts, callback) { , type = doc._attachments[id.attachmentId].content_type stores[ATTACH_BINARY_STORE].get(digest, function(err, attach) { - // empty attachments + var data; + if (err && err.name === 'NotFoundError') { - return call(callback, null, new Buffer('')); + // Empty attachment + data = opts.encode + ? Pouch.utils.btoa(new Buffer('')) + : new Buffer(''); + return call(callback, null, data); } if (err) { return call(callback, err); } - var data = opts.encode + + data = opts.encode ? Pouch.utils.btoa(attach) : attach;
(#<I>) - Encode empty attachment buffers
pouchdb_pouchdb
train
js
80d739359e0f29dabf78e2c200dca0136f57b1a5
diff --git a/opal/browser/css/definitions.rb b/opal/browser/css/definitions.rb index <HASH>..<HASH> 100644 --- a/opal/browser/css/definitions.rb +++ b/opal/browser/css/definitions.rb @@ -11,6 +11,13 @@ define :border do |args| ['-webkit-border-radius', value], ['border-radius', value]] else + value.map {|horizontal, value| + value.map {|vertical, value| + [["-moz-border-radius-#{horizontal}#{vertical}", value], + ["-webkit-border-#{horizontal}-#{vertical}-radius", value], + ["border-#{horizontal}-#{vertical}-radius", value]] + }.flatten(1) + }.flatten(1) end else @@ -25,6 +32,10 @@ define :box do |args| args.map {|name, value| case name when :shadow + if Array === value + value = value.join ', ' + end + if String === value [['-moz-box-shadow', value], ['-webkit-box-shadow', value],
css/definitions: some improvements to box-shadow and border-radius
opal_opal-browser
train
rb
ce5e677a9bc3dde505b186b57b9084b1fe89467d
diff --git a/tests/Cache/ApcCacheTest.php b/tests/Cache/ApcCacheTest.php index <HASH>..<HASH> 100644 --- a/tests/Cache/ApcCacheTest.php +++ b/tests/Cache/ApcCacheTest.php @@ -30,4 +30,9 @@ class ApcCacheTest extends AbstractCacheTest return $cache; } + + public function testCacheTtl() + { + $this->markTestSkipped("APC will only expunged its cache on the next request"); + } } \ No newline at end of file
skip ttl test on APC test case cause APC will only expunged its cache on the next request
moust_silex-cache-service-provider
train
php
95c65e8e3e0f7da7d8cd7073b3e4ad85d3eac9b0
diff --git a/thali/install/validateBuildEnvironment.js b/thali/install/validateBuildEnvironment.js index <HASH>..<HASH> 100644 --- a/thali/install/validateBuildEnvironment.js +++ b/thali/install/validateBuildEnvironment.js @@ -28,7 +28,7 @@ const versions = // We don't have an easy way to identify the version of the support libraries // we have but if they were installed recently enough then they will have // what we need. - androidSupportLibraries: '40.0.0', + androidSupportLibraries: '41.0.0', python: '2.7.10', cordova: '6.4.0', java: '1.8.0_102',
Update androidSupportLibraries version in validateBuildEnvironment.js
thaliproject_Thali_CordovaPlugin
train
js
0fbac16dbe77b6bf846b43d3ef3bd75c374e2628
diff --git a/test/unit/ajax.js b/test/unit/ajax.js index <HASH>..<HASH> 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -774,7 +774,7 @@ test("jQuery.ajax() - JSONP, Remote", function() { var count = 0; function plus(){ if ( ++count == 4 ) start(); } - var base = window.location.href.replace(/\?.*$/, ""); + var base = window.location.href.replace(/[^\/]*$/, ""); stop();
Strip off filename and query string for JSONP Remote test.
jquery_jquery
train
js
c658ed1030320688607da5cbb2c6bd3a544c18cd
diff --git a/app/scripts/GenomePositionSearchBox.js b/app/scripts/GenomePositionSearchBox.js index <HASH>..<HASH> 100644 --- a/app/scripts/GenomePositionSearchBox.js +++ b/app/scripts/GenomePositionSearchBox.js @@ -507,13 +507,6 @@ export class GenomePositionSearchBox extends React.Component { bsSize="small" styleName={className} > - <div - onClick={() => this.autocompleteMenu.inputEl.focus()} - styleName={classNameIcon} - > - <Glyphicon glyph="search" /> - </div> - <DropdownButton bsSize="small" className={styles['genome-position-search-bar-button']} @@ -559,7 +552,7 @@ export class GenomePositionSearchBox extends React.Component { onClick={this.buttonClick.bind(this)} styleName={classNameButton} > - {'GO'} + <Glyphicon glyph="search" /> </button> </FormGroup> );
Replace "Go" with magnifier icon
higlass_higlass
train
js
ae2d468fe80af994228880ad5eee52b17b4fd7c9
diff --git a/cellbase-app/src/main/java/org/opencb/cellbase/app/cli/main/CellBaseMain.java b/cellbase-app/src/main/java/org/opencb/cellbase/app/cli/main/CellBaseMain.java index <HASH>..<HASH> 100644 --- a/cellbase-app/src/main/java/org/opencb/cellbase/app/cli/main/CellBaseMain.java +++ b/cellbase-app/src/main/java/org/opencb/cellbase/app/cli/main/CellBaseMain.java @@ -22,6 +22,7 @@ import org.opencb.cellbase.app.cli.main.executors.QueryCommandExecutor; import org.opencb.cellbase.app.cli.main.executors.VariantAnnotationCommandExecutor; import java.io.IOException; +import java.net.URISyntaxException; /** * Created by imedina on 03/02/15. @@ -73,9 +74,9 @@ public class CellBaseMain { if (commandExecutor != null) { try { - commandExecutor.loadClientConfiguration(); + commandExecutor.loadCellBaseConfiguration(); commandExecutor.execute(); - } catch (IOException e) { + } catch (IOException | URISyntaxException e) { commandExecutor.getLogger().error("Error reading CellBase configuration: " + e.getMessage()); System.exit(1); }
use correct config for CLI queries
opencb_cellbase
train
java
3f63c3c663f46d3ba13f9c2c77401a296cc43b48
diff --git a/library/src/main/java/com/evernote/android/job/v21/JobProxy21.java b/library/src/main/java/com/evernote/android/job/v21/JobProxy21.java index <HASH>..<HASH> 100644 --- a/library/src/main/java/com/evernote/android/job/v21/JobProxy21.java +++ b/library/src/main/java/com/evernote/android/job/v21/JobProxy21.java @@ -99,7 +99,15 @@ public class JobProxy21 implements JobProxy { @Override public boolean isPlatformJobScheduled(JobRequest request) { - List<JobInfo> pendingJobs = mJobScheduler.getAllPendingJobs(); + List<JobInfo> pendingJobs; + try { + pendingJobs = mJobScheduler.getAllPendingJobs(); + } catch (Exception e) { + // it's possible that this throws an exception, see https://gist.github.com/vRallev/a59947dd3932d2642641 + CAT.e(e); + return false; + } + if (pendingJobs == null || pendingJobs.isEmpty()) { return false; }
Catch system NPE while getting all pending jobs
evernote_android-job
train
java
bb29094ef8c76abd2ac3f0b3d02a8104f1d86463
diff --git a/src/scripts/dataset/dataset.store.js b/src/scripts/dataset/dataset.store.js index <HASH>..<HASH> 100644 --- a/src/scripts/dataset/dataset.store.js +++ b/src/scripts/dataset/dataset.store.js @@ -597,15 +597,21 @@ let datasetStore = Reflux.createStore({ /** * Start Job */ - startJob(datasetId, appId, parameters, callback) { + startJob(snapshotId, appId, parameters, callback) { crn.createJob({ appId: appId, - datasetId: datasetId, + datasetId: snapshotId, userId: userStore.data.scitran._id, parameters: parameters }, (err, res) => { callback(err, res); - this.loadJobs(this.data.dataset._id); + this.update({showJobsModal: false}); + if (snapshotId !== this.data.dataset._id) { + let datasetId = this.data.dataset.original ? this.data.dataset.original : this.data.dataset._id; + router.transitionTo('snapshot', {datasetId, snapshotId}); + } else { + this.loadJobs(snapshotId); + } }); },
setup job submission to transition to the snapshot being submitted
OpenNeuroOrg_openneuro
train
js
5f90f601d20540df4ae23ec111a8abed059f7d10
diff --git a/drivers/ipvlan/ipvlan_endpoint.go b/drivers/ipvlan/ipvlan_endpoint.go index <HASH>..<HASH> 100644 --- a/drivers/ipvlan/ipvlan_endpoint.go +++ b/drivers/ipvlan/ipvlan_endpoint.go @@ -24,7 +24,7 @@ func (d *driver) CreateEndpoint(nid, eid string, ifInfo driverapi.InterfaceInfo, return fmt.Errorf("network id %q not found", nid) } if ifInfo.MacAddress() != nil { - return fmt.Errorf("%s interfaces do not support custom mac address assigment", ipvlanType) + return fmt.Errorf("%s interfaces do not support custom mac address assignment", ipvlanType) } ep := &endpoint{ id: eid,
Fix typo: assigment -> assignment
docker_libnetwork
train
go
a643252fdd8a4789354c686810666563dcb43f04
diff --git a/src/Composer/Wrapper.php b/src/Composer/Wrapper.php index <HASH>..<HASH> 100644 --- a/src/Composer/Wrapper.php +++ b/src/Composer/Wrapper.php @@ -42,8 +42,10 @@ class Wrapper protected function getComposerCommand() { - $command = '/usr/bin/env php '.$this->executable->getRealPath(); - return $command; + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + return PHP_BINARY . ' ' . $this->executable->getRealPath(); + } + return '/usr/bin/env php '.$this->executable->getRealPath(); } protected function getComposerArgs()
Use current PHP binary path when on Windows
Cotya_composer-test-framework
train
php
efbef0afc5d609c37410a5a2404b03ba54e4fb19
diff --git a/lang/en.php b/lang/en.php index <HASH>..<HASH> 100644 --- a/lang/en.php +++ b/lang/en.php @@ -1033,7 +1033,7 @@ $translations = array( 'UserCountry_continent_afr' => 'Africa', 'UserCountry_continent_ant' => 'Antarctica', 'UserCountry_continent_asi' => 'Asia', - 'UserCountry_continent_amm' => 'North America', + 'UserCountry_continent_amn' => 'North America', 'UserCountry_continent_amc' => 'Central America', 'UserCountry_continent_ams' => 'South America', 'UserCountry_continent_oce' => 'Oceania',
I assume this was a typo? I'm seeing UserCountry_continent_amn in the reports, rather than "North America" git-svn-id: <URL>
matomo-org_matomo
train
php
5ccff31f528b38397a12e88c4377d18e369a2e5c
diff --git a/script/bootstrap.py b/script/bootstrap.py index <HASH>..<HASH> 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -21,20 +21,26 @@ def main(): args = parse_args() update_submodules() bootstrap_brightray(args.url) - update_node_modules() - if sys.platform == 'cygwin': - update_win32_python() + + if not args.skip_network: + update_node_modules() + if sys.platform == 'cygwin': + update_win32_python() + update_atom_shell() def parse_args(): parser = argparse.ArgumentParser(description='Bootstrap this project') - parser.add_argument('--url', + parser.add_argument('-u', '--url', help='The base URL from which to download ' 'libchromiumcontent (i.e., the URL you passed to ' 'libchromiumcontent\'s script/upload script', default=BASE_URL, required=False) + parser.add_argument('-s', '--skip-network', + help='Skip operations require networking', + action='store_true') return parser.parse_args()
Add switch to skip operations require networking. I'm on a slow network :-(
electron_electron
train
py
6326ec8a4315bf1b2883669546be00630fb7fec8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -102,6 +102,7 @@ greater.""", package_dir={'gnupg': 'gnupg'}, packages=['gnupg'], package_data={'': ['README', 'LICENSE', 'TODO']}, + scripts=['versioneer.py'], install_requires=reqs, dependency_links=deps,
Add versioneer.py to scripts list in setup.py.
isislovecruft_python-gnupg
train
py
d5106ac0a8e64bcb1dd900f887bba4622209e473
diff --git a/src/NativeFileInfo.php b/src/NativeFileInfo.php index <HASH>..<HASH> 100644 --- a/src/NativeFileInfo.php +++ b/src/NativeFileInfo.php @@ -101,7 +101,9 @@ class NativeFileInfo implements IFileInfo { */ protected function getMode() { if (!$this->modeCache) { - $this->modeCache = $this->share->getAttribute($this->path, 'system.dos_attr.mode'); + $attribute = $this->share->getAttribute($this->path, 'system.dos_attr.mode'); + // parse hex string + $this->modeCache = hexdec(substr($attribute, 2)); } return $this->modeCache; } diff --git a/src/NativeShare.php b/src/NativeShare.php index <HASH>..<HASH> 100644 --- a/src/NativeShare.php +++ b/src/NativeShare.php @@ -248,10 +248,6 @@ class NativeShare implements IShare { $this->connect(); $result = $this->state->getxattr($this->buildUrl($path), $attribute); - // parse hex string - if ($attribute === 'system.dos_attr.mode') { - $result = hexdec(substr($result, 2)); - } return $result; }
Move decoding the attribute string to the place it belongs
icewind1991_SMB
train
php,php
5d7e10a86f6eefc751fa64fd42a4829d96f30089
diff --git a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/scroll/EndlessScrollHelper.java b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/scroll/EndlessScrollHelper.java index <HASH>..<HASH> 100644 --- a/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/scroll/EndlessScrollHelper.java +++ b/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/scroll/EndlessScrollHelper.java @@ -346,8 +346,8 @@ public class EndlessScrollHelper<Model> extends EndlessRecyclerOnScrollListener @Override public void onNewItems(@NonNull List<Model> newItems, int page) { - super.onNewItems(newItems, page); mExtraOnNewItemsListener.onNewItems(newItems, page); + super.onNewItems(newItems, page); } } @@ -361,8 +361,8 @@ public class EndlessScrollHelper<Model> extends EndlessRecyclerOnScrollListener @Override public void onNewItems(@NonNull List<Model> newItems, int page) { - super.onNewItems(newItems, page); mExtraOnNewItemsListener.onNewItems(newItems, page); + super.onNewItems(newItems, page); } } }
Executed extra callback first before delivering to the item adapter - This allows us to manipulate the destination "item adapter" before delivering the items.
mikepenz_FastAdapter
train
java
bbf3125ecde4db955881b0eb17f30ce19fcfe958
diff --git a/lib/Cake/Test/TestCase/Network/Email/EmailTest.php b/lib/Cake/Test/TestCase/Network/Email/EmailTest.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Test/TestCase/Network/Email/EmailTest.php +++ b/lib/Cake/Test/TestCase/Network/Email/EmailTest.php @@ -879,6 +879,17 @@ class EmailTest extends TestCase { } /** + * Test that using an invalid profile fails. + * + * @expectedException Cake\Error\Exception + * @expectedExceptionMessage Unknown email configuration "derp". + */ + public function testProfileInvalid() { + $email = new Email(); + $email->profile('derp'); + } + +/** * testConfigString method * * @return void
Add missing test to show that profile() throws exceptions When using an invalid profile name an exception should be raised.
cakephp_cakephp
train
php
0d9eca7fdfaff50bc81434cea4e7805f44a56a77
diff --git a/hazelcast/src/test/java/com/hazelcast/test/AbstractParameterizedHazelcastClassRunner.java b/hazelcast/src/test/java/com/hazelcast/test/AbstractParameterizedHazelcastClassRunner.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/test/java/com/hazelcast/test/AbstractParameterizedHazelcastClassRunner.java +++ b/hazelcast/src/test/java/com/hazelcast/test/AbstractParameterizedHazelcastClassRunner.java @@ -92,6 +92,14 @@ public abstract class AbstractParameterizedHazelcastClassRunner extends BlockJUn return getTestClass().getOnlyConstructor().newInstance(fParameters); } + @Override + protected void validateConstructor(List<Throwable> errors) { + validateOnlyOneConstructor(errors); + if (fieldsAreAnnotated() || !isParameterized) { + validateZeroArgConstructor(errors); + } + } + private Object createTestUsingFieldInjection() throws Exception { List<FrameworkField> annotatedFieldsByParameter = getAnnotatedFieldsByParameter(); if (annotatedFieldsByParameter.size() != fParameters.length) {
Allow arguements in test constructors when they are parametrized We only allow it when fields are not parametrized it's not allowed to combine both constructors and field parametrization. This makes is aligned with the ParametrizedRunner supplied with JUnit
hazelcast_hazelcast
train
java
9948a703a63f03f8209c034a5ae36d0fc2e2b27f
diff --git a/tk_tools/groups.py b/tk_tools/groups.py index <HASH>..<HASH> 100644 --- a/tk_tools/groups.py +++ b/tk_tools/groups.py @@ -12,7 +12,7 @@ from tk_tools.images import minus class Grid(ttk.Frame): padding = 3 - r""" + """ Creates a grid of widgets (intended to be subclassed). :param parent: the tk parent element of this frame @@ -90,7 +90,7 @@ class Grid(ttk.Frame): class LabelGrid(Grid): - r""" + """ A table-like display widget. :param parent: the tk parent element of this frame
Removing 'r' as a documentation test
slightlynybbled_tk_tools
train
py
626b3af0ed1e3a4ca2ea598bb4ab6917830d3136
diff --git a/__tests__/situation/mousemove.js b/__tests__/situation/mousemove.js index <HASH>..<HASH> 100644 --- a/__tests__/situation/mousemove.js +++ b/__tests__/situation/mousemove.js @@ -12,7 +12,7 @@ describe("chimee's binder", () => { // 编解码容器 box: 'native', // dom容器 - wrapper: 'body', + wrapper: document.body, plugin: [], events: {}, });
test: finish situation/mousemove unit test recovery
Chimeejs_chimee
train
js
9e59d86dda60c26250ff76c939556c4c7a67e133
diff --git a/topiary.js b/topiary.js index <HASH>..<HASH> 100644 --- a/topiary.js +++ b/topiary.js @@ -1,4 +1,8 @@ -;(function() { +/** + * @namespace + * @name topiary + */; +(function() { "use strict"; var ERROR_MESSAGES = {
Trying to get jsdoc to pick up the comments in the immediately executed function.
BladeRunnerJS_topiarist
train
js
334c000d5a6d19133e3ce3b7a2c847cd682f4ebf
diff --git a/llvmlite/binding/ffi.py b/llvmlite/binding/ffi.py index <HASH>..<HASH> 100644 --- a/llvmlite/binding/ffi.py +++ b/llvmlite/binding/ffi.py @@ -183,7 +183,8 @@ else: for _lib_path in _lib_paths: try: lib = ctypes.CDLL(_lib_path) - except OSError: + except OSError as e: + print(e) continue else: break
print the OSError instead of swallowing it As title
numba_llvmlite
train
py
45ef0ba0e403ef3d7e1f605bbf52f16d5601db63
diff --git a/connector.go b/connector.go index <HASH>..<HASH> 100644 --- a/connector.go +++ b/connector.go @@ -324,6 +324,9 @@ func (c *Connector) UpdateObject(obj IBObject, ref string) (refRes string, err e return } +// Logout sends a request to invalidate the ibapauth cookie and should +// be used in a defer statement after the Connector has been successfully +// initialized. func (c *Connector) Logout() (err error) { _, err = c.makeRequest(CREATE, nil, "logout") if err != nil {
Document for Logout() method. (#<I>) Fixes golint suggestion: === connector.go:<I>:1: exported method Connector.Logout should have comment or be unexported ===
infobloxopen_infoblox-go-client
train
go
26a94e8b30a0671bff92cd34cb3ffb1bd2916e9b
diff --git a/Table.php b/Table.php index <HASH>..<HASH> 100644 --- a/Table.php +++ b/Table.php @@ -158,7 +158,7 @@ abstract class Nada_Table /** * Return all columns - * @return array + * @return array Array of Nada_Column objects with column names as keys */ public function getColumns() {
Completed getColumns() documentation.
hschletz_NADA
train
php
a65808c2311055b79dc0fd3b0dae5252bf82c99c
diff --git a/packages/node_modules/@webex/internal-plugin-services/test/integration/spec/services.js b/packages/node_modules/@webex/internal-plugin-services/test/integration/spec/services.js index <HASH>..<HASH> 100644 --- a/packages/node_modules/@webex/internal-plugin-services/test/integration/spec/services.js +++ b/packages/node_modules/@webex/internal-plugin-services/test/integration/spec/services.js @@ -28,8 +28,8 @@ describe('plugin-services', () => { }, 3000); })) .then(() => webex.internal.device.register()) - .then(() => services.updateServices('userId', webexUser.id)) - .then(() => services.waitUntilReady())); + .then(() => services.waitUntilReady()) + .then(() => services.updateServices('userId', webexUser.id))); describe('#status', () => { it('updates ready when services ready', () => {
fix(internal-plugin-services): update before each int test Update before each int test to run limited catalog request after authed catalog request.
webex_spark-js-sdk
train
js
3a59deda4e8f19aa5f369755b5c01da99b05b254
diff --git a/tests/integration/standard/test_authentication.py b/tests/integration/standard/test_authentication.py index <HASH>..<HASH> 100644 --- a/tests/integration/standard/test_authentication.py +++ b/tests/integration/standard/test_authentication.py @@ -13,6 +13,7 @@ # limitations under the License. import logging +import time from cassandra.cluster import Cluster, NoHostAvailable from cassandra.auth import PlainTextAuthProvider, SASLClient, SaslAuthProvider @@ -36,7 +37,10 @@ def setup_module(): 'authorizer': 'CassandraAuthorizer'} ccm_cluster.set_configuration_options(config_options) log.debug("Starting ccm test cluster with %s", config_options) - ccm_cluster.start(wait_for_binary_proto=True) + ccm_cluster.start(wait_for_binary_proto=True, wait_other_notice=True) + # there seems to be some race, with some versions of C* taking longer to + # get the auth (and default user) setup. Sleep here to give it a chance + time.sleep(2) def teardown_module():
Sleep for auth test, allowing C* to setup internally
datastax_python-driver
train
py
19d40069c89f3d42f48dba29e85c6f82f3036d1a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,7 @@ var path = require('path'); module.exports = function(glob) { 'use strict'; var source = minimatch.makeRe(path.resolve(glob)).source.replace(/\\\//g, '[\\\\\\/]'); - var partial = (glob.slice(-1) !== '*') ? source.replace('$', '') : source; + var partial = (glob.slice(-1) === '*') ? source : source.replace('$', ''); var pattern = new RegExp(partial); return through.obj(function(file, encoding, done) { var analysis = pattern.exec(path.dirname(file.path));
fix for globs that feature trailing ** to match all the way to the file
bholloway_gulp-semiflat
train
js
c224a11b5ce15e11ad54cd0fcfd570dab7557505
diff --git a/tests/test_utilities.py b/tests/test_utilities.py index <HASH>..<HASH> 100644 --- a/tests/test_utilities.py +++ b/tests/test_utilities.py @@ -120,7 +120,7 @@ class SynchronizationUtilitiesTest(unittest.TestCase): # Validate conditions : # .. Thread 1 started after start (obvious) - self.assertGreater(result[1], start, "Thread 1 started too soon") + self.assertGreaterEqual(result[1], start, "Thread 1 started too soon") # .. Thread 2 started at least 0.4 secs after thread 1 (due to the lock) # (0.4 instead of 0.5: some systems are not that precise)
Updated tests for Win<I> threading speed Either Win<I> threads are really fast to start, or its time.time() method is not as precise as in Linux, but main thread and started thread times were equal.
tcalmant_ipopo
train
py
c76a2c5bd48c898bb1adf6877dbfc4b37111700d
diff --git a/lib/handlers/bin.js b/lib/handlers/bin.js index <HASH>..<HASH> 100644 --- a/lib/handlers/bin.js +++ b/lib/handlers/bin.js @@ -189,6 +189,8 @@ module.exports = Observable.extend({ return next(new errors.NotFound('Could not find bin: ' + req.params.bin)); } else { req.bin = result; + // manually add the full url to the bin to allow templates access + req.bin.permalink = req.helpers.urlForBin(req.bin, true); next(); } } @@ -297,7 +299,9 @@ module.exports = Observable.extend({ }; }, templateFromBin: function (bin) { - return utils.extract(bin, 'html', 'css', 'javascript'); + var template = utils.extract(bin, 'html', 'css', 'javascript'); + template.url = bin.permalink; + return template; }, defaultFiles: function () { return ['html', 'css', 'js'].map(function (ext) {
Fixed url not being passed through the template
jsbin_jsbin
train
js
1340c436e8c111dc9eb94997c5cf818bc8bfd42e
diff --git a/spec/unit/run_spec.rb b/spec/unit/run_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/run_spec.rb +++ b/spec/unit/run_spec.rb @@ -164,7 +164,8 @@ RSpec.describe TTY::Command, "#run" do ]) end - it "does not persist environment variables" do + it "does not persist environment variables", + unless: RSpec::Support::OS.windows? do output = StringIO.new command = TTY::Command.new(output: output) @@ -172,7 +173,8 @@ RSpec.describe TTY::Command, "#run" do output.rewind lines = output.readlines - expect(lines[0]).to include("Running \e[33;1m( export FOO=\"1\" ; echo hello )\e[0m\n") + expect(lines[0]) + .to include("Running \e[33;1m( export FOO=\"1\" ; echo hello )\e[0m\n") output.reopen
Change to skip running environment variables test on Windows
piotrmurach_tty-command
train
rb
2326f410e26f37632cef0858305f4e62e47dbd84
diff --git a/scan/lib/scan/runner.rb b/scan/lib/scan/runner.rb index <HASH>..<HASH> 100644 --- a/scan/lib/scan/runner.rb +++ b/scan/lib/scan/runner.rb @@ -93,6 +93,7 @@ module Scan puts("") copy_simulator_logs + zip_build_products if result[:failures] > 0 open_report @@ -104,7 +105,6 @@ module Scan UI.test_failure!("Test execution failed. Exit status: #{tests_exit_status}") end - zip_build_products open_report end
Always zip build products (#<I>)
fastlane_fastlane
train
rb
30847c2955b5b306a8c0d65448c5325021d2ae6f
diff --git a/lib/ast/processor/mixin.rb b/lib/ast/processor/mixin.rb index <HASH>..<HASH> 100644 --- a/lib/ast/processor/mixin.rb +++ b/lib/ast/processor/mixin.rb @@ -37,7 +37,7 @@ module AST # require 'ast' # # class ArithmeticsProcessor - # include AST::Processor::Module + # include AST::Processor::Mixin # # This method traverses any binary operators such as (add) # # or (multiply). # def process_binary_op(node)
correct Mixin module constant in code example (#<I>)
whitequark_ast
train
rb
b598758a1d725b0e1a432bc204076913873ef6b2
diff --git a/src/Finder.php b/src/Finder.php index <HASH>..<HASH> 100644 --- a/src/Finder.php +++ b/src/Finder.php @@ -12,6 +12,7 @@ namespace Flyfinder; +use Generator; use League\Flysystem\FilesystemInterface; use League\Flysystem\PluginInterface; use Flyfinder\Specification\SpecificationInterface;
Imported class Generator on Finder (this was overlooked before)
phpDocumentor_FlyFinder
train
php
30ba9df07c4c25fc9f40b4fba06750060b75e149
diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php +++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php @@ -28,9 +28,11 @@ class ExceptionListenerPass implements CompilerPassInterface } // register the exception controller only if Twig is enabled - $engines = $container->getParameter('templating.engines'); - if (!in_array('twig', $engines)) { - $container->removeDefinition('twig.exception_listener'); + if ($container->hasParameter('templating.engines')) { + $engines = $container->getParameter('templating.engines'); + if (!in_array('twig', $engines)) { + $container->removeDefinition('twig.exception_listener'); + } } } }
[TwigBundle] always load the exception listener if the templating.engines is not present
symfony_symfony
train
php
7eb4a53e4cceaf8ddda398b692fa8b41723ac7b3
diff --git a/test/acceptance/index.js b/test/acceptance/index.js index <HASH>..<HASH> 100644 --- a/test/acceptance/index.js +++ b/test/acceptance/index.js @@ -33,8 +33,8 @@ if (isTravisTest) { // @todo This should become localhost to utilize the Travis saucelabs addon tunnel // But it seems Edge and Safari fail on that right now, so targeting uppy.io instead. // That is unideal, as we are then testing a previous deploy, and not the current build - // host = localHost - host = remoteHost + // host = remoteHost + host = localHost } else if (isRemoteTest) { // We're not too sure about a working tunnel otherwise, best just test uppy.io host = remoteHost @@ -112,6 +112,10 @@ var specificTests = { function runAllTests () { if (isRemoteTest) { + // run custom platform-specific tests here + // fallback test + specificTests.fallback() + // run all tests for all platforms platforms.forEach(function (platform) { tests.forEach(function (test) { @@ -119,10 +123,6 @@ function runAllTests () { test(driver, platform, host) }) }) - - // run custom platform-specific tests here - // fallback test - specificTests.fallback() } else { // run tests just for local Firefox tests.forEach(function (test) {
try the tunnel now and fallback-test first
transloadit_uppy
train
js
0ef7bcbc1ffa80815d7636f5efca7dfb6e248885
diff --git a/events.js b/events.js index <HASH>..<HASH> 100644 --- a/events.js +++ b/events.js @@ -412,7 +412,7 @@ exports.timeout = function (state, ev) { var ignore_id = want[feed_id] eachFrom(peer_ids, ignore_id, function (peer_id) { var peer = state.peers[peer_id] - if(peer.clock[feed_id] || 0 > state.clock[feed_id] || 0) { + if(peer.clock && peer.clock[feed_id] || 0 > state.clock[feed_id] || 0) { peer.replicating = peer.replicating || {} var rep = peer.replicating[feed_id] = peer.replicating[feed_id] || { tx: false, rx: true, sent: -1, requested: state.clock[feed_id]
handle case where timeout happens when a peer's clock hasn't loaded yet
dominictarr_epidemic-broadcast-trees
train
js
537945cae718641a755fe181e9d82016b146d7e2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ setup( 'toml', 'argparse', 'algorithmia-api-client==1.5.1', - 'algorithmia-adk>=1.1,<1.2' + 'algorithmia-adk>=1.2,<1.3' ], include_package_data=True, classifiers=[
updated to track ADK changes (#<I>)
algorithmiaio_algorithmia-python
train
py
185d0ab953b31d7f0df007754fdcc90468a0d6cf
diff --git a/aeron-cluster/src/test/java/io/aeron/cluster/TestCluster.java b/aeron-cluster/src/test/java/io/aeron/cluster/TestCluster.java index <HASH>..<HASH> 100644 --- a/aeron-cluster/src/test/java/io/aeron/cluster/TestCluster.java +++ b/aeron-cluster/src/test/java/io/aeron/cluster/TestCluster.java @@ -331,22 +331,21 @@ public class TestCluster implements AutoCloseable TestNode findLeader(final int skipIndex) { - TestNode leaderNode = null; - for (int i = 0; i < staticMemberCount; i++) { - if (i == skipIndex || null == nodes[i] || nodes[i].isClosed()) + final TestNode node = nodes[i]; + if (i == skipIndex || null == node || node.isClosed()) { continue; } - if (Cluster.Role.LEADER == nodes[i].role()) + if (Cluster.Role.LEADER == node.role() && null == node.electionState()) { - leaderNode = nodes[i]; + return node; } } - return leaderNode; + return null; } TestNode findLeader()
[Java] Find leader after election has completed.
real-logic_aeron
train
java
881f55bf44f86dce981f4ff021761b68d239a5de
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -58,14 +58,14 @@ author = 'Phoenix Zerin' # built documents. # -# :see: http://stackoverflow.com/a/2073599/ -from pkg_resources import require -__version__ = require('PyOTA')[0].version - -# The short X.Y version. -version = __version__ -# The full version, including alpha/beta/rc tags. -release = __version__ +# # :see: http://stackoverflow.com/a/2073599/ +# from pkg_resources import require +# __version__ = require('PyOTA')[0].version +# +# # The short X.Y version. +# version = __version__ +# # The full version, including alpha/beta/rc tags. +# release = __version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.
Removed readthedocs-breaking configuration.
iotaledger_iota.lib.py
train
py
d9ad8c961c01357cb6f0efc7678f6198761e6631
diff --git a/libnetwork/sandbox_store.go b/libnetwork/sandbox_store.go index <HASH>..<HASH> 100644 --- a/libnetwork/sandbox_store.go +++ b/libnetwork/sandbox_store.go @@ -128,6 +128,12 @@ func (sb *sandbox) storeUpdate() error { retry: sbs.Eps = nil for _, ep := range sb.getConnectedEndpoints() { + // If the endpoint is not persisted then do not add it to + // the sandbox checkpoint + if ep.Skip() { + continue + } + eps := epState{ Nid: ep.getNetwork().ID(), Eid: ep.ID(),
Skip non-persistent endpoints in sandbox store If the endpoint and the corresponding network is not persistent then skip adding it into sandbox store.
moby_moby
train
go
89115e6cc339e6b5d733e5aff0b307ab7d63c3b1
diff --git a/Swat/SwatFlydown.php b/Swat/SwatFlydown.php index <HASH>..<HASH> 100644 --- a/Swat/SwatFlydown.php +++ b/Swat/SwatFlydown.php @@ -127,10 +127,10 @@ class SwatFlydown extends SwatOptionControl implements SwatState $data = &$this->getForm()->getFormData(); - if (!isset($data[$this->id])) - return; - - $this->value = unserialize($data[$this->id]); + if (isset($data[$this->id])) + $this->value = unserialize($data[$this->id]); + else + $this->value = null; if ($this->required && $this->value === null) { $msg = Swat::_('The %s field is required.');
Properly process when value does not exist in POST data. This occurs with the SwatRadioList subclass of SwatFlydown. svn commit r<I>
silverorange_swat
train
php
8ca0cc9b39b87eb9fe68fad6b1ec8becc055bed3
diff --git a/spec/custom_deploy_spec.rb b/spec/custom_deploy_spec.rb index <HASH>..<HASH> 100644 --- a/spec/custom_deploy_spec.rb +++ b/spec/custom_deploy_spec.rb @@ -1,4 +1,6 @@ require File.dirname(__FILE__) + '/spec_helper' +require 'tmpdir' +require 'fileutils' describe "the EY::Serverside::Deploy API" do it "calls tasks in the right order" do @@ -53,15 +55,17 @@ describe "the EY::Serverside::Deploy API" do end before(:each) do - @tempdir = `mktemp -d -t custom_deploy_spec.XXXXX`.strip + @tempdir = Dir.mktmpdir('custom_deploy_spec.XXXXX') @config = EY::Serverside::Deploy::Configuration.new('repository_cache' => @tempdir) @deploy = TestQuietDeploy.new(@config) end + after do + FileUtils.rm_rf(@tempdir) + end + def write_eydeploy(relative_path, contents = "def got_new_methods() 'from the file on disk' end") - FileUtils.mkdir_p(File.join( - @tempdir, - File.dirname(relative_path))) + FileUtils.mkdir_p(File.join(@tempdir, File.dirname(relative_path))) File.open(File.join(@tempdir, relative_path), 'w') do |f| f.write contents
use ruby tmpdir to generate temp deploy directories
engineyard_engineyard-serverside
train
rb
8d66a84e021662830b20ff697ef603f86c5d36df
diff --git a/lib/pact/consumer_contract/interaction.rb b/lib/pact/consumer_contract/interaction.rb index <HASH>..<HASH> 100644 --- a/lib/pact/consumer_contract/interaction.rb +++ b/lib/pact/consumer_contract/interaction.rb @@ -5,7 +5,7 @@ module Pact class Interaction include ActiveSupportSupport - attr_accessor :description, :request, :response, :provider_state, :provider_states, :metadata + attr_accessor :description, :request, :response, :provider_state, :provider_states, :metadata, :_id def initialize attributes = {} @description = attributes[:description] @@ -14,6 +14,7 @@ module Pact @provider_state = attributes[:provider_state] || attributes[:providerState] @provider_states = attributes[:provider_states] @metadata = attributes[:metadata] + @_id = attributes[:_id] end def self.from_hash hash, options = {}
feat: parse interaction _id from Pact Broker
pact-foundation_pact-support
train
rb
105f0c54705e911a94a3a202be8f3b337e5cce7c
diff --git a/src/java/com/threerings/admin/server/PrefsConfigRegistry.java b/src/java/com/threerings/admin/server/PrefsConfigRegistry.java index <HASH>..<HASH> 100644 --- a/src/java/com/threerings/admin/server/PrefsConfigRegistry.java +++ b/src/java/com/threerings/admin/server/PrefsConfigRegistry.java @@ -34,7 +34,7 @@ public class PrefsConfigRegistry extends ConfigRegistry // documentation inherited protected ObjectRecord createObjectRecord (String path, DObject object) { - return null; + return new PrefsObjectRecord(path, object); } protected class PrefsObjectRecord extends ObjectRecord
Whoops, needed to finish the re-refactor. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1
threerings_narya
train
java
0fd4f9252094dc86c3deb922b527b27a050a7f02
diff --git a/net/http/Message.php b/net/http/Message.php index <HASH>..<HASH> 100644 --- a/net/http/Message.php +++ b/net/http/Message.php @@ -116,7 +116,6 @@ class Message extends \lithium\net\Message { $this->headers[$header] = $value; } } - $headers = array(); foreach ($this->headers as $key => $value) {
Removing mistakenly added blank line.
UnionOfRAD_lithium
train
php
8b924f3894f0a20060bd7802fece58ef9057b8cc
diff --git a/auth.php b/auth.php index <HASH>..<HASH> 100644 --- a/auth.php +++ b/auth.php @@ -115,7 +115,7 @@ class Auth { * @param $pw string **/ protected function _ldap($id,$pw) { - $port=intval($this->args['port']?:389); + $port=(int)($this->args['port']?:389); $filter=$this->args['filter']=$this->args['filter']?:"uid=".$id; $this->args['attr']=$this->args['attr']?:["uid"]; array_walk($this->args['attr'],
Improve auth.php intval() call replaced with int type cast
bcosca_fatfree-core
train
php
cd8b9210639a5923831fc95acae4546b388e185b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -13,11 +13,11 @@ Compatible with Django. Flask coming soon. from setuptools import setup, find_packages -tests_require = map(lambda x: x.strip(), open('requirements.txt').readlines()) +tests_require = ['Django'] setup( name='proofread', - version='0.1.1', + version='0.1.2', author='Matt Robenolt', author_email='[email protected]', url='https://github.com/mattrobenolt/proofread',
I apparently don't know how python works anymore
mattrobenolt_proofread
train
py
0e79b7222c71df62a24e86df6c6fbebf9cd911fc
diff --git a/lib/terminal.js b/lib/terminal.js index <HASH>..<HASH> 100644 --- a/lib/terminal.js +++ b/lib/terminal.js @@ -613,7 +613,8 @@ this.inject = function(str) { if (thisBuffer.length < otherBuffer.length) { // We need to add the extra lines for(var i = thisBuffer.length ; i < otherBuffer.length; i++) { - diff.push({action: 'add', type: 'line', data: {lineNumber: i, line: otherBuffer[i]}}); + var otherLine = otherBuffer[i] || emptyLine; + diff.push({action: 'add', type: 'line', data: {lineNumber: i, line: otherLine}}); } }
empty lines need to have a correct struct to be serialized
Gottox_terminal.js
train
js
2d9965e1dc114087c003b80d53db04a7e277f4ec
diff --git a/lib/accesslib.php b/lib/accesslib.php index <HASH>..<HASH> 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -2214,19 +2214,21 @@ function get_component_string($component, $contextlevel) { } /** gets the list of roles assigned to this context + * and up (parents) * @param object $context * @return array */ function get_roles_used_in_context($context) { global $CFG; - - return get_records_sql('SELECT distinct r.id, r.name, r.shortname - FROM '.$CFG->prefix.'role_assignments ra, - '.$CFG->prefix.'role r + + $contextlist = get_related_contexts_string($context); + return get_records_sql("SELECT distinct r.id, r.name, r.shortname + FROM {$CFG->prefix}role_assignments ra, + {$CFG->prefix}role r WHERE r.id = ra.roleid - AND ra.contextid = '.$context->id.' - ORDER BY r.sortorder ASC'); + AND ra.contextid $contextlist + ORDER BY r.sortorder ASC"); } /** this function is used to print roles column in user profile page.
function should be looking up parent contexts too
moodle_moodle
train
php
51247696dec3683b04c4e6a082dfb9485e4ed7c8
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -282,7 +282,7 @@ module.exports = function (grunt) { verbose: true, builder: 'kss/builder', title: 'PatternLab', - css: 'css/themes/base/base.css' + css: ['css/themes/base/base.css', '../css/kss/base.css'] }, src: ['sass/base', 'sass/themes/base'], dest: 'dist'
updated kss task to actually build the new kss base.scss
comicrelief_pattern-lab
train
js
70c12709d0e61ef715d0c25b22c25a83e6d9a40a
diff --git a/utils/modelgen/spell-training/training-api.py b/utils/modelgen/spell-training/training-api.py index <HASH>..<HASH> 100644 --- a/utils/modelgen/spell-training/training-api.py +++ b/utils/modelgen/spell-training/training-api.py @@ -32,20 +32,13 @@ def training_data(job_id): first_vec = cur.fetchone() input_vector_length = 0 if (first_vec is None) else first_vec[0]['reductions'] + num_classes = max([int(l) for v, l in training_examples], default=-1) + 1 + data = { 'training_examples': training_examples, 'num_examples': num_examples, - 'input_vector_length': input_vector_length - } - return jsonify(data) - - -# Returns number of classes we are classifying -# TODO: Populate using DB data instead of hardcoding [email protected]('/num_classes') -def num_classes(): - data = { - 'num_classes': 2 + 'input_vector_length': input_vector_length, + 'num_classes': num_classes } return jsonify(data)
Dynamically compute num_classes, add to root endpoint
empirical-org_Quill-NLP-Tools-and-Datasets
train
py
4fd59ea0fd7b53804e6840e0c2cb642a03367fb9
diff --git a/src/Illuminate/Database/Eloquent/Collection.php b/src/Illuminate/Database/Eloquent/Collection.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Database/Eloquent/Collection.php +++ b/src/Illuminate/Database/Eloquent/Collection.php @@ -124,7 +124,7 @@ class Collection extends BaseCollection implements QueueableCollection { $result = parent::map($callback); - return $result->contains(function ($_, $item) { + return $result->contains(function ($item) { return ! ($item instanceof Model); }) ? $result->toBase() : $result; }
good change in arguments for contains closure in <I>
laravel_framework
train
php
ad6689062a5306fd55f4e616c18ab1f9ba02a02d
diff --git a/cauldron/test/test_runner.py b/cauldron/test/test_runner.py index <HASH>..<HASH> 100644 --- a/cauldron/test/test_runner.py +++ b/cauldron/test/test_runner.py @@ -71,6 +71,9 @@ class TestRunner(scaffolds.ResultsTest): with open(os.path.join(lib_directory, '__init__.py'), 'w') as fp: fp.write('TEST_VALUE = 1\n') + # TODO: Fix these forced pauses + time.sleep(1) + support.add_step(self, contents='\n'.join([ 'import cauldron as cd', 'import _jack',
Unit Testing Fix io race condition in test_runner.py unit tests.
sernst_cauldron
train
py
ef4a564f77c752e28eb32e5aa47734ab4b82a72e
diff --git a/jmetal-core/src/test/java/org/uma/jmetal/operator/crossover/BLXAlphaCrossoverTest.java b/jmetal-core/src/test/java/org/uma/jmetal/operator/crossover/BLXAlphaCrossoverTest.java index <HASH>..<HASH> 100644 --- a/jmetal-core/src/test/java/org/uma/jmetal/operator/crossover/BLXAlphaCrossoverTest.java +++ b/jmetal-core/src/test/java/org/uma/jmetal/operator/crossover/BLXAlphaCrossoverTest.java @@ -6,7 +6,6 @@ import org.mockito.Mockito; import org.springframework.test.util.ReflectionTestUtils; import org.uma.jmetal.operator.crossover.impl.BLXAlphaCrossover; import org.uma.jmetal.problem.doubleproblem.DoubleProblem; -import org.uma.jmetal.problem.doubleproblem.impl.AbstractDoubleProblem; import org.uma.jmetal.problem.doubleproblem.impl.DummyDoubleProblem; import org.uma.jmetal.solution.doublesolution.DoubleSolution; import org.uma.jmetal.solution.doublesolution.impl.DefaultDoubleSolution;
Refactor class BLXAlphaCrossoverTest
jMetal_jMetal
train
java
758ba2f2d3b65d61659bb0d120feaff9d14c4978
diff --git a/register.js b/register.js index <HASH>..<HASH> 100644 --- a/register.js +++ b/register.js @@ -43,8 +43,6 @@ function register(implementation){ if(implementation !== null){ // require implementation if we haven't done yet and is specified registered = loadImplementation(implementation) - // register preference globally in case multiple installations - global[REGISTRATION_KEY] = registered } else if(shouldPreferGlobalPromise()){ // if no implementation or env specified use global.Promise registered = loadGlobal() @@ -54,6 +52,9 @@ function register(implementation){ // to load something without throwing error registered = tryAutoDetect() } + + // register preference globally in case multiple installations + global[REGISTRATION_KEY] = registered } if(registered === null){
Global Registration on auto-detect - Store registration even if auto detected to enforce registration happens before load of duplicated module.
kevinbeaty_any-promise
train
js
e0cf7240fe37c5f44b66563db29c07bc1188805b
diff --git a/src/test/java/org/zwobble/mammoth/tests/xml/XmlParserTests.java b/src/test/java/org/zwobble/mammoth/tests/xml/XmlParserTests.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/zwobble/mammoth/tests/xml/XmlParserTests.java +++ b/src/test/java/org/zwobble/mammoth/tests/xml/XmlParserTests.java @@ -58,9 +58,16 @@ public class XmlParserTests { } @Test - public void unmappedNamespaceUrisAreIncludedInBracesAsPrefix() { + public void unmappedNamespaceUrisInElementNamesAreIncludedInBracesAsPrefix() { assertThat( XmlParser.parseString("<w:body xmlns:w='word'/>"), is(new XmlElement("{word}body"))); } + + @Test + public void unmappedNamespaceUrisInAttributeNamesAreIncludedInBracesAsPrefix() { + assertThat( + XmlParser.parseString("<body xmlns:w='word' w:name='bob'></body>"), + is(new XmlElement("body", ImmutableMap.of("{word}name", "bob")))); + } }
Add test for attribute names with URIs
mwilliamson_java-mammoth
train
java
4651f5a885ea49550227d0a8f97721a2e31a24c4
diff --git a/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerStringAbstract.java b/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerStringAbstract.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerStringAbstract.java +++ b/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerStringAbstract.java @@ -300,10 +300,12 @@ public abstract class ORecordSerializerStringAbstract implements ORecordSerializ if (index > 0) if (!integer && c == 'E') { // CHECK FOR SCIENTIFIC NOTATION - if (index < iValue.length()) - index++; - if (iValue.charAt(index) == '-') + if (index < iValue.length()) { + if (iValue.charAt(index + 1) == '-') + // JUMP THE DASH IF ANY (NOT MANDATORY) + index++; continue; + } } else if (c == 'f') return OType.FLOAT; else if (c == 'c')
Fixed bug on double and float reported by Salvatore Piccione in ML: scientific notation waited for a - after the "E". Example: <I>E-9 but Java toString() produces: <I>E9. Now both the syntaxes are supported.
orientechnologies_orientdb
train
java
35d5835f9e0721ac9b30f6572ab2cd8828777279
diff --git a/lib/jets/builders/code_builder.rb b/lib/jets/builders/code_builder.rb index <HASH>..<HASH> 100644 --- a/lib/jets/builders/code_builder.rb +++ b/lib/jets/builders/code_builder.rb @@ -258,7 +258,7 @@ class Jets::Builders time :create_zip_file def package_ruby - packager = RubyPackager.new(tmp_app_root) + packager = RubyPackager.new(tmp_app_root, full_project_path) packager.reconfigure_ruby_version packager.clean_old_submodules packager.bundle_install diff --git a/lib/jets/builders/ruby_packager.rb b/lib/jets/builders/ruby_packager.rb index <HASH>..<HASH> 100644 --- a/lib/jets/builders/ruby_packager.rb +++ b/lib/jets/builders/ruby_packager.rb @@ -3,8 +3,9 @@ class Jets::Builders include Util attr_reader :tmp_app_root - def initialize(tmp_app_root) + def initialize(tmp_app_root, full_project_path) @tmp_app_root = tmp_app_root + @full_project_path = full_project_path end # This is in case the user has a 2.5.x variant.
fix @full_project_path
tongueroo_jets
train
rb,rb
d4916785c989c1aeb47c003bc0e0efaf8b7ed9d6
diff --git a/src/main/java/com/sdl/selenium/extjs6/grid/Grid.java b/src/main/java/com/sdl/selenium/extjs6/grid/Grid.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/sdl/selenium/extjs6/grid/Grid.java +++ b/src/main/java/com/sdl/selenium/extjs6/grid/Grid.java @@ -158,7 +158,6 @@ public class Grid extends Table { } public boolean check(Row row) { - ready(true); scrollInGrid(row); boolean checked = false; Cell firstCell = new Cell(row).setClasses("x-grid-cell-row-checker").setVisibility(true); @@ -187,7 +186,6 @@ public class Grid extends Table { } public boolean unCheck(Row row) { - ready(true); scrollInGrid(row); boolean checked = false; Cell firstCell = new Cell(row).setClasses("x-grid-cell-row-checker").setVisibility(true);
improvement check(Row row) in Grid
sdl_Testy
train
java
0a801d702dc41dae7eac0c802b822493ddc3ac41
diff --git a/Makefile.js b/Makefile.js index <HASH>..<HASH> 100644 --- a/Makefile.js +++ b/Makefile.js @@ -26,7 +26,8 @@ const lodash = require("lodash"), ejs = require("ejs"), loadPerf = require("load-perf"), yaml = require("js-yaml"), - { CLIEngine } = require("./lib/cli-engine"); + { CLIEngine } = require("./lib/cli-engine"), + builtinRules = require("./lib/rules/index"); const { cat, cd, cp, echo, exec, exit, find, ls, mkdir, pwd, rm, test } = require("shelljs"); @@ -959,7 +960,9 @@ function createConfigForPerformanceTest() { "rules:" ]; - content.push(...ls("lib/rules").map(fileName => ` ${path.basename(fileName, ".js")}: 1`)); + for (const [ruleId] of builtinRules) { + content.push(` ${ruleId}: 1`); + } content.join("\n").to(PERF_ESLINTRC); }
Chore: improve perf test (#<I>) it removed something in created config for perf test: a. rule config for deprecated rules b. index, utils. the result of ls() includes index.js and utils/* while they are not rules, that's say, it's not a 'valid' config
eslint_eslint
train
js
ec369a87dd26f4159922a2ed456ec799ae201d5d
diff --git a/spec/pixrem-spec.js b/spec/pixrem-spec.js index <HASH>..<HASH> 100644 --- a/spec/pixrem-spec.js +++ b/spec/pixrem-spec.js @@ -132,7 +132,6 @@ describe('pixrem', function () { expected = '.rule { font-size: 40px; font-size: 2rem; } :root { font: italic 100 20px/24px sans-serif }'; processed = pixrem.process(css); expect(processed).toBe(expected); - }); it('should run through font shorthand without root size', function () { @@ -145,7 +144,12 @@ describe('pixrem', function () { it('should expose postcss processor', function () { var expected = postcss().use(pixrem).process('a { width: 2rem }').css; - expect('a { width: 32px; width: 2rem }').toBe(expected); - }) + expect(expected).toBe('a { width: 32px; width: 2rem }'); + }); + + it('should expose processor and allow options', function () { + var expected = postcss().use(pixrem('10px', {replace: true})).process('a { width: 2rem }').css; + expect(expected).toBe('a { width: 20px }'); + }); });
Add a test about options when pipe into postcss
robwierzbowski_node-pixrem
train
js
c93a3654e7dd88a2077ac23fd74dd90c540e2241
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ try: except subprocess.CalledProcessError: pandoc = None -if pandoc: +if pandoc and os.path.exists('README.md'): os.system('pandoc -s README.md -t rst -o README.txt') long_description = open('README.txt').read()
Added check for README.md in setup.py.
razor-x_scipy-data_fitting
train
py
8528f86c8103a63a122172f2107f99fdbdedd662
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -74,6 +74,12 @@ function compile(callback) { } catch (err) { return callback(err); } + if (!state.router) { + state.router = state.app._router; + } + if (!state.router) { + return new Error("Router was null, either your app is not an express app, you have not yet called initialise, or you have called compile before adding at least one route"); + } state.document = generate(state); state.compiled = true; return callback();
fix for router not being initialised yet
eXigentCoder_swagger-spec-express
train
js
50f2f4df0c9e1ccd882aad839e48a9d073c75401
diff --git a/pymc/PyMCObjects.py b/pymc/PyMCObjects.py index <HASH>..<HASH> 100644 --- a/pymc/PyMCObjects.py +++ b/pymc/PyMCObjects.py @@ -9,6 +9,7 @@ import numpy as np from Node import Node, ZeroProbability, Variable, PotentialBase, StochasticBase, DeterministicBase import Container from Container import DictContainer, ContainerBase, file_items, ArrayContainer +import sys import pdb d_neg_inf = float(-1.7976931348623157e+308)
Added missing import statement to PyMCObjects
pymc-devs_pymc
train
py
21fd0c615c3cd8dac1f33f2b19788d7b2e168f17
diff --git a/src/plugins/meteor/command-handlers.js b/src/plugins/meteor/command-handlers.js index <HASH>..<HASH> 100644 --- a/src/plugins/meteor/command-handlers.js +++ b/src/plugins/meteor/command-handlers.js @@ -1,8 +1,8 @@ import buildApp, { archiveApp } from './build.js'; import { map, promisify } from 'bluebird'; +import chalk from 'chalk'; import { cloneDeep } from 'lodash'; import debug from 'debug'; -import chalk from 'chalk'; import fs from 'fs'; import { getInformation } from './status'; import nodemiral from 'nodemiral'; @@ -347,8 +347,7 @@ export function deploy(api) { return api .runCommand('meteor.push') - .then(() => api.runCommand('default.reconfig')) - .then(() => api.runCommand('meteor.start')); + .then(() => api.runCommand('default.reconfig')); } export function stop(api) {
Fix meteor.start running twice on deploy
zodern_meteor-up
train
js
a9466606da124bee5a3da129e68aef0740bfd0f4
diff --git a/src/AbstractDriver.php b/src/AbstractDriver.php index <HASH>..<HASH> 100644 --- a/src/AbstractDriver.php +++ b/src/AbstractDriver.php @@ -59,7 +59,7 @@ abstract class AbstractDriver implements LoggerAwareInterface * * @param object $client The client to use * - * @return $this + * @return object */ public function client($client = null) {
Update AbstractDriver.php Fixed a missed docblock
UseMuffin_Webservice
train
php
43040fc8c49aa28edb3750261c53f9b4c736bb70
diff --git a/lib/perpetuity/mongodb.rb b/lib/perpetuity/mongodb.rb index <HASH>..<HASH> 100644 --- a/lib/perpetuity/mongodb.rb +++ b/lib/perpetuity/mongodb.rb @@ -102,6 +102,13 @@ module Perpetuity def to_bson_id criteria criteria = criteria.dup + + # Check for both string and symbol ID in criteria + if criteria.has_key?('id') + criteria['_id'] = Moped::BSON::ObjectId(criteria['id']) rescue criteria['id'] + criteria.delete 'id' + end + if criteria.has_key?(:id) criteria[:_id] = Moped::BSON::ObjectId(criteria[:id]) rescue criteria[:id] criteria.delete :id
Check for string and symbol IDs in MongoDB queries
jgaskins_perpetuity
train
rb
77894c6dfa29e59c3592f9ab79b2d376328857e9
diff --git a/lib/passport.js b/lib/passport.js index <HASH>..<HASH> 100644 --- a/lib/passport.js +++ b/lib/passport.js @@ -61,7 +61,7 @@ module.exports = function(passport, app) { var User = app.userModel; // find a user whose email is the same as the forms email // we are checking to see if the user trying to login already exists - Account.getModel().findOne({ 'local.email' : email.toLowerCase() }, function(err, user) { + Account.getModel().findOne({ 'local.email' : email.trim().toLowerCase() }, function(err, user) { // if there are any errors, return the error if (err) return done(err); @@ -117,7 +117,7 @@ module.exports = function(passport, app) { var log = req.log || require('./log'); var rememberme = app.config.persistentSessionSeconds && req.body.rememberme; var User = app.userModel; - User.findOne({ 'local.email' : email.toLowerCase() }).exec().then(function(user) { + User.findOne({ 'local.email' : email.trim().toLowerCase() }).exec().then(function(user) { var errorMessage = 'Oops! Wrong email or password'; // if no user is found, return the message if (!user)
make sure login name doesn't have any trailing whitespace
onecommons_base
train
js
02860231cae802ce4bd0b29ed6bdc9dee5717a4a
diff --git a/ca/django_ca/extensions.py b/ca/django_ca/extensions.py index <HASH>..<HASH> 100644 --- a/ca/django_ca/extensions.py +++ b/ca/django_ca/extensions.py @@ -500,7 +500,9 @@ class KeyUsage(KnownValuesExtension): def from_extension(self, ext): self.value = [] - for k, v in self.CRYPTOGRAPHY_MAPPING.items(): + + # NOTE: we sort the items here to make sure that the order of self.value is deterministic. + for k, v in sorted(self.CRYPTOGRAPHY_MAPPING.items()): try: if getattr(ext.value, v): self.value.append(k)
make parsing order deterministic
mathiasertl_django-ca
train
py
2037ce4541e028f48af965dcbf7a8b1234fe8a24
diff --git a/web/concrete/blocks/google_map/controller.php b/web/concrete/blocks/google_map/controller.php index <HASH>..<HASH> 100644 --- a/web/concrete/blocks/google_map/controller.php +++ b/web/concrete/blocks/google_map/controller.php @@ -60,7 +60,7 @@ public function save($data) { $args['title'] = isset($data['title']) ? trim($data['title']) : ''; $args['location'] = isset($data['location']) ? trim($data['location']) : ''; - $args['zoom'] = (intval($data['zoom'])>=0 && intval($data['zoom'])<=17) ? intval($data['zoom']) : 14; + $args['zoom'] = (intval($data['zoom'])>=0 && intval($data['zoom'])<=21) ? intval($data['zoom']) : 14; if( strlen($args['location'])>0 ){ $coords = $this->lookupLatLong($args['location']);
fixed the max zoom being <I> (should be <I>) Former-commit-id: d<I>c<I>c6bdd<I>c<I>bdf5f<I>d6f5b8cde7e<I>
concrete5_concrete5
train
php
167ac4175adbf822095a118ca42fdc9e0859f21e
diff --git a/src/main/java/com/sangupta/jerry/email/service/EmailService.java b/src/main/java/com/sangupta/jerry/email/service/EmailService.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/sangupta/jerry/email/service/EmailService.java +++ b/src/main/java/com/sangupta/jerry/email/service/EmailService.java @@ -28,14 +28,21 @@ import com.sangupta.jerry.email.domain.EmailAddress; * Service that abstracts out sending emails. * * @author sangupta - * + * + * @since 1.0.0 */ public interface EmailService { public boolean sendEmail(String fromAddress, String toAddress, String subject, String text); public boolean sendEmail(EmailAddress fromAddress, EmailAddress toAddress, String subject, String text); - + + /** + * Send a fully generated email. + * + * @param email + * @return + */ public boolean sendEmail(Email email); }
Updated @since in javadocs
sangupta_jerry-services
train
java
74e5bb1237b00dc314fb4abe94d7e8bc2c69caa0
diff --git a/torf/_torrent.py b/torf/_torrent.py index <HASH>..<HASH> 100644 --- a/torf/_torrent.py +++ b/torf/_torrent.py @@ -96,7 +96,7 @@ class Torrent(): exclude_globs=(), exclude_regexs=(), trackers=None, webseeds=None, httpseeds=None, private=None, comment=None, source=None, creation_date=None, - created_by='%s/%s' % (_PACKAGE_NAME, __version__), + created_by='%s %s' % (_PACKAGE_NAME, __version__), piece_size=None, randomize_infohash=False): self._path = None self._metainfo = {}
Remove "/" from default "created by" value
rndusr_torf
train
py
ec7bacbe28e83d51a466fc60758d5a82c6011bf8
diff --git a/src/contrib/Google_AdsenseService.php b/src/contrib/Google_AdsenseService.php index <HASH>..<HASH> 100644 --- a/src/contrib/Google_AdsenseService.php +++ b/src/contrib/Google_AdsenseService.php @@ -1064,7 +1064,7 @@ class Google_AdSenseService extends Google_Service { } } - +if(!class_exists('Google_Account')){ class Google_Account extends Google_Model { public $id; @@ -1106,6 +1106,7 @@ class Google_Account extends Google_Model { return $this->subAccounts; } } +} class Google_Accounts extends Google_Model { public $etag;
Update Google_AdsenseService.php added Google_Account class class declare
alchemy-fr_google-plus-api-client
train
php
89211bf8adac98aadcf46daea115e4cd3726aef3
diff --git a/lib/active_record/connection_adapters/sqlserver/schema_statements.rb b/lib/active_record/connection_adapters/sqlserver/schema_statements.rb index <HASH>..<HASH> 100644 --- a/lib/active_record/connection_adapters/sqlserver/schema_statements.rb +++ b/lib/active_record/connection_adapters/sqlserver/schema_statements.rb @@ -131,6 +131,15 @@ module ActiveRecord end end + def columns_for_distinct(columns, orders) + order_columns = orders.reject(&:blank?).map{ |s| + s = s.to_sql unless s.is_a?(String) + s.gsub(/\s+(?:ASC|DESC)\b/i, '') + .gsub(/\s+NULLS\s+(?:FIRST|LAST)\b/i, '') + }.reject(&:blank?).map.with_index { |column, i| "#{column} AS alias_#{i}" } + [super, *order_columns].join(', ') + end + def change_column_null(table_name, column_name, allow_null, default = nil) column = detect_column_for! table_name, column_name if !allow_null.nil? && allow_null == false && !default.nil?
Fix `ORDER BY items must appear in the select list if SELECT DISTINCT` Please see #<I> for more details.
rails-sqlserver_activerecord-sqlserver-adapter
train
rb
b1d1ef9bca25333e58b8da4002f5e8eb215b810c
diff --git a/test/hyperbahn/hyperbahn-down.js b/test/hyperbahn/hyperbahn-down.js index <HASH>..<HASH> 100644 --- a/test/hyperbahn/hyperbahn-down.js +++ b/test/hyperbahn/hyperbahn-down.js @@ -93,6 +93,13 @@ function runTests(HyperbahnCluster) { }); var attempts = 0; + var start = Date.now(); + + var gap = { + 0: [0, 10], + 1: [200, 225], + 2: [1200, 1250] + }; client.on('error', onError); client.on('advertise-attempt', onAdvertisementAttempt); @@ -103,6 +110,10 @@ function runTests(HyperbahnCluster) { } function onAdvertisementAttempt() { + var delta = Date.now() - start; + assert.ok(gap[attempts][0] < delta); + assert.ok(delta < gap[attempts][1]); + if (++attempts < 3) { return; }
test: verify that we have backoff
uber_tchannel-node
train
js
8555663adf426d03934646880485a01cd1c8b848
diff --git a/mythril/analysis/modules/deprecated_ops.py b/mythril/analysis/modules/deprecated_ops.py index <HASH>..<HASH> 100644 --- a/mythril/analysis/modules/deprecated_ops.py +++ b/mythril/analysis/modules/deprecated_ops.py @@ -24,7 +24,7 @@ def execute(statespace): instruction = state.get_current_instruction() if instruction['opcode'] == "ORIGIN": - description = "Function %s retrieves the transaction origin (tx.origin) using the ORIGIN opcode. " \ + description = "The function `{}` retrieves the transaction origin (tx.origin) using the ORIGIN opcode. " \ "Use msg.sender instead.\nSee also: " \ "https://solidity.readthedocs.io/en/develop/security-considerations.html#tx-origin".format(node.function_name)
Remove %s in formatting previously %s was used to display variable for string formatting which won't work.
ConsenSys_mythril-classic
train
py
f6f850231a4995439e0e966e2efe2e0c797b44dd
diff --git a/doc/examples/cartopy_atlantic.py b/doc/examples/cartopy_atlantic.py index <HASH>..<HASH> 100644 --- a/doc/examples/cartopy_atlantic.py +++ b/doc/examples/cartopy_atlantic.py @@ -5,16 +5,18 @@ import cartopy.crs as ccrs nlat = 15 nlon = 5 -atlantic = xray.DataArray(np.random.randn(nlat, nlon), +arr = np.random.randn(nlat, nlon) +arr[0, 0] = np.nan +atlantic = xray.DataArray(arr, coords = (np.linspace(50, 20, nlat), np.linspace(-60, -20, nlon)), dims = ('latitude', 'longitude')) -ax = plt.axes(projection=ccrs.PlateCarree()) +ax = plt.axes(projection=ccrs.Orthographic(-50, 30)) -atlantic.plot(ax=ax) +atlantic.plot(ax=ax, origin='upper', aspect='equal', + transform=ccrs.PlateCarree()) -ax.set_ylim(0, 90) -ax.set_xlim(-180, 30) +ax.set_global() ax.coastlines() plt.savefig('atlantic_noise.png')
Show orthographic projection in cartopy example and flip data array to correct orientation
pydata_xarray
train
py
1b83adc3cd5814dbcd9f5d98197f38ff2622f51e
diff --git a/ykman/util.py b/ykman/util.py index <HASH>..<HASH> 100644 --- a/ykman/util.py +++ b/ykman/util.py @@ -206,4 +206,6 @@ def hmac_shorten_key(key, algo): def time_challenge(t=None): - return struct.pack('>q', int((t or time.time())/30)) + if t is None: + t = time.time() + return struct.pack('>q', int(t // 30))
Correctly handle time 0 in time_challenge.
Yubico_yubikey-manager
train
py
b4feaf3061f644f01972f035459044b977cc0c09
diff --git a/public/js/render/live.js b/public/js/render/live.js index <HASH>..<HASH> 100644 --- a/public/js/render/live.js +++ b/public/js/render/live.js @@ -262,6 +262,10 @@ var renderer = (function () { if (!window._console) {return;} if (!window._console[method]) {method = 'log';} + + // skip the entire console rendering if the console is hidden + if (!jsbin.panels.panels.console.visible) { return; } + window._console[method].apply(window._console, args); };
Don't try to render the console when hidden Fixes #<I> - due to large object being "prettyPrinted" during the animation.
jsbin_jsbin
train
js
897758bd2d92e49ca58430e02918f9020d54db1d
diff --git a/alotofeffort/s3.py b/alotofeffort/s3.py index <HASH>..<HASH> 100755 --- a/alotofeffort/s3.py +++ b/alotofeffort/s3.py @@ -23,11 +23,11 @@ def deploy_file(root, f, bucket): k.key = file_path try: k.set_contents_from_filename(file_path) + k.set_acl('public-read') except socket.error: print("Caught socket.error while trying to upload {0}".format(file_path)) print("Please file an issue with alotofeffort if you see this,") print("providing as much info as you can.") - k.set_acl('public-read') def deploy(www_dir, bucket_name):
Move set_acl into try/except to avoid <I>.
audreyr_alotofeffort
train
py
4c7ef7dfd876d5b90a15a5da3b02ccda3b7f7b92
diff --git a/pyqode/core/server.py b/pyqode/core/server.py index <HASH>..<HASH> 100644 --- a/pyqode/core/server.py +++ b/pyqode/core/server.py @@ -192,6 +192,8 @@ class Server(object): """ Poll the child process for any incoming results """ + if sys.version_info[0] == 2: + InterruptedError = OSError try: if self._client.poll(): try:
Fix undefined InterruptedError (python2 only)
pyQode_pyqode.core
train
py
d95b50aa64dbbd1061230bd3818be36b70631e60
diff --git a/src/Ease/Logger/ToEmail.php b/src/Ease/Logger/ToEmail.php index <HASH>..<HASH> 100644 --- a/src/Ease/Logger/ToEmail.php +++ b/src/Ease/Logger/ToEmail.php @@ -155,7 +155,7 @@ class ToEmail extends ToMemory $type = 'notice'; } - $logLine = new \Ease\Html\Div($message, + $logLine = new \Ease\Html\Div(strftime("%D %T").' `'.$caller.'`: '.$message, ['style' => $this->logStyles[$type]]); $this->mailer->addItem($logLine);
Add Time and Caller Object to logToMail
VitexSoftware_EaseFramework
train
php
7f70ce3e8720de50ab7dacbd3ab07a826a304b84
diff --git a/examples/simple.js b/examples/simple.js index <HASH>..<HASH> 100644 --- a/examples/simple.js +++ b/examples/simple.js @@ -1,12 +1,12 @@ -(function() { - goog.provide('app'); +goog.provide('app'); - goog.require('go_map_directive'); - goog.require('ol.Map'); - goog.require('ol.layer.Tile'); - goog.require('ol.source.OSM'); - goog.require('ol.View2D'); +goog.require('go_map_directive'); +goog.require('ol.Map'); +goog.require('ol.layer.Tile'); +goog.require('ol.source.OSM'); +goog.require('ol.View2D'); +(function() { var module = angular.module('app', [ 'go_map_directive' ]);
goog.provide and goog.require at head of file
camptocamp_ngeo
train
js
7ad2d20eb1f6dad76888d02f80e90633f25b4a39
diff --git a/src/Filter/IsNull.php b/src/Filter/IsNull.php index <HASH>..<HASH> 100644 --- a/src/Filter/IsNull.php +++ b/src/Filter/IsNull.php @@ -18,7 +18,7 @@ use Doctrine\ORM\QueryBuilder; use Happyr\DoctrineSpecification\Operand\ArgumentToOperandConverter; use Happyr\DoctrineSpecification\Operand\Operand; -final class IsNull implements Filter +final class IsNull implements Filter, Satisfiable { /** * @var Operand|string @@ -56,4 +56,28 @@ final class IsNull implements Filter return (string) $qb->expr()->isNull($field->transform($qb, $dqlAlias)); } + + /** + * {@inheritdoc} + */ + public function filterCollection(iterable $collection): iterable + { + $field = ArgumentToOperandConverter::toField($this->field); + + foreach ($collection as $candidate) { + if (null === $field->execute($candidate)) { + yield $candidate; + } + } + } + + /** + * {@inheritdoc} + */ + public function isSatisfiedBy($candidate): bool + { + $field = ArgumentToOperandConverter::toField($this->field); + + return null === $field->execute($candidate); + } }
implement Satisfiable interface in IsNull filter
Happyr_Doctrine-Specification
train
php
5c2d6933adf66bfb9519d49a6ca296c530a701fc
diff --git a/src/internal/serviceenv/service_env.go b/src/internal/serviceenv/service_env.go index <HASH>..<HASH> 100644 --- a/src/internal/serviceenv/service_env.go +++ b/src/internal/serviceenv/service_env.go @@ -406,7 +406,7 @@ func (env *NonblockingServiceEnv) GetEtcdClient() *etcd.Client { } func (env *NonblockingServiceEnv) GetTaskService(prefix string) task.Service { - return task.NewEtcdService(env.etcdClient, prefix) + return task.NewEtcdService(env.GetEtcdClient(), prefix) } // GetKubeClient returns the already connected Kubernetes API client without
Block task service setup on etcd client creation. (#<I>)
pachyderm_pachyderm
train
go
2810b4228a9ca0e10c0d9187bbb556507b4a9a7e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -23,16 +23,16 @@ includes = [ 'pycrfsuite', ] -if sys.platform == 'win32': - includes.extend(['crfsuite/win32', 'include']) - - class build_ext_check_gcc(build_ext): def build_extensions(self): c = self.compiler if c.compiler_type == 'unix' and 'gcc' in c.compiler: for e in self.extensions: e.extra_compile_args=['-std=c99'] + elif self.compiler.compiler_type == "msvc": + if sys.version_info[:2] < (3, 5): + c.include_dirs.extend(['crfsuite/win32', 'include']) + build_ext.build_extensions(self)
Only include inttype.h and win<I>/stdint.h for older versions of MSVC
scrapinghub_python-crfsuite
train
py
1c8cbd4bd3fdf7980baa669ea9f4f70e40c781fc
diff --git a/src/nwmatcher.js b/src/nwmatcher.js index <HASH>..<HASH> 100644 --- a/src/nwmatcher.js +++ b/src/nwmatcher.js @@ -5,9 +5,9 @@ * nwmatcher.js - A fast CSS selector engine and matcher * * Author: Diego Perini <diego.perini at gmail com> - * Version: 1.1beta + * Version: 1.1.0 * Created: 20070722 - * Release: 20090224 + * Release: 20090304 * * License: * http://javascript.nwbox.com/NWMatcher/MIT-LICENSE @@ -19,7 +19,7 @@ window.NW || (window.NW = {}); NW.Dom = function(global) { - var version = 'nwmatcher-1.1beta', + var version = 'nwmatcher-1.1.0', // processing context base = global.document,
changed nwmatcher version to <I> for release
dperini_nwmatcher
train
js
2d37559cf4412ecc49571dd870ce5d69d8dcd932
diff --git a/examples/react-component-pages/batfish.config.js b/examples/react-component-pages/batfish.config.js index <HASH>..<HASH> 100644 --- a/examples/react-component-pages/batfish.config.js +++ b/examples/react-component-pages/batfish.config.js @@ -7,7 +7,6 @@ module.exports = () => { externalStylesheets: [ 'https://api.mapbox.com/mapbox-assembly/v0.13.0/assembly.min.css' ], - siteOrigin: 'https://www.mapbox.com', wrapperPath: path.join(__dirname, './src/components/wrapper.js') }; };
Remove siteOrigin from config
mapbox_batfish
train
js
746765b15bc47c6a030905a6f754acf5cea135d3
diff --git a/src/Illuminate/Hashing/HashManager.php b/src/Illuminate/Hashing/HashManager.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Hashing/HashManager.php +++ b/src/Illuminate/Hashing/HashManager.php @@ -8,7 +8,7 @@ use Illuminate\Contracts\Hashing\Hasher; class HashManager extends Manager implements Hasher { /** - * Create an instance of the Brycrypt hash Driver. + * Create an instance of the Bcrypt hash Driver. * * @return BcryptHasher */
Fix typo (#<I>)
laravel_framework
train
php
8fb0524d3f1b0367427f74e322cb28769d4bac0b
diff --git a/lib/softlayer_api.rb b/lib/softlayer_api.rb index <HASH>..<HASH> 100755 --- a/lib/softlayer_api.rb +++ b/lib/softlayer_api.rb @@ -24,6 +24,7 @@ require 'softlayer/Datacenter' require 'softlayer/DynamicAttribute' require 'softlayer/Account' require 'softlayer/AccountPassword' +require 'softlayer/NetworkMonitor' require 'softlayer/Server' require 'softlayer/BareMetalServer' require 'softlayer/BareMetalServerOrder' @@ -31,7 +32,6 @@ require 'softlayer/BareMetalServerOrder_Package' require 'softlayer/ImageTemplate' require 'softlayer/NetworkComponent' require 'softlayer/NetworkMessageDelivery' -require 'softlayer/NetworkMonitor' require 'softlayer/NetworkService' require 'softlayer/NetworkStorageAllowedHost' require 'softlayer/NetworkStorageCredential'
Change the load order so Network Monitor loads before server to define a struct it uses
softlayer_softlayer-ruby
train
rb
ef389e9b5a94729fba74e307d886ec0e21e8a62c
diff --git a/lib/artsy-eventservice/artsy/event_service/rabbitmq_connection.rb b/lib/artsy-eventservice/artsy/event_service/rabbitmq_connection.rb index <HASH>..<HASH> 100644 --- a/lib/artsy-eventservice/artsy/event_service/rabbitmq_connection.rb +++ b/lib/artsy-eventservice/artsy/event_service/rabbitmq_connection.rb @@ -14,10 +14,9 @@ module Artsy conn end - # Synchronized access to the connection - rebuild if closed + # Synchronized access to the connection def self.get_connection @mutex.synchronize do - @connection = nil if @connection && @connection.closed? @connection ||= self.build_connection end end
Don't reset connection to nil after initialization
artsy_artsy-eventservice
train
rb
5f2312bed0a8d2c64d742db259eff4ae9361b492
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ try: except ImportError: from distutils.core import setup -__version__ = "2.0.0" +__version__ = "2.1.0" setup( name='django-tenants', @@ -46,7 +46,7 @@ setup( 'Topic :: Software Development :: Libraries :: Python Modules' ], install_requires=[ - 'Django >= 2.0,<2.1', + 'Django >= 2.0,<2.2', 'psycopg2', ], zip_safe=False,
Updated the setup to allow for django <I>
tomturner_django-tenants
train
py
aa05c926a5f7e69eb54fa8042dcfc1f5b4684ea2
diff --git a/View.php b/View.php index <HASH>..<HASH> 100644 --- a/View.php +++ b/View.php @@ -19,17 +19,43 @@ class View /** * Make a view * - * @param string $path - * @param array $data - * @return void + * @param string $path + * @param array $data + * @param bool $return + * @return mixed */ public static function make(string $path, array $data = [], bool $return = false) { $path = self::getPath($path); + + /** + * Render error page if this is a whoops call + */ + if (self::isCalledByWhoops()) { + return Accessor::view($path, $data, $return)->render(); + } + return Accessor::view($path, $data, $return); } /** + * Check if this is an exception + * + * @return bool + */ + public static function isCalledByWhoops() : bool + { + /** + * Get trace + */ + $trace = debug_backtrace(); + + $trace = end($trace); + + return isset($trace['class']) && $trace['class'] == 'Whoops\Run'; + } + + /** * Render a new view * * @return string
feat: render error page if this is a whoops call
modulusphp_utility
train
php
ffc03f197bf965269e9f1074ae2026be67c6b95f
diff --git a/src/commands/build/AndroidBuilder.js b/src/commands/build/AndroidBuilder.js index <HASH>..<HASH> 100644 --- a/src/commands/build/AndroidBuilder.js +++ b/src/commands/build/AndroidBuilder.js @@ -187,17 +187,11 @@ export default class AndroidBuilder extends BaseBuilder { } async collectAndValidateCredentialsFromCI(credentialMetadata) { - const creds = { - keystorePath: this.options.keystorePath, + const credentials = { + keystore: (await fs.readFile(this.options.keystorePath)).toString('base64'), keystoreAlias: this.options.keystoreAlias, keystorePassword: process.env.EXPO_ANDROID_KEYSTORE_PASSWORD, keyPassword: process.env.EXPO_ANDROID_KEY_PASSWORD, - uploadKeystore: false, - }; - - const credentials: AndroidCredentials = { - ...creds, - keystore: (await fs.readFile(creds.keystorePath)).toString('base64'), }; await Credentials.updateCredentialsForPlatform('android', credentials, credentialMetadata); }
don't send irrelevant keys to android update credentials endpoint (#<I>) fbshipit-source-id: e<I>d
expo_exp
train
js
e7d53b623f2539089e5764390a0c8009f0b16df9
diff --git a/lib/always.js b/lib/always.js index <HASH>..<HASH> 100644 --- a/lib/always.js +++ b/lib/always.js @@ -84,6 +84,15 @@ net.silverbucket.always = function(undefined) { } }; var assertFunc = function(one, two) { + function isInArray(val,array) { + var numArray = array.length; + for (var i = 0; i < numArray; i++) { + if (array[i] === val) { + return true; + } + } + return false; + } function isEqual(a,b){ for(var p in a){ var av = a[p], bv = b[p]; @@ -94,7 +103,10 @@ net.silverbucket.always = function(undefined) { } } else { //simple comparisons if(a[p] !== b[p]){ - return false; + // support for arrays of different order + if(!isInArray(a[p],b)) { + return false; + } } } }
added a little more flexibility to object comparison, to support arrays with different order of elements
silverbucket_jaribu
train
js
5820f9fca6582f8487ba5cd554870fce42e6325b
diff --git a/src/cli.js b/src/cli.js index <HASH>..<HASH> 100644 --- a/src/cli.js +++ b/src/cli.js @@ -73,10 +73,10 @@ module.exports = { }, error(text) { - this.unslog(); - this.debug(text); - text = text.toString().replace(/^Error: /, ''); - this.write(text, 'error'); + this.unslog().br(); + var str = text.toString().replace(/^Error: /, ''); + this.write(str, 'error'); + if (text.stack) this.debug(text.stack); return this; }, diff --git a/src/variants/collection.js b/src/variants/collection.js index <HASH>..<HASH> 100644 --- a/src/variants/collection.js +++ b/src/variants/collection.js @@ -3,6 +3,7 @@ const Promise = require('bluebird'); const Path = require('path'); const _ = require('lodash'); +const cli = require('../cli'); const Variant = require('./variant'); const Collection = require('../collection');
fix(variants) prevent error when trying to log error :-)
frctl_fractal
train
js,js
f6d216856f044de7b54450e00858190bc6dafc4f
diff --git a/kafka/coordinator/base.py b/kafka/coordinator/base.py index <HASH>..<HASH> 100644 --- a/kafka/coordinator/base.py +++ b/kafka/coordinator/base.py @@ -242,6 +242,14 @@ class BaseCoordinator(object): while self.need_rejoin(): self.ensure_coordinator_known() + # ensure that there are no pending requests to the coordinator. + # This is important in particular to avoid resending a pending + # JoinGroup request. + if self._client.in_flight_request_count(self.coordinator_id): + while self._client.in_flight_request_count(self.coordinator_id): + self._client.poll() + continue + future = self._send_join_group_request() self._client.poll(future=future)
Drain pending requests to the coordinator before initiating group rejoin (#<I>)
dpkp_kafka-python
train
py
f9c05e73a7da931e3d1649ca5f754a8a12c160f3
diff --git a/salt/states/file.py b/salt/states/file.py index <HASH>..<HASH> 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -4289,10 +4289,10 @@ def serialize(name, if os.path.isfile(name): if formatter == 'yaml': with salt.utils.fopen(name, 'r') as fhr: - existing_data = yaml.safe_load(fhr.read()) + existing_data = yaml.safe_load(fhr) elif formatter == 'json': with salt.utils.fopen(name, 'r') as fhr: - existing_data = json.load(fhr.read()) + existing_data = json.load(fhr) else: return {'changes': {}, 'comment': ('{0} format is not supported for merging'
Pass filepointers to the serialize load functions.
saltstack_salt
train
py
fb6165cec70e6a8af427f514a185d7cdeba7767c
diff --git a/jquery.smoothState.js b/jquery.smoothState.js index <HASH>..<HASH> 100644 --- a/jquery.smoothState.js +++ b/jquery.smoothState.js @@ -521,8 +521,8 @@ }; - /** Override defaults with options passed in */ - options = $.extend(defaults, options); + /** Merge defaults and options into current configuration */ + options = $.extend({}, defaults, options); /** Sets a default state */ if(window.history.state === null) {
Don't change default values We don't want to alter the default options for future instances of the plugin, so create a new object for the options.
miguel-perez_smoothState.js
train
js
a27c6ece92986fab90477d55305d0323f9e26f96
diff --git a/pandas/tests/test_series.py b/pandas/tests/test_series.py index <HASH>..<HASH> 100644 --- a/pandas/tests/test_series.py +++ b/pandas/tests/test_series.py @@ -1724,7 +1724,7 @@ class TestSeries(unittest.TestCase, CheckNameIntegration): exp = Series([11, 12]) assert_series_equal(s.mode(), exp) - assert_series_equal(Series([1, 2, 3]).mode(), Series([], dtype=int)) + assert_series_equal(Series([1, 2, 3]).mode(), Series([], dtype='int64')) lst = [5] * 20 + [1] * 10 + [6] * 25 np.random.shuffle(lst) @@ -1736,7 +1736,7 @@ class TestSeries(unittest.TestCase, CheckNameIntegration): s = Series(lst) s[0] = np.nan - assert_series_equal(s.mode(), Series([6], dtype=float)) + assert_series_equal(s.mode(), Series([6.])) s = Series(list('adfasbasfwewefwefweeeeasdfasnbam')) assert_series_equal(s.mode(), Series(['e']))
TST: Fix test case to use int<I> and explicit float
pandas-dev_pandas
train
py