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
fda2cde6c53b8d8cc3af22ea4063f4d81ada7778
diff --git a/leaflet.rotatedMarker.js b/leaflet.rotatedMarker.js index <HASH>..<HASH> 100644 --- a/leaflet.rotatedMarker.js +++ b/leaflet.rotatedMarker.js @@ -6,7 +6,11 @@ var oldIE = (L.DomUtil.TRANSFORM === 'msTransform'); L.Marker.addInitHook(function () { - this.options.rotationOrigin = this.options.rotationOrigin || 'center bottom' ; + var iconAnchor = this.options.icon.options.iconAnchor; + if (iconAnchor) { + iconAnchor = (iconAnchor[0] + 'px ' + iconAnchor[1] + 'px'); + } + this.options.rotationOrigin = this.options.rotationOrigin || iconAnchor || 'center bottom' ; this.options.rotationAngle = this.options.rotationAngle || 0; });
Use the icon anchor as default for rotation origin
bbecquet_Leaflet.RotatedMarker
train
js
03dc569236fc1b14293048feb827a0c1a629a40d
diff --git a/test/transaction.js b/test/transaction.js index <HASH>..<HASH> 100644 --- a/test/transaction.js +++ b/test/transaction.js @@ -225,4 +225,12 @@ describe('Transaction', function () { }) }) }) + + describe('setWitness', function () { + it('only accepts a a witness stack (Array of Buffers)', function () { + assert.throws(function () { + (new Transaction()).setWitness(0, 'foobar') + }, /Expected property "1" of type \[Buffer\], got String "foobar"/) + }) + }) })
tests: add test for setWitness
BitGo_bitgo-utxo-lib
train
js
a24d5ece55c4b36ebd962fe062daecc80dbece99
diff --git a/js/src/figure.js b/js/src/figure.js index <HASH>..<HASH> 100644 --- a/js/src/figure.js +++ b/js/src/figure.js @@ -734,6 +734,11 @@ var FigureView = widgets.DOMWidgetView.extend( { d.object_ticklabel.text = "" // TODO: removing and adding new tick marks will result in just many empty text sprites }, update_scatters: function() { + if(this.scatter_views) { + this.scatter_views.forEach((scatter) => { + scatter.remove_from_scene() + }) + } var scatters = this.model.get('scatters'); if(scatters) { //this.scatters.update(scatters); @@ -748,6 +753,11 @@ var FigureView = widgets.DOMWidgetView.extend( { } }, update_meshes: function() { + if(this.mesh_views) { + this.mesh_views.forEach((mesh) => { + mesh.remove_from_scene() + }) + } var meshes = this.model.get('meshes'); if(meshes) { //this.meshes.update(meshes);
fix: remove old views of scatter and mesh when traits change
maartenbreddels_ipyvolume
train
js
65b639d5ebfd9d5cf3ee55138eb8ab6ba6238c31
diff --git a/src/DatingVIP/API/Client.php b/src/DatingVIP/API/Client.php index <HASH>..<HASH> 100644 --- a/src/DatingVIP/API/Client.php +++ b/src/DatingVIP/API/Client.php @@ -142,7 +142,7 @@ class Client $this->curl->setCredentials ($this->user, $this->pass); } - return $this->curl->setOption (CURLOPT_TIMEOUT, $this->timeout); + return $this->curl->setTimeout ($this->timeout); } /**
Client: use setTimeout rather than setOption
DatingVIP_api-client
train
php
6e208c1bdb85dfe2799eb884c24abbca481530ee
diff --git a/examples/example2/__main__.py b/examples/example2/__main__.py index <HASH>..<HASH> 100644 --- a/examples/example2/__main__.py +++ b/examples/example2/__main__.py @@ -13,8 +13,9 @@ app = growler.App("Example2") @app.get("/") @asyncio.coroutine def handle_request(req, res): - print("connection made by:", req) - yield from asyncio.sleep(2) - res.send_text('') + sleep_for = 2 + print("Sleeping for %d seconds" % (sleep_for)) + yield from asyncio.sleep(sleep_for) + res.send_text('It Works!') app.create_server_and_run_forever(host='127.0.0.1', port=8000) diff --git a/examples/example3/__main__.py b/examples/example3/__main__.py index <HASH>..<HASH> 100644 --- a/examples/example3/__main__.py +++ b/examples/example3/__main__.py @@ -55,4 +55,4 @@ app = App("Example3") app.use(QuickRoute('Helloo'), '/') -app.create_server_and_run_forever(port=8080, host='127.0.0.1') +app.create_server_and_run_forever(port=8000, host='127.0.0.1')
examples: added variable for sleep-time in example2. Changed port to <I> in example3 - consistent with other examples.
pyGrowler_Growler
train
py,py
483e3557190a767f2db244c3d9e1e00feeacae68
diff --git a/src/__tests__/index.js b/src/__tests__/index.js index <HASH>..<HASH> 100644 --- a/src/__tests__/index.js +++ b/src/__tests__/index.js @@ -155,6 +155,13 @@ test( ) test( + 'should ignore calc with css variables (6)', + testFixture, + 'calc(var(--popupHeight) / 2)', + 'calc(var(--popupHeight) / 2)' +) + +test( 'should reduce calc with newline characters', testFixture, 'calc(\n1rem \n* 2 \n* 1.5)', diff --git a/src/lib/reducer.js b/src/lib/reducer.js index <HASH>..<HASH> 100644 --- a/src/lib/reducer.js +++ b/src/lib/reducer.js @@ -223,10 +223,12 @@ function reduceDivisionExpression(node, precision) { } return node } - - // value / value - node.left.value /= node.right.value - return node.left + // something / value + else if (isValueType(node.left.type)) { + node.left.value /= node.right.value + return node.left + } + return node } function reduceMultiplicationExpression(node) {
Fix #<I>: `NaN` value when reducing division with custom property
MoOx_reduce-css-calc
train
js,js
15ef18f5b50cb7afc93845166e5ff9c7f4349361
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ exec(open('demands/__meta__.py').read()) setup( name='demands', - version=__version__, + version=__version__, # NOQA description=__doc__, author='Yola', author_email='[email protected]',
Resolve pyflake error in setup.py
yola_demands
train
py
79dd98f5759ee5dc49008f108e9c9e68e71ac59b
diff --git a/src/DICIT/Container.php b/src/DICIT/Container.php index <HASH>..<HASH> 100644 --- a/src/DICIT/Container.php +++ b/src/DICIT/Container.php @@ -60,6 +60,15 @@ class Container $this->referenceResolver = new ReferenceResolver($this); } + public function build($definition, $serviceName = null) + { + if ($serviceName === null) { + $serviceName = md5($definition . rand(0, 10000)); + } + + return $this->serviceBuilder->buildService($this, $serviceName, $definition); + } + /** * Binds an existing object or an object definition to a key in the container. * @param string $key The key to which the new object/definition should be bound. diff --git a/src/DICIT/ReferenceResolver.php b/src/DICIT/ReferenceResolver.php index <HASH>..<HASH> 100644 --- a/src/DICIT/ReferenceResolver.php +++ b/src/DICIT/ReferenceResolver.php @@ -25,7 +25,10 @@ class ReferenceResolver */ public function resolve($reference) { - if (!is_string($reference)) { + if (is_object($reference)) { + return $this->container->build($reference); + } + elseif (!is_string($reference)) { return $reference; } $prefix = substr($reference, 0, 1);
Add suport for anonymous definitions as injections
oliviermadre_dic-it
train
php,php
2be4968101ff8b0249f060fb87cb0ebd89f6de89
diff --git a/colab/utils/conf.py b/colab/utils/conf.py index <HASH>..<HASH> 100644 --- a/colab/utils/conf.py +++ b/colab/utils/conf.py @@ -127,7 +127,7 @@ def load_colab_apps(): fields = ['verbose_name', 'upstream', 'urls', 'menu_urls', 'middlewares', 'dependencies', - 'context_processors', 'private_token', 'name'] + 'context_processors', 'private_token', 'name', 'extra'] for key in fields: value = py_settings_d.get(key)
Added configuration field for plugin extra configurations that do not affect colab Would be nice that `private_token` gets deprecated and that the plugins to use it through the .
colab_colab
train
py
4615873b3916798b263734e1a5d5d65195823de0
diff --git a/gpiozero/input_devices.py b/gpiozero/input_devices.py index <HASH>..<HASH> 100644 --- a/gpiozero/input_devices.py +++ b/gpiozero/input_devices.py @@ -402,8 +402,8 @@ class Button(DigitalInputDevice): side of the switch, and ground to the other (the default `pull_up` value is `True`). """ - def __init__(self, pin=None, pull_up=True, bouncetime=None): - super(Button, self).__init__(pin, pull_up, bouncetime) + def __init__(self, pin=None, pull_up=True, bounce_time=None): + super(Button, self).__init__(pin, pull_up, bounce_time) Button.is_pressed = Button.is_active Button.when_pressed = Button.when_activated
Change bouncetime to bounce_time The parameter was already changed to bounce_time in the base DigitalInputDevice class, but was overridden (incorrectly) in the derived Button class.
RPi-Distro_python-gpiozero
train
py
0bb7e5d1cb5c2f1ef04ac9e02a691902a289055b
diff --git a/src/com/google/javascript/jscomp/newtypes/TypeEnv.java b/src/com/google/javascript/jscomp/newtypes/TypeEnv.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/newtypes/TypeEnv.java +++ b/src/com/google/javascript/jscomp/newtypes/TypeEnv.java @@ -79,7 +79,7 @@ public class TypeEnv { Preconditions.checkNotNull(otherType, "%s is missing from an env", n); if (joinedType == null) { joinedType = otherType; - } else { + } else if (!joinedType.equals(otherType)) { joinedType = JSType.join(joinedType, otherType); } }
[NEW TYPE INFERENCE] Don't do joins that aren't needed. ------------- Created by MOE: <URL>
google_closure-compiler
train
java
d54ced861833f9bdbaf1b54a24583d3fe8428621
diff --git a/enrol/ldap/enrol.php b/enrol/ldap/enrol.php index <HASH>..<HASH> 100755 --- a/enrol/ldap/enrol.php +++ b/enrol/ldap/enrol.php @@ -81,7 +81,7 @@ function get_user_courses(&$user, $type) { error_log("User $user->username enrolled to a nonexistant course $course_ext_id \n"); } } else { // the course object exists before we call... - if ($courseobj->visible==0) { + if ($course_obj->visible==0) { // non-visible courses don't show up in the enrolled // array, so we should skip them -- unset($user->{$type}[$course_obj->id]);
Fixing typo in ldap enrolment plugin (variable missing _)
moodle_moodle
train
php
315bdd644b306a7bac0d6a331784d855135b44af
diff --git a/packages/razzle/config/babel-loader/razzle-babel-loader.js b/packages/razzle/config/babel-loader/razzle-babel-loader.js index <HASH>..<HASH> 100644 --- a/packages/razzle/config/babel-loader/razzle-babel-loader.js +++ b/packages/razzle/config/babel-loader/razzle-babel-loader.js @@ -232,7 +232,7 @@ module.exports = babelLoader.custom(function(babel) { if (razzleContext.modifyBabelPreset) { presetOptions = razzleContext.modifyBabelPreset( merge(razzleContext.configContext, { - options: { pluginOptions, presetOptions } + options: { presetOptions } }) ); }
fix(razzle): fix modifyBabelPreset
jaredpalmer_razzle
train
js
53ad9882df938e224f856beac577a74513a98cd5
diff --git a/spec/lib/push/backend/bunny_spec.rb b/spec/lib/push/backend/bunny_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/push/backend/bunny_spec.rb +++ b/spec/lib/push/backend/bunny_spec.rb @@ -1,5 +1,11 @@ require 'spec_helper' +def count_instances_of(type) + count = 0 + ObjectSpace.each_object(Bunny::Exchange) { count += 1 } + count +end + describe Push::Backend::Bunny do before(:all) do @consumer = Push::Consumer.new @@ -31,7 +37,15 @@ describe Push::Backend::Bunny do end end - it "should release exchange after publish" + it "should release exchange after publish" do + lambda do + 1000.times do + bunny = Push::Backend::Bunny.new + bunny.publish 'marbles', '/outta/sight' + end + GC.start + end.should change {count_instances_of Bunny::Exchange}.by 1 + end it "should release queue after subscribe" end
WIP: trying to count references in specs...
firehoseio_firehose
train
rb
2ee49b588440a47c253bb0152235c03e3bd7114f
diff --git a/tests/toolkit/ezptestrunner.php b/tests/toolkit/ezptestrunner.php index <HASH>..<HASH> 100644 --- a/tests/toolkit/ezptestrunner.php +++ b/tests/toolkit/ezptestrunner.php @@ -35,6 +35,7 @@ class ezpTestRunner extends PHPUnit_TextUI_TestRunner if ( file_exists( $suiteFile ) ) { + var_dump( $suiteFile ); $suite->addTestFile( $suiteFile ); } } @@ -284,7 +285,9 @@ class ezpTestRunner extends PHPUnit_TextUI_TestRunner if ( file_exists( $file ) ) { - $suite->addTestFile( $file ); + require_once( $file ); + $class = self::getClassName( $file ); + $suite->addTest( new $class ); } else {
- Fixed issue where running tests from an extension wouldn't work. git-svn-id: file:///home/patrick.allaert/svn-git/ezp-repo/ezpublish/trunk@<I> a<I>eee8c-daba-<I>-acae-fa<I>f<I>
ezsystems_ezpublish-legacy
train
php
8755f23c70ac72c284e3f8e308c5cf91be0b7b4e
diff --git a/lib/familysearch/url_template.rb b/lib/familysearch/url_template.rb index <HASH>..<HASH> 100644 --- a/lib/familysearch/url_template.rb +++ b/lib/familysearch/url_template.rb @@ -82,10 +82,14 @@ module FamilySearch # def get(template_values) raise FamilySearch::Error::MethodNotAllowed unless allow.include?('get') + etag = template_values.delete(:etag) template_values = validate_values(template_values) t = Addressable::Template.new(@template) url = t.expand(template_values).to_s - @client.get url + @client.get do |req| + req.url(url) + req.headers['If-None-Match'] = etag if etag.present? + end end # Calls HTTP HEAD on the URL template. It takes the +template_values+ hash and merges the values into the template.
Add etags support for get requests
jimmyz_familysearch-rb
train
rb
8e8206f1969792b58bb9edae85f109b643beef6d
diff --git a/calculation-engine/engine-evaluation/src/main/java/com/dataart/spreadsheetanalytics/engine/SpreadsheetAuditor.java b/calculation-engine/engine-evaluation/src/main/java/com/dataart/spreadsheetanalytics/engine/SpreadsheetAuditor.java index <HASH>..<HASH> 100644 --- a/calculation-engine/engine-evaluation/src/main/java/com/dataart/spreadsheetanalytics/engine/SpreadsheetAuditor.java +++ b/calculation-engine/engine-evaluation/src/main/java/com/dataart/spreadsheetanalytics/engine/SpreadsheetAuditor.java @@ -171,7 +171,7 @@ public class SpreadsheetAuditor implements IAuditor { Map<String, String> result = new HashMap<>(workbook.getNumberOfNames()); for (int i = 0 ; i < workbook.getNumberOfNames() ; i++) { Name name = workbook.getNameAt(i); - result.put(name.getRefersToFormula(), name.getNameName()); + result.put(name.getNameName(), name.getRefersToFormula()); } return result; }
#<I> fixing code review comments
DataArt_CalculationEngine
train
java
e4b6025134e02838c2e3031820a6e88604dc9483
diff --git a/examples/php/coinone-markets.php b/examples/php/coinone-markets.php index <HASH>..<HASH> 100644 --- a/examples/php/coinone-markets.php +++ b/examples/php/coinone-markets.php @@ -5,7 +5,8 @@ $root = dirname (dirname (dirname (__FILE__))); include $root . '/ccxt.php'; $exchange = new \ccxt\coinone (array ( - 'verbose' => true, + 'enableRateLimit' => true, + // 'verbose' => true, // uncomment for verbose output )); $markets = $exchange->load_markets(); @@ -13,4 +14,4 @@ $markets = $exchange->load_markets(); var_dump ($markets); echo "\n" . $exchange->name . " supports " . count($markets) . " pairs\n"; -?> \ No newline at end of file +?>
examples/php/coinone-markets.php
ccxt_ccxt
train
php
f6fbb89494b7de32e67017d12d68b0b5eb44eb92
diff --git a/neat/genome.py b/neat/genome.py index <HASH>..<HASH> 100644 --- a/neat/genome.py +++ b/neat/genome.py @@ -389,6 +389,11 @@ class DefaultGenome(object): for output_id in output: connections.append((input_id, output_id)) + # For recurrent genomes, include node self-connections. + if not config.feed_forward: + for i in iterkeys(self.nodes): + connections.append((i, i)) + return connections def connect_full(self, config):
Include self-connections in the list returned by DefaultGenome.compute_full_connections.
CodeReclaimers_neat-python
train
py
5a818d2d66b4d86c2ae814eb9187e3375a595e93
diff --git a/src/Http/Controllers/VoyagerBreadController.php b/src/Http/Controllers/VoyagerBreadController.php index <HASH>..<HASH> 100644 --- a/src/Http/Controllers/VoyagerBreadController.php +++ b/src/Http/Controllers/VoyagerBreadController.php @@ -32,9 +32,17 @@ class VoyagerBreadController extends Controller Voyager::can('browse_'.$dataType->name); // Next Get the actual content from the MODEL that corresponds to the slug DataType - $dataTypeContent = (strlen($dataType->model_name) != 0) - ? app($dataType->model_name)->latest()->get() - : DB::table($dataType->name)->get(); // If Model doest exist, get data from table name + if (strlen($dataType->model_name) != 0) { + $model = app($dataType->model_name); + if ($model->timestamps) { + $dataTypeContent = $model->latest()->get(); + } else { + $dataTypeContent = $model->orderBy('id', 'DESC')->get(); + } + } else { + // If Model doest exist, get data from table name + $dataTypeContent = DB::table($dataType->name)->get(); + } $view = 'voyager::bread.browse';
Check if timestamps are set
the-control-group_voyager
train
php
5a3264d8e47445300b270946295ba79bad078c08
diff --git a/lib/rails-footnotes.rb b/lib/rails-footnotes.rb index <HASH>..<HASH> 100644 --- a/lib/rails-footnotes.rb +++ b/lib/rails-footnotes.rb @@ -8,7 +8,7 @@ if ENABLE_RAILS_FOOTNOTES # Load all notes # - Dir[File.join(dir, 'rails-footnotes', 'notes', '*.rb')].each do |note| + Dir[File.join(dir, 'rails-footnotes', 'notes', '*.rb')].sort.each do |note| require note end @@ -20,4 +20,4 @@ if ENABLE_RAILS_FOOTNOTES prepend_before_filter Footnotes::Filter after_filter Footnotes::Filter end -end \ No newline at end of file +end
added ordering to rails-footnotes/notes/*.rb files
josevalim_rails-footnotes
train
rb
b21b80410d7c5f465491b12048406334b359ea61
diff --git a/addon/components/file-upload/component.js b/addon/components/file-upload/component.js index <HASH>..<HASH> 100644 --- a/addon/components/file-upload/component.js +++ b/addon/components/file-upload/component.js @@ -179,12 +179,14 @@ if (DEBUG) { didInsertElement() { let id = get(this, 'for'); assert(`Changing the tagName of {{file-upload}} to "${get(this, 'tagName')}" will break interactions.`, get(this, 'tagName') === 'label'); - this.element.querySelectorAll('*').forEach(function (element) { + let elements = this.element.querySelectorAll('*'); + for (let i = 0; i < elements.length; i++){ + let element = elements[i]; if (element.id !== id && VALID_TAGS.indexOf(element.tagName.toLowerCase()) === -1) { assert(`"${element.outerHTML}" is not allowed as a child of {{file-upload}}.`); } - }); + } } }); }
Fixes IE <I>: Object doesn't support property or method 'forEach'
adopted-ember-addons_ember-file-upload
train
js
35a1f2afa8bfeda606b86404fd480e7a1a92ca14
diff --git a/bcrypt/__init__.py b/bcrypt/__init__.py index <HASH>..<HASH> 100644 --- a/bcrypt/__init__.py +++ b/bcrypt/__init__.py @@ -15,7 +15,6 @@ # limitations under the License. from __future__ import absolute_import from __future__ import division -from __future__ import unicode_literals import binascii import os
Remove unicode_literals, it doesn't play well with distutils
pyca_bcrypt
train
py
d5a8db81a3147ebaca4481ab37e4baf6c906af6a
diff --git a/src/BaseModel.php b/src/BaseModel.php index <HASH>..<HASH> 100644 --- a/src/BaseModel.php +++ b/src/BaseModel.php @@ -66,6 +66,13 @@ abstract class BaseModel public $table = ""; /** + * Primary Key Column + * + * @var string + */ + protected $primKey = ""; + + /** * Logger object * * @var \Psr\Log\LoggerInterface @@ -180,6 +187,18 @@ abstract class BaseModel } /** + * Get Primary Key + * + * Gets the primary key column name of the model. + * + * @return string + */ + public function getPrimKey(): string + { + return $this->primKey; + } + + /** * Create record * * Creates a record row in the database with the supplied data and the help
add the primary key property and getter
SlaxWeb_Database
train
php
a17fc61996d45fc13dd2b5c549d8efa4df8993f0
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/explorers/navigatorRenderer.js b/bundles/org.eclipse.orion.client.ui/web/orion/explorers/navigatorRenderer.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/explorers/navigatorRenderer.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/explorers/navigatorRenderer.js @@ -76,6 +76,8 @@ define(['i18n!orion/navigate/nls/messages', 'orion/Deferred', 'orion/webui/littl * @param {Object} [linkProperties] gives additional properties to mix in to the HTML anchor element. */ function createLink(folderPageURL, item, commandService, contentTypeService, /* optional */ openWithCommands, /* optional */defaultEditor, /* optional */ linkProperties) { + // TODO FIXME folderPageURL is bad; need to use URITemplates here. + // TODO FIXME refactor the async href calculation portion of this function into a separate function, for clients who do not want the <A> created. var link; if (item.Directory) { link = document.createElement("a"); //$NON-NLS-0$
Doc some FIXMEs in navigatorRenderer
eclipse_orion.client
train
js
57af99842e9334d702f8cd1ccf73e247a38cc571
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ names, convenience methods for quickly looking at data (e.g., ``.head()``, ``.ta and the ability to get a rich interactive database connection up in only 2 lines by setting a few required environmental variables. -.. image:: https://travis-ci.org/boydgreenfield/query.svg?branch=master :target: https://travis-ci.org/boydgreenfield/query +.. image:: https://travis-ci.org/boydgreenfield/query.svg?branch=v0.1.1 :target: https://travis-ci.org/boydgreenfield/query Demo in 2 lines ``````````````` @@ -44,7 +44,7 @@ from setuptools import setup setup( name='query', - version='0.1.1', + version='0.1.1', # When incrementing, make sure to update Travis link above as well url='http://github.com/boydgreenfield/query/', license='MIT', author='Nick Boyd Greenfield',
Edit setup.py to include Travis image for the latest tag. Need to always do this going forward.
boydgreenfield_query
train
py
fbd309453b965095d43d39c188a4387f2b2494e5
diff --git a/File/FilesystemFolder.php b/File/FilesystemFolder.php index <HASH>..<HASH> 100644 --- a/File/FilesystemFolder.php +++ b/File/FilesystemFolder.php @@ -12,7 +12,7 @@ use vxPHP\Application\Application; * * @author Gregor Kofler * - * @version 0.3.4 2013-11-18 + * @version 0.3.5 2013-11-20 * * @todo test delete() */ @@ -68,7 +68,7 @@ class FilesystemFolder { if(!isset($this->relPath) || $force) { $relPath = preg_replace('~^' . preg_quote(Application::getInstance()->getAbsoluteAssetsPath(), '~').'~', '', $this->path, -1, $replaced); - $this->relPath = $replaced === 0 ? FALSE : $relPath; + $this->relPath = $replaced === 0 ? NULL : $relPath; } return $this->relPath;
Changed return value for getRelativePath() from FALSE to NULL when no relative path could be evaluated
Vectrex_vxPHP
train
php
69bcc495222b505999f6d051c2ee9f454a36d6fe
diff --git a/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/support/hoganjs/HoganJs.java b/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/support/hoganjs/HoganJs.java index <HASH>..<HASH> 100644 --- a/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/support/hoganjs/HoganJs.java +++ b/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/support/hoganjs/HoganJs.java @@ -20,7 +20,6 @@ public class HoganJs */ @Override public String compile(final String content, final String optionalArgument) { - return String.format("Hogan.cache['%s'] = %s", optionalArgument, super.compile(content, "")); return String.format("Hogan.cache['%s'] = %s;", optionalArgument, super.compile(content, "")); }
Fix for HoganJs processor added semicolon to output to fix JavaScript when compiling more than one template
wro4j_wro4j
train
java
76efd3312904ef69fb4f2058bfdd306d8dde56d4
diff --git a/src/Web/Request/Request.php b/src/Web/Request/Request.php index <HASH>..<HASH> 100644 --- a/src/Web/Request/Request.php +++ b/src/Web/Request/Request.php @@ -4,6 +4,7 @@ namespace Web\Request; use InvalidArgumentException; use Web\Exception\RuntimeException; +use Web\QueryString; use Web\Uri; class Request @@ -69,7 +70,6 @@ class Request $this->requestOrder = array_unique(str_split(strtoupper($requestOrder), 1)); } - /** * Retrieve a value using the configured request order * @@ -202,8 +202,10 @@ class Request */ public function get($name) { - if ($this->uri()->getQuery()->has($name)) { - return $this->uri()->getQuery()->get($name); + $queryString = $this->uri()->getQuery(); + + if ($queryString instanceof QueryString && $queryString->has($name)) { + return $queryString->get($name); } if (!isset($_GET[$name])) {
Fix retrieval of GET value from null QueryString reference
codeblanche_Web
train
php
7f059d23752ccd48e2b58fdb02ff5ca56f1adcb1
diff --git a/lang/nn/moodle.php b/lang/nn/moodle.php index <HASH>..<HASH> 100644 --- a/lang/nn/moodle.php +++ b/lang/nn/moodle.php @@ -905,7 +905,7 @@ $string['themes'] = 'Temaer'; $string['themesaved'] = 'Nytt tema lagret'; $string['thischarset'] = 'iso-8859-1'; $string['thisdirection'] = 'ltr'; -$string['thislanguage'] = 'Nynorsk'; +$string['thislanguage'] = 'Norsk - Nynorsk'; $string['time'] = 'Tid'; $string['timezone'] = 'Tidssone'; $string['to'] = 'Til';
Changing display of Nynorsk to Norsk - Nynorsk after discussion with Tormod
moodle_moodle
train
php
71159513588c71e893681ea6b0fda63f74301ebe
diff --git a/pfurl/pfurl.py b/pfurl/pfurl.py index <HASH>..<HASH> 100644 --- a/pfurl/pfurl.py +++ b/pfurl/pfurl.py @@ -1111,13 +1111,13 @@ class Pfurl(): if k == 'http': self.str_http = v # Split http string into IP:port and URL - str_IPport = self.str_http.split('/')[0] - self.str_URL = '/' + '/'.join(self.str_http.split('/')[1:]) - try: - (self.str_ip, self.str_port) = str_IPport.split(':') - except: - self.str_ip = str_IPport.split(':') - self.str_port = args.str_port + path_split_url = self.str_http.split('/') + str_IPport = path_split_url[0] + self.str_URL = '/' + '/'.join(path_split_url[1:]) + host_port_pair = str_IPport.split(':') + self.str_ip = host_port_pair[0] + if len(host_port_pair) > 1: + self.str_port = host_port_pair[1] def httpResponse_bodyParse(self, **kwargs): """
Handle the case of a port not existing in the url
FNNDSC_pfurl
train
py
03af5e429ceb67e6b03e526df369386ae57d86cd
diff --git a/src/Dispatch/PageDispatcher.php b/src/Dispatch/PageDispatcher.php index <HASH>..<HASH> 100644 --- a/src/Dispatch/PageDispatcher.php +++ b/src/Dispatch/PageDispatcher.php @@ -22,8 +22,8 @@ class PageDispatcher extends Dispatcher { $body, $templateDirectory ); - $document->extractTemplates(); $document->expandComponents(); + $document->extractTemplates(); if(!is_null($path)) { $pathHyphens = str_replace("/", "-", $path);
Expand components before extracting templates (#<I>)
PhpGt_WebEngine
train
php
3bb0e8e4d8b3d51ef3f55382d3e63a2c20d83cb4
diff --git a/src/main/java/net/dv8tion/jda/core/entities/EntityBuilder.java b/src/main/java/net/dv8tion/jda/core/entities/EntityBuilder.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/dv8tion/jda/core/entities/EntityBuilder.java +++ b/src/main/java/net/dv8tion/jda/core/entities/EntityBuilder.java @@ -72,7 +72,6 @@ public class EntityBuilder tmp.add("session_id"); tmp.add("state"); tmp.add("sync_id"); - tmp.add("timestamps"); richGameFields = Collections.unmodifiableSet(tmp); }
Remove check for timestamps for rich presence The timestamps are present for every game
DV8FromTheWorld_JDA
train
java
fa5b36dc739d9cad595b9c50099305ffdd50a884
diff --git a/examples/go/electron/receive.go b/examples/go/electron/receive.go index <HASH>..<HASH> 100644 --- a/examples/go/electron/receive.go +++ b/examples/go/electron/receive.go @@ -76,7 +76,7 @@ func main() { c, err := container.Dial("tcp", url.Host) fatalIf(err) connections <- c // Save connection so we can Close() when main() ends - addr := strings.TrimPrefix("/", url.Path) + addr := strings.TrimPrefix(url.Path, "/") r, err := c.Receiver(electron.Source(addr)) fatalIf(err) // Loop receiving messages and sending them to the main() goroutine diff --git a/examples/go/electron/send.go b/examples/go/electron/send.go index <HASH>..<HASH> 100644 --- a/examples/go/electron/send.go +++ b/examples/go/electron/send.go @@ -75,7 +75,7 @@ func main() { c, err := container.Dial("tcp", url.Host) fatalIf(err) connections <- c // Save connection so we can Close() when main() ends - addr := strings.TrimPrefix("/", url.Path) + addr := strings.TrimPrefix(url.Path, "/") s, err := c.Sender(electron.Target(addr)) fatalIf(err) // Loop sending messages.
PROTON-<I>: Fix incorrect address handling. Fix to previous commit a<I>f<I>e * PROTON-<I>: Golang AMQP URL incompatable with Qpid Cpp Broker.had Use of string.TrimPrefix was incorrect.
apache_qpid-proton
train
go,go
7d8e6749fbf7c286b55d7f27c3c8dbc0241cb471
diff --git a/test/caliendo_test.py b/test/caliendo_test.py index <HASH>..<HASH> 100644 --- a/test/caliendo_test.py +++ b/test/caliendo_test.py @@ -119,13 +119,23 @@ class CaliendoTestCase(unittest.TestCase): def test_update(self): o = CallOnceEver() - o_p1 = Facade( o ) - o_p2 = Facade( o ) - o_p3 = Facade( o ) + test = self - self.assertEquals( o_p1.update(), 1 ) - self.assertEquals( o_p2.update(), 1 ) - self.assertEquals( o_p3.update(), 1 ) + def run_one(): + op = Facade( o ) + test.assertEquals( op.update(), 1 ) + + def run_two(): + op = Facade( o ) + test.assertEquals( op.update(), 1 ) + + def run_three(): + op = Facade( o ) + test.assertEquals( op.update(), 1 ) + + run_one() + run_two() + run_three() if __name__ == '__main__': unittest.main()
Make more apparent the test case, that three uses of caliendo should only call the inner object once if the python vm is not being shut down.
buzzfeed_caliendo
train
py
8c141bc05dafe57334a25a0997eb2b41f31aee48
diff --git a/source/Popup.js b/source/Popup.js index <HASH>..<HASH> 100644 --- a/source/Popup.js +++ b/source/Popup.js @@ -39,8 +39,8 @@ enyo.kind({ onblur: "blur", onRequestShow: "requestShow", onRequestHide: "requestHide" - }, + captureEvents: true, //* @public events: { //@ Event that fires after the popup is shown. @@ -105,9 +105,13 @@ enyo.kind({ this.inherited(arguments); if (this.showing) { this.reflow(); - this.capture(); + if (this.captureEvents) { + this.capture(); + } } else { - this.release(); + if (this.captureEvents) { + this.release(); + } } // show after sizing if (this.centered) {
* Popup: can now set captureEvents to false to avoid any event capture (may change)
enyojs_onyx
train
js
43a18b66e2126cf1b2bf7987a1af12d1e163fa7a
diff --git a/pyasn1/__init__.py b/pyasn1/__init__.py index <HASH>..<HASH> 100644 --- a/pyasn1/__init__.py +++ b/pyasn1/__init__.py @@ -1,7 +1,8 @@ import sys +# http://www.python.org/dev/peps/pep-0396/ +__version__ = '0.1.4' + if sys.version_info[:2] < (2, 4): raise RuntimeError('PyASN1 requires Python 2.4 or later') -# http://www.python.org/dev/peps/pep-0396/ -__version__ = '0.1.4'
since __version__ is parsed by setup.py using ' as ancors, no extra quotes should be placed before it
etingof_pyasn1
train
py
797de92a359a12e26bbe75f16783337ee7f726e3
diff --git a/unyt/tests/test_unyt_array.py b/unyt/tests/test_unyt_array.py index <HASH>..<HASH> 100644 --- a/unyt/tests/test_unyt_array.py +++ b/unyt/tests/test_unyt_array.py @@ -1264,6 +1264,22 @@ def test_equivalencies(): assert data.value == .012 assert data.units == u.kg + data = 12*u.g + data = data.to_equivalent('kg', None) + assert data.value == .012 + assert data.units == u.kg + + # incorrect usate of the equivalence raises errors + + with pytest.raises(InvalidUnitEquivalence): + data.convert_to_equivalent('erg', 'thermal') + with pytest.raises(InvalidUnitEquivalence): + data.convert_to_equivalent('m', 'mass_energy') + with pytest.raises(InvalidUnitEquivalence): + data.to_equivalent('erg', 'thermal') + with pytest.raises(InvalidUnitEquivalence): + data.to_equivalent('m', 'mass_energy') + # Mass-energy mp = u.mp.copy()
expand coverage of incorrect equivalence usages
yt-project_unyt
train
py
24bee134b97efe694e44fe923095b3737350078a
diff --git a/lib/Doctrine/CouchDB/Version.php b/lib/Doctrine/CouchDB/Version.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/CouchDB/Version.php +++ b/lib/Doctrine/CouchDB/Version.php @@ -22,4 +22,4 @@ namespace Doctrine\CouchDB; class Version { const VERSION = '1.0.0alpha1'; -} \ No newline at end of file +}
Release <I>alpha1
doctrine_couchdb-odm
train
php
9c2b80b467d55b827208807ba59e4171680bd7af
diff --git a/core/hash.rb b/core/hash.rb index <HASH>..<HASH> 100644 --- a/core/hash.rb +++ b/core/hash.rb @@ -41,6 +41,10 @@ class Hash `$opal.hash.apply(null, objs)` end + def self.allocate + `Opal.hash()` + end + def self.new(defaults = undefined, &block) %x{ var hash = Opal.hash();
Fix Hash.allocate from failing Calling Hash.allocate directly used to cause an error as the internal map for storing keys wasn't setup. This fixes that bug. Fixes 1 core spec.
opal_opal
train
rb
e80978da4ce452dcddf1b80955864c446eb2a238
diff --git a/ros_buildfarm/common.py b/ros_buildfarm/common.py index <HASH>..<HASH> 100644 --- a/ros_buildfarm/common.py +++ b/ros_buildfarm/common.py @@ -267,6 +267,8 @@ def get_short_os_name(os_name): def get_short_os_code_name(os_code_name): os_code_name_mappings = { + 'artful': 'A', + 'bionic': 'B', 'jessie': 'J', 'saucy': 'S', 'stretch': 'S',
Add in artful and bionic to the short os names. (#<I>) * Add in artful and bionic to the short os names.
ros-infrastructure_ros_buildfarm
train
py
d0bb6edd55b554e25fd56b82fb21ce40ee0c9969
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -21,12 +21,13 @@ setup( ], url='https://github.com/Flimm/django-fullurl', classifiers=[ - 'Development Status :: 4 - Beta', + 'Development Status :: 5 - Production/Stable', 'Framework :: Django', 'Framework :: Django :: 1.8', 'Framework :: Django :: 1.9', 'Framework :: Django :: 1.10', 'Framework :: Django :: 1.11', + 'Framework :: Django :: 2.0', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3',
Adjust Trove classifiers to include "stable"
Flimm_django-fullurl
train
py
77fa792afe8afbd775ea360e912d6a9e3786f520
diff --git a/src/Treemap.js b/src/Treemap.js index <HASH>..<HASH> 100644 --- a/src/Treemap.js +++ b/src/Treemap.js @@ -25,6 +25,9 @@ export default class Treemap extends Viz { this._layoutPadding = 1; this._legendSort = (a, b) => this._sum(b) - this._sum(a); + this._legendTooltip = assign({}, this._legendTooltip, { + tbody: [] + }); this._shapeConfig = assign({}, this._shapeConfig, { ariaLabel: (d, i) => { const rank = this._rankData ? `${this._rankData.indexOf(d) + 1}. ` : "";
temporarily removes N/A share from legendTooltip (#<I>)
d3plus_d3plus-hierarchy
train
js
da05dd2c048e1edc336bf46d99233c7e42d8ad6e
diff --git a/auth.py b/auth.py index <HASH>..<HASH> 100644 --- a/auth.py +++ b/auth.py @@ -232,6 +232,7 @@ eip8_auth_sedes = sedes.List( sedes.BigEndianInt() # version ], strict=False) + def _pad_eip8_data(data: bytes) -> bytes: # Pad with random amount of data, as per # https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8.md: @@ -239,6 +240,7 @@ def _pad_eip8_data(data: bytes) -> bytes: # packet" return data + os.urandom(random.randint(100, 300)) + def encrypt_eip8_msg(msg: bytes, pubkey: datatypes.PublicKey) -> bytes: prefix = struct.pack('>H', len(msg) + ENCRYPT_OVERHEAD_LENGTH) suffix = ecies.encrypt(msg, pubkey, shared_mac_data=prefix)
missing seond blank line before and after function
ethereum_asyncio-cancel-token
train
py
ebfc0232b3c7dd10a6f324681b30454fd28f270a
diff --git a/src/HGG/Pardot/Connector.php b/src/HGG/Pardot/Connector.php index <HASH>..<HASH> 100644 --- a/src/HGG/Pardot/Connector.php +++ b/src/HGG/Pardot/Connector.php @@ -299,6 +299,7 @@ class Connector } try { + $object = preg_replace('/(^|[a-z])([A-Z])/e', 'strtolower(strlen("\\1") ? "\\1_\\2" : "\\2")', $object); $handler = $this->getHandler($httpResponse, $object); $result = $handler->getResult(); $this->totalResults = $handler->getResultCount();
Add logic to decamelcase object names The object name in the request URL is not the same as the object name in the result set. For example, when requestion the object visitorActivity, the results are nested under the key visitor_activity.
hglattergotz_pardot
train
php
130ba926e7b051b98926b12cd6e4bcd7b5cb732c
diff --git a/rails/init.rb b/rails/init.rb index <HASH>..<HASH> 100644 --- a/rails/init.rb +++ b/rails/init.rb @@ -1,3 +1,7 @@ # On Rails 2.x GEM_ROOT/rails/init.rb is auto loaded for all gems # so this is the place to initialize Rails 2.x plugin support -require "bugsnag/rails" \ No newline at end of file +if Gem::Version.new(ActiveRecord::VERSION::STRING) < Gem::Version.new("3.0") + require "bugsnag/rails" +else + Bugsnag.warn "Blocked attempt to initialize legacy Rails 2.x extensions" +end
Ensure Rails 2 legacy extensions are not loaded on newer versions #<I>
bugsnag_bugsnag-ruby
train
rb
8ba0ccb514589433bb7ccab7ed067aa5973543d2
diff --git a/packages/react-scripts/scripts/init.js b/packages/react-scripts/scripts/init.js index <HASH>..<HASH> 100644 --- a/packages/react-scripts/scripts/init.js +++ b/packages/react-scripts/scripts/init.js @@ -137,7 +137,6 @@ module.exports = function( 'author', 'contributors', 'files', - 'main', 'browser', 'bin', 'man',
Whitelist main in template.json (#<I>)
facebook_create-react-app
train
js
6fb28af40143ecee88ba540b793e181142363887
diff --git a/lib/daru/dataframe.rb b/lib/daru/dataframe.rb index <HASH>..<HASH> 100644 --- a/lib/daru/dataframe.rb +++ b/lib/daru/dataframe.rb @@ -930,19 +930,9 @@ module Daru def filter_rows &block return to_enum(:filter_rows) unless block_given? - df = Daru::DataFrame.new({}, order: @vectors.to_a) - marked = [] + keep_rows = @index.map { |index| block.call access_row(index) } - @index.each do |index| - keep_row = yield access_row(index) - marked << index if keep_row - end - - marked.each do |idx| - df.row[idx] = self[idx, :row] - end - - df + where keep_rows end # Iterates over each vector and retains it in a new DataFrame if the block returns
Enhance filter_rows by using where
SciRuby_daru
train
rb
2775bfce1c26d04cd71008401bb0479a32787df9
diff --git a/cf-plugin/ssh_plugin.go b/cf-plugin/ssh_plugin.go index <HASH>..<HASH> 100644 --- a/cf-plugin/ssh_plugin.go +++ b/cf-plugin/ssh_plugin.go @@ -28,7 +28,7 @@ func (p *SSHPlugin) GetMetadata() plugin.PluginMetadata { Version: plugin.VersionType{ Major: 0, Minor: 2, - Build: 1, + Build: 2, }, Commands: []plugin.Command{ {
Bump cf-plugin version to <I> [#<I>]
cloudfoundry_diego-ssh
train
go
73bd8a1c21daf14bc22abbfd1fb1354c2d000389
diff --git a/test/variadic.js b/test/variadic.js index <HASH>..<HASH> 100644 --- a/test/variadic.js +++ b/test/variadic.js @@ -2,7 +2,8 @@ var assert = require('assert') , ref = require('ref') , ffi = require('../') - , sprintfPtr = require('./build/Release/ffi_tests').sprintf + , bindings = require('bindings')({ module_root: __dirname, bindings: 'ffi_tests' }) + , sprintfPtr = bindings.sprintf describe('variadic arguments', function () {
test: use "bindings" to load the bindings for the variadic tests
node-ffi-napi_node-ffi-napi
train
js
ce7911a858c17c1cf1363daca2c650d66c66dd4b
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index <HASH>..<HASH> 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -2525,6 +2525,7 @@ class ProjectDeploymentManager(RetrieveMixin, RESTManager): _path = '/projects/%(project_id)s/deployments' _obj_cls = ProjectDeployment _from_parent_attrs = {'project_id': 'id'} + _list_filters = ('order_by', 'sort') class ProjectProtectedBranch(ObjectDeleteMixin, RESTObject):
Deployment: add list filters
python-gitlab_python-gitlab
train
py
be2c9ec334d6445decc59241ce5b7da5912be90f
diff --git a/webserver/main.go b/webserver/main.go index <HASH>..<HASH> 100644 --- a/webserver/main.go +++ b/webserver/main.go @@ -22,9 +22,9 @@ For an example conf check gandalf/etc/gandalf.conf file.` } router := pat.New() router.Post("/user", http.HandlerFunc(api.NewUser)) - router.Del("/user", http.HandlerFunc(api.RemoveUser)) + router.Del("/user/:name", http.HandlerFunc(api.RemoveUser)) router.Post("/repository", http.HandlerFunc(api.NewRepository)) - router.Del("/repository", http.HandlerFunc(api.RemoveRepository)) + router.Del("/repository/:name", http.HandlerFunc(api.RemoveRepository)) if !*dry { log.Fatal(http.ListenAndServe(":8080", router))
webserver: receiving param via url in new routes
tsuru_gandalf
train
go
86fb10f0a3e6900f8da8bbacdf7cfb5a77eeee63
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -31,6 +31,7 @@ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import distutilazy import distutilazy.clean +import distutilazy.test CLASSIFIERS = [ "Development Status :: 4 - Beta", @@ -60,7 +61,11 @@ params = dict( long_description = long_description, license = "MIT", classifiers = CLASSIFIERS, - cmdclass = {"clean_pyc": distutilazy.clean.clean_pyc, "clean_all": distutilazy.clean.clean_all} + cmdclass = { + "clean_pyc": distutilazy.clean.clean_pyc, + "clean_all": distutilazy.clean.clean_all, + "test": distutilazy.test.run_tests + } ) if setuptools:
Use the new test runner class as the test command for setup.py So now runnint setup.py test runs unit tests for distutilazy.
farzadghanei_distutilazy
train
py
caa066be7aeafcbd0c18431ff4ec3cb3b97dd6b3
diff --git a/packages/stratocacher/src/wrap.js b/packages/stratocacher/src/wrap.js index <HASH>..<HASH> 100644 --- a/packages/stratocacher/src/wrap.js +++ b/packages/stratocacher/src/wrap.js @@ -141,8 +141,20 @@ export default function wrap(opts, func){ return function() { const _t0 = new Date; - return Q(Array.from(arguments)) + const ret = Q.defer(); + const run = args => lookup.call(this, _t0, args) + .then(v => ret.resolve(v)) + .catch(e => ret.reject(e)) + + Q(Array.from(arguments)) .then(before) - .then(args => lookup.call(this, _t0, args)) + .then(run, err => { + // If the `before` hook fails, we'll proceed + // with caching disabled. + events.emit('error', err); + run([null]); + }) + + return ret.promise; } }
Treat `before` hook error as cache disable
redfin_stratocacher
train
js
4771b17b570eb642085fd01161be64f458719669
diff --git a/rootpy/__init__.py b/rootpy/__init__.py index <HASH>..<HASH> 100644 --- a/rootpy/__init__.py +++ b/rootpy/__init__.py @@ -18,3 +18,16 @@ class ROOTError(RuntimeError): def __str__(self): return "level={0}, loc='{1}', msg='{2}'".format( self.level, self.location, self.msg) + +def rootpy_source_dir(): + import rootpy + from os.path import abspath, dirname + from inspect import getfile + from sys import modules + path = dirname(getfile(modules[__name__])) + absp = abspath(path) + return path, absp + +_ROOTPY_SOURCE_PATH, _ROOTPY_SOURCE_ABSPATH = rootpy_source_dir() +del rootpy_source_dir +
Add rootpy._ROOTPY_SOURCE_{,ABS}PATH
rootpy_rootpy
train
py
8a7174ee91c864af999aae567922290632f81067
diff --git a/BackofficeBundle/Resources/public/ecmascript/OpenOrchestra/Service/Form/Behavior/AbstractBehavior.js b/BackofficeBundle/Resources/public/ecmascript/OpenOrchestra/Service/Form/Behavior/AbstractBehavior.js index <HASH>..<HASH> 100644 --- a/BackofficeBundle/Resources/public/ecmascript/OpenOrchestra/Service/Form/Behavior/AbstractBehavior.js +++ b/BackofficeBundle/Resources/public/ecmascript/OpenOrchestra/Service/Form/Behavior/AbstractBehavior.js @@ -70,6 +70,7 @@ class AbstractBehavior $(this.getSelector(), view.$el).each(function(){ behavior.deactivate($(this)); }); + view.delegateEvents(); } /**
fix submit button event (#<I>)
open-orchestra_open-orchestra-cms-bundle
train
js
ae3e1bfebf16e2f8380636636a132823316d3d51
diff --git a/java/client/test/org/openqa/selenium/support/ui/SlowLoadableComponentTest.java b/java/client/test/org/openqa/selenium/support/ui/SlowLoadableComponentTest.java index <HASH>..<HASH> 100644 --- a/java/client/test/org/openqa/selenium/support/ui/SlowLoadableComponentTest.java +++ b/java/client/test/org/openqa/selenium/support/ui/SlowLoadableComponentTest.java @@ -58,10 +58,11 @@ public class SlowLoadableComponentTest { FakeClock clock = new FakeClock(); try { new BasicSlowLoader(clock, 2).get(); - fail(); } catch (Error e) { // We expect to time out + return; } + fail(); } @Test
Fail if an error is not thrown. Fix test that intends to check that an error is thrown but doesn't. fail() throws an Error which was previously ignored under the same condition that the expected Error was ignored.
SeleniumHQ_selenium
train
java
4a36bbb88246ae9933b7d23099edb398e5ebce27
diff --git a/fabric/connection.py b/fabric/connection.py index <HASH>..<HASH> 100644 --- a/fabric/connection.py +++ b/fabric/connection.py @@ -53,6 +53,9 @@ class Connection(Context): This class rebinds `invoke.context.Context.run` to `.local` so both remote and local command execution can coexist. """ + # TODO: should "reopening" an existing Connection object that has been + # closed, be allowed? (See e.g. how v1 detects closed/semi-closed + # connections & nukes them before creating a new client to the same host.) # TODO: push some of this into paramiko.client.Client? e.g. expand what # Client.exec_command does, it already allows configuring a subset of what # we do / will eventually do / did in 1.x. It's silly to have to do
Add a TODO that occurred to me while implementing related things
fabric_fabric
train
py
8785aacdea986f7a6fb8de42b049109ddf6b7c0b
diff --git a/test/Listener/AbstractEventListenerTest.php b/test/Listener/AbstractEventListenerTest.php index <HASH>..<HASH> 100644 --- a/test/Listener/AbstractEventListenerTest.php +++ b/test/Listener/AbstractEventListenerTest.php @@ -17,8 +17,6 @@ class AbstractEventListenerTest extends TestCase * Test that event message will be dispatched to correct method. * * @covers \ExtendsFramework\Event\Listener\AbstractEventListener::dispatch() - * @covers \ExtendsFramework\Event\Listener\AbstractEventListener::getMethod() - * @covers \ExtendsFramework\Event\Listener\AbstractEventListener::getPrefix() * @covers \ExtendsFramework\Event\Listener\AbstractEventListener::getMetaData() * @covers \ExtendsFramework\Event\Listener\AbstractEventListener::getOccurredOn() */
Removed @covers for trait methods.
extendsframework_extends-event
train
php
c23fff9509078fc269d6cfc95ef9cc477aa2740a
diff --git a/test/common/testcase.rb b/test/common/testcase.rb index <HASH>..<HASH> 100644 --- a/test/common/testcase.rb +++ b/test/common/testcase.rb @@ -36,5 +36,8 @@ module OpenSCAP Dir.chdir "../.." OpenSCAP.raise! if OpenSCAP.error? end + + def test_x + end end end
tests: Fix for older ruby/rake/unittest. Addressing: 1) Failure: default_test(OpenSCAP::TestCase) [/usr/bin/rake:<I>]: No tests were specified.
OpenSCAP_ruby-openscap
train
rb
fe3e1340c201fd9fe51243e3335d764974eb5a00
diff --git a/js/livecoin.js b/js/livecoin.js index <HASH>..<HASH> 100644 --- a/js/livecoin.js +++ b/js/livecoin.js @@ -452,7 +452,7 @@ module.exports = class livecoin extends Exchange { } const feeRate = this.safeFloat (order, 'commission_rate'); let feeCost = undefined; - if (typeof cost !== 'undefined') { + if (typeof cost !== 'undefined' && typeof feeRate !== 'undefined') { feeCost = cost * feeRate; } let feeCurrency = undefined;
LIVECOIN: parse_order error in Python, `None * float` is a type error, so better to check both args before multiplying. Encountered an error when feeRate was None.
ccxt_ccxt
train
js
769a2732b800c5038871934d70c444fcf118ca96
diff --git a/test_limix/lmm_lasso/test_lmmlasso.py b/test_limix/lmm_lasso/test_lmmlasso.py index <HASH>..<HASH> 100644 --- a/test_limix/lmm_lasso/test_lmmlasso.py +++ b/test_limix/lmm_lasso/test_lmmlasso.py @@ -1,6 +1,7 @@ """Variance Decomposition testing code""" import unittest import scipy as SP +import numpy as np import scipy.stats import pdb import os @@ -92,10 +93,10 @@ class Lmmlasso_test(unittest.TestCase): yhat_true = self.D['yhat'] RV = ((SP.absolute(params)-SP.absolute(params_true))**2).max() - self.assertTrue(RV<1e-6) + np.testing.assert_almost_equal(RV, 0., decimal=5) RV = ((SP.absolute(yhat)-SP.absolute(yhat_true))**2).max() - self.assertTrue(RV<1e-3) + np.testing.assert_almost_equal(RV, 0., decimal=3)
less conservative lmmlasso test
PMBio_limix-backup
train
py
e9c184f879835718517a0d2762ffd4e424513614
diff --git a/tests/test_sprites.py b/tests/test_sprites.py index <HASH>..<HASH> 100644 --- a/tests/test_sprites.py +++ b/tests/test_sprites.py @@ -280,7 +280,7 @@ def test_class_attrs(): position = Vector(4, 2) sprite = TestSprite() - assert sprite.position == (4, 2) + assert sprite.position == Vector(4, 2) sprite = TestSprite(position=(2, 4)) - assert sprite.position == (2, 4) + assert sprite.position == Vector(2, 4)
ppb-vector <I> will only do == between two Vectors
ppb_pursuedpybear
train
py
a52a7a6166306ece6cec29727463fd0dfb9852f5
diff --git a/src/org/jgroups/demos/RelayDemo.java b/src/org/jgroups/demos/RelayDemo.java index <HASH>..<HASH> 100644 --- a/src/org/jgroups/demos/RelayDemo.java +++ b/src/org/jgroups/demos/RelayDemo.java @@ -1,7 +1,6 @@ package org.jgroups.demos; import org.jgroups.*; -import org.jgroups.util.ProxyAddress; import org.jgroups.util.Util; /** Demos RELAY. Create 2 *separate* clusters with RELAY as top protocol. Each RELAY has bridge_props="tcp.xml" (tcp.xml
removed ProxyAddress and Address.PROXY_ADDRESS
belaban_JGroups
train
java
f5afc70269ae22664f22e7f8cf86f7c10f4f26cb
diff --git a/lib/daru/view/adapters/highcharts/display.rb b/lib/daru/view/adapters/highcharts/display.rb index <HASH>..<HASH> 100644 --- a/lib/daru/view/adapters/highcharts/display.rb +++ b/lib/daru/view/adapters/highcharts/display.rb @@ -38,6 +38,15 @@ module LazyHighCharts IRuby.html high_chart_iruby(placeholder, self) end + # This method is not needed if `to_html` generates the same code. Here + # `to_html` generates the code with `onload`, so there is need of + # `high_chart_iruby` which doesn't use `onload` in chart script. + def to_html_iruby(placeholder=random_canvas_id) + # TODO : placeholder pass, in plot#div + chart_hash_must_be_present + high_chart_iruby(placeholder, self) + end + def chart_hash_must_be_present @options[:chart] ||= {} end
method to_html_iruy added
SciRuby_daru-view
train
rb
7c1f8409187f719f010946ed973cb0598ae2ceae
diff --git a/tests/TestCase.php b/tests/TestCase.php index <HASH>..<HASH> 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -820,7 +820,7 @@ TEXT; */ protected function setExpectedExceptionMessage($message) { - $this->setExpectedExceptionRegExp('|' . preg_quote($message, '|') . '|'); + // do nothing } }
GA: Fix tests on PHP <= <I> (again)
pear_Crypt_GPG
train
php
674e25af4ed498b83ab1617ff07d9de19e947eda
diff --git a/cheroot/workers/threadpool.py b/cheroot/workers/threadpool.py index <HASH>..<HASH> 100644 --- a/cheroot/workers/threadpool.py +++ b/cheroot/workers/threadpool.py @@ -281,8 +281,7 @@ class ThreadPool: worker.join() else: remaining_time = endtime - time.time() - if remaining_time > 0: - worker.join(remaining_time) + worker.join(remaining_time) if worker.is_alive(): # We exhausted the timeout. # Forcibly shut down the socket.
Call worker.join with remaining time even if 0 or negative, which will return immediately anyway.
cherrypy_cheroot
train
py
045d8f6c2a00fb9375afb7cc0566a7eec0d7297f
diff --git a/src/scales/scale.radialLinear.js b/src/scales/scale.radialLinear.js index <HASH>..<HASH> 100644 --- a/src/scales/scale.radialLinear.js +++ b/src/scales/scale.radialLinear.js @@ -272,7 +272,7 @@ return index * angleMultiplier - (Math.PI / 2); }, getDistanceFromCenterForValue: function(value) { - if (value === null || value === undefined || isNaN(value)) { + if (value === null) { return 0; // null always in center }
Keep this as NaN so point._view.skip is set correctly
chartjs_Chart.js
train
js
7e55891f803acb86323fdda5e308a8621c0799d7
diff --git a/lib/dm-core/collection.rb b/lib/dm-core/collection.rb index <HASH>..<HASH> 100644 --- a/lib/dm-core/collection.rb +++ b/lib/dm-core/collection.rb @@ -46,7 +46,8 @@ module DataMapper def all(query = {}) return self if query.kind_of?(Hash) ? query.empty? : query == self.query - repository.read_many(scoped_query(query)) + query = scoped_query(query) + query.repository.read_many(query) end def first(*args) @@ -60,11 +61,12 @@ module DataMapper end query = args.last.respond_to?(:merge) ? args.pop : {} + query = scoped_query(query.merge(:limit => args.first || 1)) if args.any? - repository.read_many(scoped_query(query.merge(:limit => args.first))) + query.repository.read_many(query) else - repository.read_one(scoped_query(query.merge(:limit => 1))) + query.repository.read_one(query) end end @@ -282,7 +284,7 @@ module DataMapper return self.query if query == self.query query = if query.kind_of?(Hash) - Query.new(repository, model, query) + Query.new(query.has_key?(:repository) ? query.delete(:repository) : self.repository, model, query) elsif query.kind_of?(Query) query else
Bringing Collection#all and #first inline with Model * Model#all and Model#first accept a :repository option in the query, which will dynamically use a different repo. Not sure how much I like explicitly passing it in, but the two interfaces should be kept in sync as much as possible. (at some point in the near future Collection and Model will include their finders from a shared module, but until then the interfaces need to be brought more in sync)
datamapper_dm-core
train
rb
2076cb5017975f298fed49ae8bf61bb77bfa9e83
diff --git a/lib/commands/filter.js b/lib/commands/filter.js index <HASH>..<HASH> 100644 --- a/lib/commands/filter.js +++ b/lib/commands/filter.js @@ -44,6 +44,8 @@ declaration.handler = (argv, collection) => { } const validator = new Ajv({ + useDefaults: true, + removeAdditional: true, allErrors: false }) .compile(collection.schema) diff --git a/lib/commands/scan.js b/lib/commands/scan.js index <HASH>..<HASH> 100644 --- a/lib/commands/scan.js +++ b/lib/commands/scan.js @@ -48,6 +48,7 @@ declaration.handler = (argv, collection) => { } const validator = new Ajv({ + useDefaults: true, allErrors: false }) .compile(collection.schema)
Scanner and filter should use defaults and remove additional if they are not allowed
dataplug-io_dataplug-cli
train
js,js
249cd0dfa0815261be08343ded71a320e81db8bb
diff --git a/lib/acts_as_revisable/acts/revision.rb b/lib/acts_as_revisable/acts/revision.rb index <HASH>..<HASH> 100644 --- a/lib/acts_as_revisable/acts/revision.rb +++ b/lib/acts_as_revisable/acts/revision.rb @@ -65,7 +65,7 @@ module WithoutScope # Sets some initial values for a new revision. def revision_setup #:nodoc: - now = Time.now + now = Time.zone.now prev = current_revision.revisions.first prev.update_attribute(:revisable_revised_at, now) if prev self[:revisable_current_at] = now + 1.second
Use Time.zone.now instead of Time.now for revisable timestamps.
rich_acts_as_revisable
train
rb
9047170cdc3a1d0fcc993711b73ad7845b9fbaee
diff --git a/sub.go b/sub.go index <HASH>..<HASH> 100644 --- a/sub.go +++ b/sub.go @@ -15,6 +15,7 @@ type SubParams struct { TrialEnd int64 Card *CardParams Quantity uint64 + ProrationDate int64 FeePercent, TaxPercent float64 NoProrate, EndCancel, QuantityZero, TrialEndNow bool } diff --git a/sub/client.go b/sub/client.go index <HASH>..<HASH> 100644 --- a/sub/client.go +++ b/sub/client.go @@ -65,6 +65,10 @@ func (c Client) New(params *stripe.SubParams) (*stripe.Sub, error) { body.Add("tax_percent", strconv.FormatFloat(params.TaxPercent, 'f', 2, 64)) } + if params.ProrationDate > 0 { + body.Add("proration_date", strconv.FormatInt(params.ProrationDate, 10)) + } + params.AppendTo(body) sub := &stripe.Sub{}
Add missing field on subscription params Per the documentation, there's a 'proration_date' field that lets the caller override the default proration date: <URL>
stripe_stripe-go
train
go,go
97d79ed8b3e74812df0b7576ac88e125690937fa
diff --git a/common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java b/common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java index <HASH>..<HASH> 100755 --- a/common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java +++ b/common-core-open/src/main/java/com/bbn/bue/common/files/FileUtils.java @@ -293,10 +293,11 @@ public final class FileUtils { // using a LineProcessor saves memory by not loading the whole file into memory // this can matter for multi-gigabyte Gigaword-scale maps source.readLines(new LineProcessor<Void>() { - int lineNo = 1; + int lineNo = 0; @Override public boolean processLine(final String line) throws IOException { + ++lineNo; if (line.isEmpty()) { // skip this line and go to the next one return true; @@ -332,7 +333,6 @@ public final class FileUtils { throw new IOException(String.format("Error processing line %d of file map: %s", lineNo, line), iae); } - ++lineNo; // all lines should be processed return true; }
FileUtils.loadStringToFileMap: fixes bug where blank lines were not counted
BBN-E_bue-common-open
train
java
debe7afc8c2918ec7854f50540c955fcc5fe3e0a
diff --git a/lib/chicanery.rb b/lib/chicanery.rb index <HASH>..<HASH> 100644 --- a/lib/chicanery.rb +++ b/lib/chicanery.rb @@ -13,16 +13,21 @@ module Chicanery def execute *args load args.shift - previous_state = restore - current_state = { - servers: {} - } - servers.each do |server| - current_jobs = server.jobs - compare_jobs current_jobs, previous_state[:servers][server.name] if previous_state[:servers] - current_state[:servers][server.name] = current_jobs + poll_period = args.shift + loop do + previous_state = restore + current_state = { + servers: {} + } + servers.each do |server| + current_jobs = server.jobs + compare_jobs current_jobs, previous_state[:servers][server.name] if previous_state[:servers] + current_state[:servers][server.name] = current_jobs + end + run_handlers.each {|handler| handler.call current_state } + persist current_state + exit unless poll_period + sleep poll_period.to_i end - run_handlers.each {|handler| handler.call current_state } - persist current_state end end \ No newline at end of file
added a poll period as optional additional parameter
markryall_chicanery
train
rb
aa457043594d59bc7c4541212225c0bad9fbce03
diff --git a/qunit.js b/qunit.js index <HASH>..<HASH> 100644 --- a/qunit.js +++ b/qunit.js @@ -313,9 +313,15 @@ var config = { QUnit.isLocal = !!(location.protocol === 'file:'); })(); -// public API as global methods -extend(window, QUnit); -window.QUnit = QUnit; +// Expose the API as global variables, unless an 'exports' +// object exists, in that case we assume we're in CommonJS +if ( typeof exports === "undefined" || typeof require === "undefined" ) { + extend(window, QUnit); + window.QUnit = QUnit; +} else { + extend(exports, QUnit); + exports.QUnit = QUnit; +} addEvent(window, "load", function() { var userAgent = id("qunit-userAgent");
Added in CommonJS support for exporting the QUnit functionality.
JamesMGreene_qunit-assert-html
train
js
01ff780fb9288042c4be1be32bd690782ca3a080
diff --git a/src/GlobalFunctions.php b/src/GlobalFunctions.php index <HASH>..<HASH> 100644 --- a/src/GlobalFunctions.php +++ b/src/GlobalFunctions.php @@ -15,6 +15,7 @@ class kfLogSection { protected $name; + protected $conf; /** * Begin section for a function and return an object that ends the section * when the object is destroyed. As long as the object is not specifically @@ -25,10 +26,10 @@ class kfLogSection { global $kgConf; $kgConf->startLogSection( $name ); $this->name = $name; + $this->conf = $kgConf; } function __destruct() { - global $kgConf; - $kgConf->endLogSection( $this->name ); + $this->conf->endLogSection( $this->name ); } }
kfLogSection: Save reference to config since it could get destroyed too early
Krinkle_toollabs-base
train
php
c4b2fc3458eb39a265f55da85f3e43d5e1bdc097
diff --git a/source/Application/Model/Order.php b/source/Application/Model/Order.php index <HASH>..<HASH> 100644 --- a/source/Application/Model/Order.php +++ b/source/Application/Model/Order.php @@ -2290,9 +2290,12 @@ class Order extends \OxidEsales\Eshop\Core\Model\BaseModel */ private function isValidPayment($basket) { - $paymentModel = oxNew(EshopPayment::class); $session = $this->getSession(); + $paymentId = $session->getVariable('paymentid'); + $paymentModel = oxNew(EshopPayment::class); + $paymentModel->load($paymentId); + $dynValue = $session->getVariable('dynvalue'); $shopId = $this->getConfig()->getShopId(); $user = $this->getUser();
OXDEV-<I> Load payment before validation
OXID-eSales_oxideshop_ce
train
php
ac45c16544a0cb2bed3b5066917b724273b8c0e8
diff --git a/lib/classes/oauth2/api.php b/lib/classes/oauth2/api.php index <HASH>..<HASH> 100644 --- a/lib/classes/oauth2/api.php +++ b/lib/classes/oauth2/api.php @@ -89,7 +89,7 @@ class api { $endpoints = [ 'authorization_endpoint' => 'https://www.facebook.com/v2.12/dialog/oauth', 'token_endpoint' => 'https://graph.facebook.com/v2.12/oauth/access_token', - 'userinfo_endpoint' => 'https://graph.facebook.com/v2.12/me?fields=id,first_name,last_name,link,picture,name,email' + 'userinfo_endpoint' => 'https://graph.facebook.com/v2.12/me?fields=id,first_name,last_name,link,picture.type(large),name,email' ]; foreach ($endpoints as $name => $url) {
MDL-<I> auth: Facebook OAuth2 - getting a better-quality profile photo Get <I>x<I> px instead of <I>x<I> px user profile picture from Facebook OAuth2.
moodle_moodle
train
php
0a469b8a74ae1d9a114d5a52d79db047eb3301fd
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ class PyTest(TestCommand): errno = pytest.main(self.test_args) sys.exit(errno) -with open('README.md', 'rb') as fin: +with open('README.rst', 'rb') as fin: README = fin.read() setup(name=PACKAGE_NAME,
Update setup.py to use new readme file.
reincubate_ricloud
train
py
5e28652202a2dbec3a4dff0c5e41040281601514
diff --git a/concrete/routes/api/file.php b/concrete/routes/api/file.php index <HASH>..<HASH> 100644 --- a/concrete/routes/api/file.php +++ b/concrete/routes/api/file.php @@ -10,5 +10,3 @@ defined('C5_EXECUTE') or die("Access Denied."); $router->get('/file/{fID}', '\Concrete\Core\File\Api\FilesController::read') ->setRequirement('fID' ,'[0-9]+') ->setScopes('files:read'); -$router->get('/files', '\Concrete\Core\File\Api\FilesController::listFiles') - ->setScopes('files:read');
Remove unused route in Files API Since @aembler removed this function this route no longer exists. So it should be removed but... ...I'll try to find time to add back List Files in with proper functionality, rather than the half baked list before.
concrete5_concrete5
train
php
42c1508ce9e7c9ddfe9588e2c26d2ae886f367de
diff --git a/extras.php b/extras.php index <HASH>..<HASH> 100644 --- a/extras.php +++ b/extras.php @@ -132,3 +132,23 @@ function rest_get_avatar_url( $email ) { return ''; } + +if ( ! function_exists( 'wp_is_numeric_array' ) ) { + /** + * Determines if the variable is a numeric-indexed array. + * + * @since 4.4.0 + * + * @param mixed $data Variable to check. + * @return bool Whether the variable is a list. + */ + function wp_is_numeric_array( $data ) { + if ( ! is_array( $data ) ) { + return false; + } + + $keys = array_keys( $data ); + $string_keys = array_filter( $keys, 'is_string' ); + return count( $string_keys ) === 0; + } +}
Compat shim for `wp_is_numeric_array()` This function is included in WP <I>, but we need to maintain support for <I>
WP-API_WP-API
train
php
ddd5ac56f00462d86f9310d549c9adfa6308f503
diff --git a/build/assembly/bin/assemble.rb b/build/assembly/bin/assemble.rb index <HASH>..<HASH> 100755 --- a/build/assembly/bin/assemble.rb +++ b/build/assembly/bin/assemble.rb @@ -81,8 +81,14 @@ class Assembler end def install_modules - Dir[ tool.base_dir + '/../../modules/*/target/*-module/' ].each do |module_dir| - module_name = File.basename( module_dir, '-module' ).gsub( /torquebox-/, '' ) + modules = Dir[ tool.base_dir + '/../../modules/*/target/*-module/' ].map do |module_dir| + [ File.basename( module_dir, '-module' ).gsub( /torquebox-/, '' ), module_dir ] + end + + # Ensure core module is first + modules.unshift ( modules.assoc( "core" ) ).uniq! + + modules.each do |module_name, module_dir| tool.install_module( module_name, module_dir ) end end
Ensure core subsystem comes first when assembling
torquebox_torquebox
train
rb
200cbf8812c8d09f65c44f966f6cf9bee8c00646
diff --git a/falafel/__init__.py b/falafel/__init__.py index <HASH>..<HASH> 100644 --- a/falafel/__init__.py +++ b/falafel/__init__.py @@ -1,7 +1,7 @@ import os __here__ = os.path.dirname(os.path.abspath(__file__)) -VERSION = "1.0.0" +VERSION = "1.1.0" NAME = "falafel" with open(os.path.join(__here__, "RELEASE")) as f:
Bumping version to <I>
RedHatInsights_insights-core
train
py
c8f7a5544d2df4fd2f4512ec67ef7a8b223e35d2
diff --git a/DatabaseServiceProvider.php b/DatabaseServiceProvider.php index <HASH>..<HASH> 100755 --- a/DatabaseServiceProvider.php +++ b/DatabaseServiceProvider.php @@ -6,7 +6,6 @@ use Faker\Factory as FakerFactory; use Faker\Generator as FakerGenerator; use Illuminate\Contracts\Queue\EntityResolver; use Illuminate\Database\Connectors\ConnectionFactory; -use Illuminate\Database\Eloquent\Factory as EloquentFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\QueueEntityResolver; use Illuminate\Support\ServiceProvider;
Apply fixes from StyleCI (#<I>)
illuminate_database
train
php
3f0ebad3829ecae9dfd11e3524570547edada760
diff --git a/src/rdfauthor.js b/src/rdfauthor.js index <HASH>..<HASH> 100644 --- a/src/rdfauthor.js +++ b/src/rdfauthor.js @@ -1040,7 +1040,12 @@ RDFauthor = (function($) { updateQuery += '\nDELETE DATA FROM <' + g + '> {' + removedArray.join('\n').replace('""""', '"""') + '}'; } - + + // console.log('Added: ' + $.makeArray(added.triples())); + // console.log('Deleted: ' + $.makeArray(removed.triples())); + // console.log('Query: ' + updateQuery); + // return; + $.post(updateURI, { 'query': updateQuery }, function (responseData, textStatus, XHR) {
add debug option to updateSources (sparql<I>) If sparql<I> is used for updating resources, you can comment out the debug option (diplays added, deleted triples and updateQuery and won't run the query').
AKSW_RDFauthor
train
js
768c45978ed0ae3da08d106d0fd651089bc1bd58
diff --git a/pyang/plugins/ietf.py b/pyang/plugins/ietf.py index <HASH>..<HASH> 100644 --- a/pyang/plugins/ietf.py +++ b/pyang/plugins/ietf.py @@ -138,7 +138,8 @@ _recommended_substatements = { _ietf_namespace_prefix = 'urn:ietf:params:xml:ns:yang:' def v_chk_default(ctx, stmt): - if stmt.arg == _keyword_with_default[stmt.keyword]: + if (stmt.arg == _keyword_with_default[stmt.keyword] and + stmt.parent.keyword != 'refine'): err_add(ctx.errors, stmt.pos, 'IETF_EXPLICIT_DEFAULT', (stmt.keyword, stmt.arg))
Do not warn if a refine statement sets a statement to its default value
mbj4668_pyang
train
py
1970a3ee6e2a477c27779df4eedc1d2f47365dad
diff --git a/test/risc/test_callable_compiler1.rb b/test/risc/test_callable_compiler1.rb index <HASH>..<HASH> 100644 --- a/test/risc/test_callable_compiler1.rb +++ b/test/risc/test_callable_compiler1.rb @@ -10,12 +10,19 @@ module Risc end def test_init @compiler.risc_instructions.each do |ins| - puts ins.to_s + ins.register_names.each do |name| + assert ! RegisterValue.look_like_reg(name) + end end end def test_1 @compiler.translate_method( @platform , []) + @compiler.risc_instructions.each do |ins| + ins.register_names.each do |name| + assert RegisterValue.look_like_reg(name) + end + end end end end
test that register allocation allocates risc names
ruby-x_rubyx
train
rb
41fa934e67dc311926eb66f5adbb84a767dcfdb8
diff --git a/lib/active_shipping/shipping/carriers/fedex.rb b/lib/active_shipping/shipping/carriers/fedex.rb index <HASH>..<HASH> 100644 --- a/lib/active_shipping/shipping/carriers/fedex.rb +++ b/lib/active_shipping/shipping/carriers/fedex.rb @@ -47,7 +47,9 @@ module ActiveMerchant "GROUND_HOME_DELIVERY" => "FedEx Ground Home Delivery", "FEDEX_GROUND" => "FedEx Ground", "INTERNATIONAL_GROUND" => "FedEx International Ground", - "SMART_POST" => "FedEx SmartPost" + "SMART_POST" => "FedEx SmartPost", + "FEDEX_FREIGHT_PRIORITY" => "FedEx Freight Priority", + "FEDEX_FREIGHT_ECONOMY" => "FedEx Freight Economy" } PackageTypes = {
Add FedEx Freight Priority and Economy to service types
Shopify_active_shipping
train
rb
d6d51df4dcb517147316b31bed162e612a8304cc
diff --git a/gwpy/plot/colorbar.py b/gwpy/plot/colorbar.py index <HASH>..<HASH> 100644 --- a/gwpy/plot/colorbar.py +++ b/gwpy/plot/colorbar.py @@ -48,15 +48,6 @@ def process_colorbar_kwargs(figure, mappable=None, ax=None, use_axesgrid=True, # -- format mappable # parse normalisation - log = kwargs.pop('log', None) - if log is not None: - warnings.warn('the `log` keyword to Plot.colorbar is deprecated, ' - 'please pass `norm=\'log\'` in the future to ' - 'request a logarithimic normalisation', - DeprecationWarning) - if log: - kwargs.setdefault('norm', 'log') - norm, kwargs = format_norm(kwargs, mappable.norm) mappable.set_norm(norm) mappable.set_cmap(kwargs.pop('cmap', mappable.get_cmap()))
gwpy.plot: remove support for log kwarg in colorbar this has been deprecated forever
gwpy_gwpy
train
py
89bac30450583c43a1ae5a6a5e17de36b015fffb
diff --git a/github/pulls.go b/github/pulls.go index <HASH>..<HASH> 100644 --- a/github/pulls.go +++ b/github/pulls.go @@ -37,6 +37,7 @@ type PullRequest struct { Additions *int `json:"additions,omitempty"` Deletions *int `json:"deletions,omitempty"` ChangedFiles *int `json:"changed_files,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` // TODO(willnorris): add head and base once we have a Commit struct defined somewhere }
add HTMLURL (html_url) to PullRequest
google_go-github
train
go
9f7437daf149515f3d8b2a69543b2e2ba79e6e9a
diff --git a/Crypt/GPG.php b/Crypt/GPG.php index <HASH>..<HASH> 100644 --- a/Crypt/GPG.php +++ b/Crypt/GPG.php @@ -784,6 +784,17 @@ class Crypt_GPG case Crypt_GPG::ERROR_KEY_NOT_FOUND: // ignore not found key errors break; + case Crypt_GPG::ERROR_FILE_PERMISSIONS: + $filename = $this->engine->getErrorFilename(); + if ($filename) { + throw new Crypt_GPG_FileException(sprintf( + 'Error reading GnuPG data file \'%s\'. Check to make ' . + 'sure it is readable by the current user.', $filename), + $code, $filename); + } + throw new Crypt_GPG_FileException( + 'Error reading GnuPG data file. Check to make GnuPG data ' . + 'files are readable by the current user.', $code); default: throw new Crypt_GPG_Exception( 'Unknown error getting keys. Please use the \'debug\' option ' .
Handle case when secret key data file has correct permissions but public key data file does not. Fixes Bug #<I>. git-svn-id: <URL>
pear_Crypt_GPG
train
php
852513d7e5a83fb2d001c1b83994edaea4f822aa
diff --git a/plugins/ExampleUI/Controller.php b/plugins/ExampleUI/Controller.php index <HASH>..<HASH> 100644 --- a/plugins/ExampleUI/Controller.php +++ b/plugins/ExampleUI/Controller.php @@ -66,6 +66,7 @@ class Controller extends \Piwik\Controller $view = $this->getLastUnitGraphAcrossPlugins($this->pluginName, __FUNCTION__, $columns, $selectableColumns = array('server1', 'server2'), 'My documentation', 'ExampleUI.getTemperaturesEvolution'); + $view->filter_sort_column = 'label'; return $this->renderView($view, $fetch); }
refs #<I> fix the evolution graph is sorted by value if only one metric is selected
matomo-org_matomo
train
php
851ffa860d1e73d23555745f41dd04971c3f4af7
diff --git a/geth/wrapper.py b/geth/wrapper.py index <HASH>..<HASH> 100644 --- a/geth/wrapper.py +++ b/geth/wrapper.py @@ -145,6 +145,8 @@ def construct_popen_command(data_dir=None, suffix_kwargs=None, shh=None, allow_insecure_unlock=None, + tx_pool_global_slots=None, + tx_pool_price_limit=None, cache=None): if geth_executable is None: geth_executable = get_geth_binary_path() @@ -249,6 +251,12 @@ def construct_popen_command(data_dir=None, if allow_insecure_unlock: builder.append('--allow-insecure-unlock') + if tx_pool_global_slots is not None: + builder.extend(('--txpool.globalslots', tx_pool_global_slots)) + + if tx_pool_price_limit is not None: + builder.extend(('--txpool.pricelimit', tx_pool_price_limit)) + if cache: builder.extend(('--cache', cache))
feat: tx pool args (#<I>) * feat: tx pool args * fix: single quotes
ethereum_py-geth
train
py
47505ccc427b4d864989a046855db7d9feba2214
diff --git a/lib/obf/utils.rb b/lib/obf/utils.rb index <HASH>..<HASH> 100644 --- a/lib/obf/utils.rb +++ b/lib/obf/utils.rb @@ -161,7 +161,7 @@ module OBF::Utils # TODO: maybe convert to jpg instead of png? # see https://github.com/prawnpdf/prawn/issues/324 # in that case, fill the image with a white background, perhaps? - `convert #{file.path} -density 1200 -resize 300x300 -background none -gravity center -extent 300x300 #{file.path}.png` + `convert #{file.path} -density 1200 -resize 300x300 -background white -gravity center -extent 300x300 #{file.path}.png` "#{file.path}.png" end
white background for all symbols, should help prawn perf
CoughDrop_obf
train
rb
4aa16fce6c6cd6ac65197352046d28b752d0bd04
diff --git a/src/transformers/models/openai/modeling_openai.py b/src/transformers/models/openai/modeling_openai.py index <HASH>..<HASH> 100644 --- a/src/transformers/models/openai/modeling_openai.py +++ b/src/transformers/models/openai/modeling_openai.py @@ -687,7 +687,7 @@ class OpenAIGPTDoubleHeadsModel(OpenAIGPTPreTrainedModel): >>> mc_token_ids = torch.tensor([input_ids.size(-1) - 1, input_ids.size(-1) - 1]).unsqueeze(0) # Batch size 1 >>> outputs = model(input_ids, mc_token_ids=mc_token_ids) - >>> lm_logits = outputs.lm_logits + >>> lm_logits = outputs.logits >>> mc_logits = outputs.mc_logits ```""" return_dict = return_dict if return_dict is not None else self.config.use_return_dict
fix doc example - object has no attribute 'lm_logits' (#<I>)
huggingface_pytorch-pretrained-BERT
train
py
718dbada67e47b7eff9de3969b96f24bfb09d3a8
diff --git a/mod/lesson/report.php b/mod/lesson/report.php index <HASH>..<HASH> 100644 --- a/mod/lesson/report.php +++ b/mod/lesson/report.php @@ -508,7 +508,11 @@ case LESSON_MULTICHOICE: case LESSON_TRUEFALSE: if ($page->qoption) { - $userresponse = explode(",", $useranswer->useranswer); + if ($useranswer == NULL) { + $userresponse = array(); + } else { + $userresponse = explode(",", $useranswer->useranswer); + } if (in_array($answer->id, $userresponse)) { // make checked $data = "<input readonly=\"readonly\" disabled=\"disabled\" name=\"answer[$i]\" checked=\"checked\" type=\"checkbox\" value=\"1\" />"; @@ -542,7 +546,7 @@ $data .= format_text($answer->answer,FORMAT_MOODLE,$formattextdefoptions); } } else { - if ($answer->id == $useranswer->answerid) { + if ($useranswer != NULL and $answer->id == $useranswer->answerid) { // make checked $data = "<input readonly=\"readonly\" disabled=\"disabled\" name=\"answer[$i]\" checked=\"checked\" type=\"checkbox\" value=\"1\" />"; if ($answer->response == NULL) {
[Fix] Notices were being printed in PHP5 for NULL objects. Checking for NULL now before using in multichoice and truefalse questions
moodle_moodle
train
php
aef849a3f8861a54e19902cdaa6c630fb55cd98c
diff --git a/src/Exscript/Host.py b/src/Exscript/Host.py index <HASH>..<HASH> 100644 --- a/src/Exscript/Host.py +++ b/src/Exscript/Host.py @@ -230,7 +230,7 @@ class Host(object): @type value: object @param value: The option value. """ - if name not in ('debug', 'verify_fingerprint',): + if name not in ('debug', 'verify_fingerprint', 'driver'): raise TypeError('No such option: ' + repr(name)) if self.options is None: self.options = {}
Host: add driver option for manual setting driver
knipknap_exscript
train
py
d20be034f13bab36386cf05a721444603be69be1
diff --git a/tools/check/ut.go b/tools/check/ut.go index <HASH>..<HASH> 100644 --- a/tools/check/ut.go +++ b/tools/check/ut.go @@ -356,14 +356,13 @@ func main() { fmt.Println("os.Getwd() error", err) } + var isSucceed bool if len(os.Args) == 1 { // run all tests - cmdRun() - return + isSucceed = cmdRun() } if len(os.Args) >= 2 { - var isSucceed bool switch os.Args[1] { case "list": isSucceed = cmdList(os.Args[2:]...) @@ -374,9 +373,9 @@ func main() { default: isSucceed = usage() } - if !isSucceed { - os.Exit(1) - } + } + if !isSucceed { + os.Exit(1) } }
tools/check: exit non-zero when the unit test fail (#<I>) close pingcap/tidb#<I>
pingcap_tidb
train
go
7f9ab55029260e4b8c6635209ff9f8c31318a236
diff --git a/commah/cosmology_list.py b/commah/cosmology_list.py index <HASH>..<HASH> 100644 --- a/commah/cosmology_list.py +++ b/commah/cosmology_list.py @@ -4,11 +4,14 @@ from __future__ import absolute_import, division, print_function +from cosmolopy.parameters import add_extras as _add_extras def add_extras(cosmo): """Sets neutrino number N_nu = 0, neutrino density omega_n_0 = 0.0, Helium mass fraction Y_He = 0.24. """ + _add_extras(cosmo) + extras = {'omega_n_0': 0.0, 'N_nu': 0, 'Y_He': 0.24}
Tweak to cosmology parameters for use with cosmolopy
astroduff_commah
train
py
556f9951c4958bc4a61b965eafed793dd6d112f2
diff --git a/demo_gegps3.py b/demo_gegps3.py index <HASH>..<HASH> 100644 --- a/demo_gegps3.py +++ b/demo_gegps3.py @@ -14,7 +14,7 @@ __version__ = "0.1a" import time import gps3 -the_connection = gps3.GPSDSocket(host='wadda.ddns.net') # A demo address TODO: needs work for commandline host selection +the_connection = gps3.GPSDSocket(host='gps.ddns.net') # A demo address TODO: needs work for commandline host selection the_fix = gps3.Fix() the_link = '/tmp/gps3_live.kml' # AFAIK, 'Links' call href on time events or entry/exit Multiple href may be possible. the_file = '/tmp/gps3_static.kml' @@ -149,7 +149,7 @@ try: else: pass - time.sleep(1) # default GE refresh rate is 4 seconds, therefore no refresh older than 1 second from itself. + time.sleep(.9) # default GE refresh rate is 4 seconds, therefore no refresh older than 1 second from itself. except KeyboardInterrupt: the_connection.close() print("\nTerminated by user\nGood Bye.\n")
Changed demo gps server address
wadda_gps3
train
py