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
c3d088c78ae5e8397267da75962890f4cf6c487d
diff --git a/src/Codeception/Module/Laravel4.php b/src/Codeception/Module/Laravel4.php index <HASH>..<HASH> 100644 --- a/src/Codeception/Module/Laravel4.php +++ b/src/Codeception/Module/Laravel4.php @@ -30,9 +30,11 @@ use Illuminate\Support\MessageBag; * * ## Config * - * * start: `bootstrap/start.php` - relative path to start.php config file - * * root: `` - relative path to project root directory - * * cleanup: true - all db queries will be run in transaction, which will be rolled back at the end of test. + * * cleanup: `boolean`, default `true` - all db queries will be run in transaction, which will be rolled back at the end of test. + * * unit: `boolean`, default `true` - Laravel will run in unit testing mode. + * * environment: `string`, default `testing` - When running in unit testing mode, we will set a different environment. + * * start: `string`, default `bootstrap/start.php` - Relative path to start.php config file. + * * root: `string`, default ` ` - Root path of our application. * * ## API *
Fixed docblock for Laravel4 Module.
Codeception_base
train
php
83d0232304a16fc7431b6778f80e42cc073b3600
diff --git a/railties/lib/rails/generators/testing/assertions.rb b/railties/lib/rails/generators/testing/assertions.rb index <HASH>..<HASH> 100644 --- a/railties/lib/rails/generators/testing/assertions.rb +++ b/railties/lib/rails/generators/testing/assertions.rb @@ -2,6 +2,8 @@ module Rails module Generators module Testing module Assertions + METHOD_DECLARATION_REGEXP = /(\s+)def #{method}(\(.+\))?(.*?)\n\1end/m + # Asserts a given file exists. You need to supply an absolute path or a path relative # to the configured destination: # @@ -96,7 +98,7 @@ module Rails # end # end def assert_instance_method(method, content) - assert content =~ /(\s+)def #{method}(\(.+\))?(.*?)\n\1end/m, "Expected to have method #{method}" + assert content =~ METHOD_DECLARATION_REGEXP, "Expected to have method #{method}" yield $3.strip if block_given? end alias :assert_method :assert_instance_method
Extract method declaration regexp into a constant
rails_rails
train
rb
9597f2a7fd538a0dbad6ba4ba0a3b650ae03d958
diff --git a/colorsys.js b/colorsys.js index <HASH>..<HASH> 100644 --- a/colorsys.js +++ b/colorsys.js @@ -276,7 +276,7 @@ colorsys.hsv2Hsl = function (h, s, v) { } } - return { h, s, l } + return { h: h, s: s, l: l } } colorsys.hsv_to_hsl = colorsys.hsvToHsl = colorsys.hsv2Hsl
hsv2Hsl- fix for ie<I> + uglify js plugin - both dont work with ES6 well (#<I>)
netbeast_colorsys
train
js
0349010c7cd1b6e4074aac316ea4e028f4aed0b6
diff --git a/carrot/backends/base.py b/carrot/backends/base.py index <HASH>..<HASH> 100644 --- a/carrot/backends/base.py +++ b/carrot/backends/base.py @@ -67,7 +67,7 @@ class BaseBackend(object): def ack(self, delivery_tag): pass - def reject(self, delivery_tag, requeue): + def reject(self, delivery_tag): pass def requeue(self, delivery_tag):
Backend.reject does not take requeue argument, that's what Backend.requeue is for. Closes #8. Thanks to gregoirecachet
ask_carrot
train
py
4bd4f8e9f7dcaf435106e136a19e2cd2ea81acbe
diff --git a/lib/edfize/edf.rb b/lib/edfize/edf.rb index <HASH>..<HASH> 100644 --- a/lib/edfize/edf.rb +++ b/lib/edfize/edf.rb @@ -107,9 +107,7 @@ module Edfize puts "\nSignal Information" signals.each_with_index do |signal, index| puts "\n Position : #{index + 1}" - Signal::SIGNAL_CONFIG.each do |section, hash| - puts " #{hash[:name]}#{' '*(29 - hash[:name].size)}: " + signal.send(section).to_s - end + signal.print_header end puts "\nGeneral Information" puts "Size of Header (bytes) : #{size_of_header}" diff --git a/lib/edfize/signal.rb b/lib/edfize/signal.rb index <HASH>..<HASH> 100644 --- a/lib/edfize/signal.rb +++ b/lib/edfize/signal.rb @@ -23,5 +23,11 @@ module Edfize @samples = [] end + def print_header + SIGNAL_CONFIG.each do |section, hash| + puts " #{hash[:name]}#{' '*(29 - hash[:name].size)}: " + self.send(section).to_s + end + end + end end
Pushed printing of signal header into signal model
nsrr_edfize
train
rb,rb
70d59d0d6b98dc6db1f32e9d9b30ab1c13719b14
diff --git a/visidata/freeze.py b/visidata/freeze.py index <HASH>..<HASH> 100644 --- a/visidata/freeze.py +++ b/visidata/freeze.py @@ -14,6 +14,7 @@ Sheet.resetCache = resetCache def StaticColumn(rows, col): c = deepcopy(col) + c.type = anytype frozenData = {} @asyncthread def _calcRows(sheet):
[freeze] frozen columns start as anytype
saulpw_visidata
train
py
d46fefd74a5b1318058740868bde0ddc96635645
diff --git a/tests/tabular_output/test_preprocessors.py b/tests/tabular_output/test_preprocessors.py index <HASH>..<HASH> 100644 --- a/tests/tabular_output/test_preprocessors.py +++ b/tests/tabular_output/test_preprocessors.py @@ -127,3 +127,20 @@ def test_format_float(): float_format=',') expected = [['1.0'], ['1,000.0'], ['1,000,000.0']] assert expected == result[0] + + +def test_format_numbers_no_format_strings(): + """Test that numbers aren't formatted without format strings.""" + data = ((1), (1000), (1000000)) + headers = ('h1',) + result = format_numbers(data, headers, column_types=(int,)) + assert data, headers == result + + +def test_format_numbers_no_column_types(): + """Test that numbers aren't formatted without column types.""" + data = ((1), (1000), (1000000)) + headers = ('h1',) + result = format_numbers(data, headers, decimal_format=',d', + float_format=',') + assert data, headers == result
Test that formatting doesn't happen without format strings/types.
dbcli_cli_helpers
train
py
3a316d795598f429a1f55afa60c6ef4a2ac70fe9
diff --git a/config/typescript/tsconfig.js b/config/typescript/tsconfig.js index <HASH>..<HASH> 100644 --- a/config/typescript/tsconfig.js +++ b/config/typescript/tsconfig.js @@ -3,6 +3,7 @@ const { paths } = require('../../context'); module.exports = () => ({ compilerOptions: { + skipLibCheck: true, // Fixes https://github.com/cypress-io/cypress/issues/1087 esModuleInterop: true, allowSyntheticDefaultImports: true, resolveJsonModule: true,
fix(lint): Suppress global type clash between Jest and Cypress (#<I>)
seek-oss_sku
train
js
2169575a7c839007a0c680b797b977aafcba4f85
diff --git a/cli.go b/cli.go index <HASH>..<HASH> 100644 --- a/cli.go +++ b/cli.go @@ -99,11 +99,11 @@ func Colorize(str string, a ...interface{}) string { "{_C": getParam(Bold) + getBgColor(Cyan), "{i": getParam(Italic), "{u": getParam(Underline), - "{0": getParam(Reset), "{s": ClearScreen, } for key, value := range changeMap { - str = strings.Replace(str, key, value, -1) + str = strings.Replace(str, key, getParam(Reset)+value, -1) } + str = strings.Replace(str, "{0", getParam(Reset), -1) return str }
Fixed convenience, no more need to place {0 before changing colour
mtfelian_cli
train
go
257622ac68690ee7f0589f452a6b0f8309df1444
diff --git a/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/RestoreJobBuilder.java b/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/RestoreJobBuilder.java index <HASH>..<HASH> 100644 --- a/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/RestoreJobBuilder.java +++ b/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/RestoreJobBuilder.java @@ -307,7 +307,7 @@ public class RestoreJobBuilder implements BatchJobBuilder<Restoration> { destinationSpaceId, false, true, - 1073741824); // 1GiB chunk size + 1000*1000*1000); // 1GiB chunk size endpoint.addEndPointListener(new EndPointLogger()); File watchDir =
Sets duracloud chunk sync endpoint to use GBs rather than GiBs.
duracloud_snapshot
train
java
65418dd40b6cb5da74987feeb39ed1afac5544c7
diff --git a/pgmpy/factors/CPD.py b/pgmpy/factors/CPD.py index <HASH>..<HASH> 100644 --- a/pgmpy/factors/CPD.py +++ b/pgmpy/factors/CPD.py @@ -267,10 +267,11 @@ class TabularCPD(Factor): """ Modifies the cpd table with marginalized values. - Paramters + Parameters --------- - variables: string, list-type - name of variable to be marginalized + variables: list, array-like + list of variable to be marginalized + inplace: boolean If inplace=True it will modify the CPD itself, else would return a new CPD @@ -304,11 +305,12 @@ class TabularCPD(Factor): Parameters ---------- - values: string, list-type - name of the variable values + values: list, array-like + A list of tuples of the form (variable_name, variable_state). + inplace: boolean - If inplace=True it will modify the CPD itself, else would return - a new CPD + If inplace=True it will modify the factor itself, else would return + a new factor. Examples -------- @@ -357,6 +359,7 @@ class TabularCPD(Factor): ---------- new_order: list list of new ordering of variables + inplace: boolean If inplace == True it will modify the CPD itself otherwise new value will be returned without affecting old values
fixes docstrings of a few methods in TabularCPD
pgmpy_pgmpy
train
py
08a342ed2b7f7d09cc787062246a10b5994ac27f
diff --git a/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java b/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java index <HASH>..<HASH> 100644 --- a/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java +++ b/library/src/main/java/de/mrapp/android/preference/activity/PreferenceActivity.java @@ -1151,13 +1151,10 @@ public abstract class PreferenceActivity extends AppCompatActivity * Obtains the width of the navigation from a specific theme. */ private void obtainNavigationWidth() { + int defaultValue = getResources().getDimensionPixelSize(R.dimen.default_navigation_width); TypedArray typedArray = getTheme().obtainStyledAttributes(new int[]{R.attr.navigationWidth}); - int width = pixelsToDp(this, typedArray.getDimensionPixelSize(0, 0)); - - if (width != 0) { - setNavigationWidth(width); - } + setNavigationWidth(pixelsToDp(this, typedArray.getDimensionPixelSize(0, defaultValue))); } /**
Fixed bug #<I>: The activity is now layouted correctly on tablets, even if no custom navigation width is specified.
michael-rapp_AndroidPreferenceActivity
train
java
1d239b7c916d67f655a3e1f4e85b9e2e816a0e32
diff --git a/mqtt/client/connection.go b/mqtt/client/connection.go index <HASH>..<HASH> 100644 --- a/mqtt/client/connection.go +++ b/mqtt/client/connection.go @@ -12,7 +12,8 @@ type connection struct { r *bufio.Reader // w is the buffered writer. w *bufio.Writer - // disconnected is true if the Network Connection is disconnected. + // disconnected is true if the Network Connection + // has been disconnected. disconnected bool }
Update mqtt/client/connection.go
yosssi_gmq
train
go
a18e03cacd5e74cdd2fc6f72dbb9fc48796a2804
diff --git a/src-modules/org/opencms/workplace/tools/sites/CmsSitesFaviconUpload.java b/src-modules/org/opencms/workplace/tools/sites/CmsSitesFaviconUpload.java index <HASH>..<HASH> 100644 --- a/src-modules/org/opencms/workplace/tools/sites/CmsSitesFaviconUpload.java +++ b/src-modules/org/opencms/workplace/tools/sites/CmsSitesFaviconUpload.java @@ -127,7 +127,9 @@ public class CmsSitesFaviconUpload extends A_CmsImportFromHttp { int imageResId = CmsResourceTypeImage.getStaticTypeId(); if (cms.existsResource(favCreatePath)) { // replace the existing favicon + cms.lockResource(favCreatePath); cms.replaceResource(favCreatePath, imageResId, content, new ArrayList<CmsProperty>()); + cms.unlockResource(favCreatePath); } else { // create the new favicon cms.createResource(favCreatePath, imageResId, content, new ArrayList<CmsProperty>());
Lock the favicon file before perform a resource replacement.
alkacon_opencms-core
train
java
bc1830d8eb43a87968da6a484d0e35f704adb3f5
diff --git a/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/FileUtils.java b/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/FileUtils.java index <HASH>..<HASH> 100644 --- a/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/FileUtils.java +++ b/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/FileUtils.java @@ -61,7 +61,7 @@ public final class FileUtils { String ret = null; final int pos = fileName.lastIndexOf("."); if (pos >= 0) { - ret = fileName.substring(pos + 1, fileName.length()).toLowerCase(); + ret = fileName.substring(pos + 1).toLowerCase(); } return ret; }
Removed redundant call to length for substring.
jeremylong_DependencyCheck
train
java
8f94756470fe1f4c2b360bc2f3f38221fb9c4718
diff --git a/lib/sandbox/execute.js b/lib/sandbox/execute.js index <HASH>..<HASH> 100644 --- a/lib/sandbox/execute.js +++ b/lib/sandbox/execute.js @@ -64,6 +64,7 @@ module.exports = function (bridge, glob) { // prepare the scope's environment variables scope.import(new StubTimers(console)); scope.import({ + Buffer: require('buffer').Buffer, console: console, pm: new PostmanAPI(bridge, execution) }); diff --git a/lib/sandbox/postman-legacy-interface.js b/lib/sandbox/postman-legacy-interface.js index <HASH>..<HASH> 100644 --- a/lib/sandbox/postman-legacy-interface.js +++ b/lib/sandbox/postman-legacy-interface.js @@ -3,7 +3,6 @@ var _ = require('lodash'), scopeLibraries = { JSON: require('liquid-json'), - Buffer: require('buffer').Buffer, _: require('lodash3').noConflict(), CryptoJS: require('crypto-js'), atob: require('atob'),
Made Buffer to move out of legacy and be always available
postmanlabs_postman-sandbox
train
js,js
8b16c8331f3e37318ff657218bbdd38236b22c90
diff --git a/lib/srv/db/proxyserver.go b/lib/srv/db/proxyserver.go index <HASH>..<HASH> 100644 --- a/lib/srv/db/proxyserver.go +++ b/lib/srv/db/proxyserver.go @@ -324,7 +324,7 @@ func (s *ProxyServer) handleConnection(conn net.Conn) error { return trace.Wrap(err) } switch proxyCtx.Identity.RouteToDatabase.Protocol { - case defaults.ProtocolPostgres: + case defaults.ProtocolPostgres, defaults.ProtocolCockroachDB: return s.PostgresProxyNoTLS().HandleConnection(s.closeCtx, tlsConn) case defaults.ProtocolMySQL: version := getMySQLVersionFromServer(proxyCtx.Servers)
Fix tunnel mode for CockroachDB (#<I>)
gravitational_teleport
train
go
954dc2a7e2ac0b01fb409c3adbef3d8ba3477531
diff --git a/spec/mongoid/copyable_spec.rb b/spec/mongoid/copyable_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mongoid/copyable_spec.rb +++ b/spec/mongoid/copyable_spec.rb @@ -99,14 +99,14 @@ describe Mongoid::Copyable do end end - pending "when saving the copy" do + context "when saving the copy" do let(:reloaded) do copy.reload end before do - copy.save + copy.save(:validate => false) end it "persists the attributes" do @@ -199,7 +199,7 @@ describe Mongoid::Copyable do end before do - copy.save + copy.save(:validate => false) end it "persists the attributes" do @@ -282,7 +282,7 @@ describe Mongoid::Copyable do end before do - copy.save + copy.save(:validate => false) end it "persists the attributes" do
Fixing busted up spec around JRuby and validations with respect to what seems to be too aggressive inlining.
mongodb_mongoid
train
rb
1f86baa6e1dbf0b9c2e961c0919c8028074cdd1c
diff --git a/lib/faml/stats.rb b/lib/faml/stats.rb index <HASH>..<HASH> 100644 --- a/lib/faml/stats.rb +++ b/lib/faml/stats.rb @@ -8,6 +8,7 @@ module Faml Info = Struct.new( :empty_attribute_count, :static_attribute_count, + :static_id_or_class_attribute_count, :dynamic_attribute_count, :dynamic_attribute_with_data_count, :dynamic_attribute_with_newline_count, @@ -101,7 +102,7 @@ module Faml if ast.static_class.empty? && ast.static_id.empty? info.empty_attribute_count += 1 else - info.static_attribute_count += 1 + info.static_id_or_class_attribute_count += 1 end else static_hash_parser = StaticHashParser.new @@ -129,6 +130,7 @@ module Faml ruby = info.ruby_attribute_count total = static + dynamic + ruby puts 'Attribute stats' + printf(" Attributes with id or class only: %d\n", info.static_id_or_class_attribute_count) printf(" Static attributes: %d (%.2f%%)\n", static, static * 100.0 / total) printf(" Dynamic attributes: %d (%.2f%%)\n", dynamic, dynamic * 100.0 / total) printf(" with data: %d\n", info.dynamic_attribute_with_data_count)
Exclude id or class only attributes from static attributes
eagletmt_faml
train
rb
2b68817aed5945ec5ba73887a67e21bb1c6902f2
diff --git a/client/lib/cart/store/cart-synchronizer.js b/client/lib/cart/store/cart-synchronizer.js index <HASH>..<HASH> 100644 --- a/client/lib/cart/store/cart-synchronizer.js +++ b/client/lib/cart/store/cart-synchronizer.js @@ -70,7 +70,7 @@ function CartSynchronizer( cartKey, wpcom ) { Emitter( CartSynchronizer.prototype ); -CartSynchronizer.prototype.handleDispatch = ( { action } ) => { +CartSynchronizer.prototype.handleDispatch = function( { action } ) { switch ( action.type ) { case TRANSACTION_STEP_SET: if ( action.step.first && ! action.step.last ) {
Cart Synchronizer: rewrite handleDispatch method to classic function (#<I>) Arrow function has the wrong `this` and throws exception when trying to call `this.pause()` or `this.resume()`. Regressed in #<I>.
Automattic_wp-calypso
train
js
0221e256908f5456f45c55b458a28df4a09cfc90
diff --git a/src/styles/text/text_settings.js b/src/styles/text/text_settings.js index <HASH>..<HASH> 100644 --- a/src/styles/text/text_settings.js +++ b/src/styles/text/text_settings.js @@ -69,9 +69,6 @@ const TextSettings = { style.transform = draw.font.transform; - // original size (not currently used, but useful for debugging) - style.size = draw.font.size || this.defaults.size; - // calculated pixel size style.supersample = draw.supersample_text ? 1.5 : 1; // optionally render text at 150% to improve clarity style.px_size = StyleParser.evalCachedProperty(draw.font.px_size, context) * style.supersample;
fix use of JS functions for font `size` (compiled function debug variable was being sent cross-thread, causing a worker clone error)
tangrams_tangram
train
js
62b84216805360fd7bd0931194863ddf7018addb
diff --git a/test/integration_test.rb b/test/integration_test.rb index <HASH>..<HASH> 100644 --- a/test/integration_test.rb +++ b/test/integration_test.rb @@ -137,7 +137,7 @@ module SpriteFactory #---------------------------------------------------------------------------- def test_generate_sprite_from_other_formats - #integration_test(FORMATS_PATH, :library => :rmagick) + integration_test(FORMATS_PATH, :library => :rmagick) end #----------------------------------------------------------------------------
Uncomment a failing spec that was fixed by recent master branch sync
jakesgordon_sprite-factory
train
rb
64649ee5231f897d336be4c3d17ad965900d07fd
diff --git a/views/js/richPassage/xincludeRendererAddStyles.js b/views/js/richPassage/xincludeRendererAddStyles.js index <HASH>..<HASH> 100644 --- a/views/js/richPassage/xincludeRendererAddStyles.js +++ b/views/js/richPassage/xincludeRendererAddStyles.js @@ -40,9 +40,10 @@ define(['lodash', 'jquery', 'uri', 'util/url', 'core/dataProvider/request', 'tao }); head.append(styleElem); if (element.name !== 'tao-user-styles.css') { - $(`[href="${link}"]`).load((e) => { - formatStyles(e.target, passageClassName); - }) + const cssFile = $(`[href="${link}"]`); + if (cssFile) { + formatStyles(cssFile, passageClassName); + } } });
fix: format CSS on Item authoring
oat-sa_extension-tao-mediamanager
train
js
92e3660a8e7353a50cd0648820c6ebd08be3f698
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os import glob from setuptools import setup -VERSION = "0.9.6" +VERSION = "0.9.7" def find_data_files(source, target, patterns): @@ -48,7 +48,7 @@ setup( url='https://github.com/revarbat/pymuv', download_url='https://github.com/revarbat/pymuv/archive/master.zip', packages=['pymuv'], - package_data={'pymuv': ["incls/fb6/*"]}, + package_data={'pymuv': ["incls/fb6/*", "incls/fb7/*"]}, license='MIT License', classifiers=[ 'Development Status :: 4 - Beta',
Repackage with fb7 includes
revarbat_pymuv
train
py
713b3743419555e7fde24204ad8549cf372d037a
diff --git a/core/src/main/java/hudson/slaves/SlaveComputer.java b/core/src/main/java/hudson/slaves/SlaveComputer.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/slaves/SlaveComputer.java +++ b/core/src/main/java/hudson/slaves/SlaveComputer.java @@ -42,7 +42,7 @@ import java.io.FileOutputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.io.IOException; -import java.io.PrintWriter; +import java.io.PrintStream; import java.util.logging.Level; import java.util.logging.LogRecord; import java.util.logging.Logger; @@ -271,8 +271,8 @@ public class SlaveComputer extends Computer { if(this.channel!=null) throw new IllegalStateException("Already connected"); - PrintWriter log = new PrintWriter(launchLog,true); - final TaskListener taskListener = new StreamTaskListener(log); + final TaskListener taskListener = new StreamTaskListener(launchLog); + PrintStream log = taskListener.getLogger(); Channel channel = new Channel(nodeName,threadPoolForRemoting, Channel.Mode.NEGOTIATE, in,out, launchLog);
StreamTaskListener(Writer) uses WriterOutputStream and unnecessarily make the pipeline longer. This also caused the log blockage for the Selenium plugin git-svn-id: <URL>
jenkinsci_jenkins
train
java
01e35043498fd85b0158f7da720f2a081fe4f04b
diff --git a/src/drawer.multicanvas.js b/src/drawer.multicanvas.js index <HASH>..<HASH> 100644 --- a/src/drawer.multicanvas.js +++ b/src/drawer.multicanvas.js @@ -174,11 +174,6 @@ WaveSurfer.util.extend(WaveSurfer.Drawer.MultiCanvas, { var scale = length / width; - this.canvases[0].waveCtx.fillStyle = this.params.waveColor; - if (this.canvases[0].progressCtx) { - this.canvases[0].progressCtx.fillStyle = this.params.progressColor; - } - for (var i = 0; i < width; i += step) { var h = Math.round(peaks[Math.floor(i * scale)] / absmax * halfH); this.fillRect(i + this.halfPixel, halfH - h + offsetY, bar + this.halfPixel, h * 2);
Removed unused code in multicanvas bar drawer that caused an exception on first draw (#<I>)
katspaugh_wavesurfer.js
train
js
caf320abef1dfd351b58617d278f61aa234ea811
diff --git a/src/Extensions/FormFieldExtension.php b/src/Extensions/FormFieldExtension.php index <HASH>..<HASH> 100644 --- a/src/Extensions/FormFieldExtension.php +++ b/src/Extensions/FormFieldExtension.php @@ -139,6 +139,10 @@ class FormFieldExtension extends Extension */ public function getCalendarEnabled() { + if ($this->owner->isReadonly() || $this->owner->isDisabled()) { + return 'false'; + } + return ($this->calendarDisabled || $this->owner->config()->calendar_disabled) ? 'false' : 'true'; }
Disable picker when field is readonly or disabled
praxisnetau_silverware-calendar
train
php
de6ea2a6a01e9f2ae0eb722297cec8c7b21eacd3
diff --git a/src/GDAO/Model/CollectionInterface.php b/src/GDAO/Model/CollectionInterface.php index <HASH>..<HASH> 100644 --- a/src/GDAO/Model/CollectionInterface.php +++ b/src/GDAO/Model/CollectionInterface.php @@ -164,7 +164,7 @@ interface CollectionInterface extends \ArrayAccess, \Countable, \IteratorAggrega * @throws \PDOException * */ - public function save($group_inserts_together=false); + public function saveAll($group_inserts_together=false); /** * @@ -278,23 +278,23 @@ interface CollectionInterface extends \ArrayAccess, \Countable, \IteratorAggrega * User-defined pre-save logic for the collection. * * Implementers of this class should add a call to this method as the - * first line of code in their implementation of $this->save(...) + * first line of code in their implementation of $this->saveAll(...) * * @return void * */ - public function _preSave(); + public function _preSaveAll(); /** * * User-defined post-save logic for the collection. * * Implementers of this class should add a call to this method as the - * last line of code in their implementation of $this->save(...) + * last line of code in their implementation of $this->saveAll(...) * * @return void * */ - public function _postSave(); + public function _postSaveAll(); }
Changed the CollectionInterface's save method to saveAll and preSave and postSave to preSaveAll and postSaveAll.
rotexsoft_gdao
train
php
7854ac8c9c5e1b4b1f9aec5c2d200ba2728c974b
diff --git a/docker_squash/version.py b/docker_squash/version.py index <HASH>..<HASH> 100644 --- a/docker_squash/version.py +++ b/docker_squash/version.py @@ -1 +1 @@ -version = "1.0.0dev" +version = "1.0.0rc6"
<I>rc6 release
goldmann_docker-squash
train
py
44e911ce90721ebb5ad32f790b866396c044473c
diff --git a/src/Installer/Form/AdditionalComponentsForm.php b/src/Installer/Form/AdditionalComponentsForm.php index <HASH>..<HASH> 100644 --- a/src/Installer/Form/AdditionalComponentsForm.php +++ b/src/Installer/Form/AdditionalComponentsForm.php @@ -132,7 +132,6 @@ class AdditionalComponentsForm extends FormBase { $install_state[0]['droopler_init_content'] = 0; if ($values['init_content']) { - //$am = $this->initContent($values); $install_state[0]['droopler_init_content'] = 1; $additional_modules = [ 'd_demo',
Issue #<I>: Custom installer for Droopler
droptica_droopler
train
php
eab40a5974206421705faed08e538c958806acbf
diff --git a/cli/config/config.go b/cli/config/config.go index <HASH>..<HASH> 100644 --- a/cli/config/config.go +++ b/cli/config/config.go @@ -46,6 +46,11 @@ func SetDir(dir string) { configDir = dir } +// Path returns the path to a file relative to the config dir +func Path(p ...string) string { + return filepath.Join(append([]string{Dir()}, p...)...) +} + // LegacyLoadFromReader is a convenience function that creates a ConfigFile object from // a non-nested reader func LegacyLoadFromReader(configData io.Reader) (*configfile.ConfigFile, error) { diff --git a/cli/config/config_test.go b/cli/config/config_test.go index <HASH>..<HASH> 100644 --- a/cli/config/config_test.go +++ b/cli/config/config_test.go @@ -548,3 +548,17 @@ func TestLoadDefaultConfigFile(t *testing.T) { assert.Check(t, is.DeepEqual(expected, configFile)) } + +func TestConfigPath(t *testing.T) { + oldDir := Dir() + + SetDir("dummy1") + f1 := Path("a", "b") + assert.Equal(t, f1, filepath.Join("dummy1", "a", "b")) + + SetDir("dummy2") + f2 := Path("c", "d") + assert.Equal(t, f2, filepath.Join("dummy2", "c", "d")) + + SetDir(oldDir) +}
cli/config: Add a helper to resolve a file within the config dir
docker_cli
train
go,go
d1fbe2ceb9bf8fda5dea6a215589ac321b30e409
diff --git a/ng-annotate-main.js b/ng-annotate-main.js index <HASH>..<HASH> 100644 --- a/ng-annotate-main.js +++ b/ng-annotate-main.js @@ -329,7 +329,9 @@ function matchRegular(node, ctx) { args.length === 1 && args[0] : args.length === 2 && args[0].type === "Literal" && is.string(args[0].value) && args[1]); - target.$methodName = method.name; + if (target) { + target.$methodName = method.name; + } if (ctx.rename && args.length === 2 && target) { // for eventual rename purposes
bugfix setting a property on false (caused crash in io.js)
olov_ng-annotate
train
js
72f904a34b0eedd425abd06c0869404a632b1b57
diff --git a/lib/optimize/RuntimeChunkPlugin.js b/lib/optimize/RuntimeChunkPlugin.js index <HASH>..<HASH> 100644 --- a/lib/optimize/RuntimeChunkPlugin.js +++ b/lib/optimize/RuntimeChunkPlugin.js @@ -8,7 +8,7 @@ module.exports = class RuntimeChunkPlugin { constructor(options) {} apply(compiler) { - compiler.hooks.compilation.tap("RuntimeChunkPlugin", compilation => { + compiler.hooks.thisCompilation.tap("RuntimeChunkPlugin", compilation => { compilation.hooks.optimizeChunksAdvanced.tap("RuntimeChunkPlugin", () => { for(const entrypoint of compilation.entrypoints.values()) { const chunk = entrypoint.getRuntimeChunk(); diff --git a/lib/optimize/SplitChunksPlugin.js b/lib/optimize/SplitChunksPlugin.js index <HASH>..<HASH> 100644 --- a/lib/optimize/SplitChunksPlugin.js +++ b/lib/optimize/SplitChunksPlugin.js @@ -176,7 +176,7 @@ module.exports = class SplitChunksPlugin { } apply(compiler) { - compiler.hooks.compilation.tap("SplitChunksPlugin", compilation => { + compiler.hooks.thisCompilation.tap("SplitChunksPlugin", compilation => { let alreadyOptimized = false; compilation.hooks.unseal.tap("SplitChunksPlugin", () => { alreadyOptimized = false;
run splitChunks and runtimeChunk only on main compiliation
webpack_webpack
train
js,js
52e7137fc039c3df2ede5cc14d33e5368c1fd9f0
diff --git a/lxd/patches.go b/lxd/patches.go index <HASH>..<HASH> 100644 --- a/lxd/patches.go +++ b/lxd/patches.go @@ -3787,7 +3787,7 @@ func patchNetworkCearBridgeVolatileHwaddr(name string, d *Daemon) error { } for _, networkName := range networks { - _, net, err := d.cluster.GetNetworkInAnyState(projectName, networkName) + _, net, _, err := d.cluster.GetNetworkInAnyState(projectName, networkName) if err != nil { return errors.Wrapf(err, "Failed loading network %q for network_clear_bridge_volatile_hwaddr patch", networkName) }
lxd/patches: d.cluster.GetNetworkInAnyState usage
lxc_lxd
train
go
e8cbe7ad7f5080db9e239916a3688eddbf90f404
diff --git a/civicpy/tests/test_civic.py b/civicpy/tests/test_civic.py index <HASH>..<HASH> 100644 --- a/civicpy/tests/test_civic.py +++ b/civicpy/tests/test_civic.py @@ -8,10 +8,11 @@ ELEMENTS = [ def setup_module(): - if civic.cache_file_present(): - civic.load_cache() - else: - civic.update_cache(from_remote_cache=True) + # if civic.cache_file_present(): + # civic.load_cache() + # else: + # civic.update_cache(from_remote_cache=True) + civic.update_cache(from_remote_cache=False) @pytest.fixture(scope="module", params=ELEMENTS)
hard load tests due to underlying change to data model
griffithlab_civicpy
train
py
aad9cb1851316edeefcb3386999503af3a484346
diff --git a/provider/digitalocean.py b/provider/digitalocean.py index <HASH>..<HASH> 100644 --- a/provider/digitalocean.py +++ b/provider/digitalocean.py @@ -54,7 +54,7 @@ def destroy_layer(layer): conn = _create_digitalocean_connection(layer['creds']) name = "deis-{formation}-{id}".format(**layer) # retrieve and delete the SSH key created - for k in conn.all_ssh_keys(): + for k in conn.ssh_keys(): if k.name == name: conn.destroy_ssh_key(k.id) @@ -93,7 +93,7 @@ def _get_droplet_kwargs(node, conn): 'size_id': _get_id(conn.sizes(), params.get('size', '4GB')), 'image_id': _get_id(conn.images(my_images=True), params.get('image', 'deis-node-image')), 'region_id': _get_id(conn.regions(), params.get('region', 'San Francisco 1')), - 'ssh_key_ids': [str(_get_id(conn.all_ssh_keys(), + 'ssh_key_ids': [str(_get_id(conn.ssh_keys(), "deis-{formation}-{layer}".format(**node)))], 'virtio': True, 'private_networking': True
fix(providers): update dop calls Before dop <I>, the call to get all SSH keys listed on your account was called all_ssh_keys(). In <I>, they introduced a couple of breaking changes, including the change to rename all_ssh_keys() to ssh_keys(). ref: <URL>
deis_controller-sdk-go
train
py
f1ed5158b03ede0586cbb335e47fc8d669125fc1
diff --git a/salt/modules/tls.py b/salt/modules/tls.py index <HASH>..<HASH> 100644 --- a/salt/modules/tls.py +++ b/salt/modules/tls.py @@ -26,7 +26,7 @@ HAS_SSL = False try: import OpenSSL HAS_SSL = True - OpenSSL_version = OpenSSL.__dict__.get('__version__', None) + OpenSSL_version = OpenSSL.__dict__.get('__version__', '0.0') except ImportError: pass
If I'm going to use floats for version comparison, it behoves me to provide something for float() to work with.
saltstack_salt
train
py
4c9935e343091080005b175e14160b916bf35490
diff --git a/tests/Weew/HttpClient/blueprint.php b/tests/Weew/HttpClient/blueprint.php index <HASH>..<HASH> 100644 --- a/tests/Weew/HttpClient/blueprint.php +++ b/tests/Weew/HttpClient/blueprint.php @@ -3,13 +3,12 @@ use Weew\Http\Cookie; use Weew\Http\HttpResponse; use Weew\Http\HttpStatusCode; -use Weew\HttpBlueprint\Blueprint; use Weew\HttpBlueprint\BlueprintProxy; require __DIR__.'/../../../vendor/autoload.php'; -$blueprint = new Blueprint(); -$blueprint +$proxy = new BlueprintProxy(); +$proxy->getRouter() ->get('/', new HttpResponse(HttpStatusCode::OK, 'bar')) ->post('post', function() { $response = new HttpResponse( @@ -37,6 +36,4 @@ $blueprint return $response; }); -$proxy = new BlueprintProxy(); -$proxy->addBlueprint($blueprint); $proxy->sendResponse();
Updating to the latest blueprint version.
weew_http-client
train
php
8733f4f080b3b9941d062c9052415e590486dcde
diff --git a/galpy/df_src/evolveddiskdf.py b/galpy/df_src/evolveddiskdf.py index <HASH>..<HASH> 100644 --- a/galpy/df_src/evolveddiskdf.py +++ b/galpy/df_src/evolveddiskdf.py @@ -179,10 +179,14 @@ class evolveddiskdf: orb_array[2,ii]) for ii in range(len(t))]) if deriv.lower() == 'r': - dR= 10.**-2. #BOVY ADJUST WHEN INTEGRATING CORRECTLY + dR= 5.*10.**-2. #BOVY ADJUST WHEN INTEGRATING CORRECTLY + tmp= o.R()+dR + dR= tmp-o.R() do= Orbit(vxvv=[o.R()+dR,o.vR(),o.vT(),o.phi()]) elif deriv.lower() == 'phi': - dphi= 10.**-2. + dphi= 5.*10.**-2. + tmp= o.phi()+dphi + dphi= tmp-o.phi() do= Orbit(vxvv=[o.R(),o.vR(),o.vT(),o.phi()+dphi]) do.integrate(ts,self._pot,method=integrate_method) dorb_array= do.getOrbit().T
icnrease dR further for now
jobovy_galpy
train
py
37848062444e3e27b03a4f06df6c31a90b251682
diff --git a/lib/slimmer.rb b/lib/slimmer.rb index <HASH>..<HASH> 100644 --- a/lib/slimmer.rb +++ b/lib/slimmer.rb @@ -131,6 +131,25 @@ module Slimmer end end + class SectionInserter + def filter(src,dest) + meta_name = dest.at_css('meta[name="x-section-name"]') + meta_link = dest.at_css('meta[name="x-section-link"]') + list = dest.at_css('nav[role=navigation] ol') + + if meta_name && meta_link && list + link_node = Nokogiri::XML::Node.new('a', dest) + link_node['href'] = meta_link['content'] + link_node.content = meta_name['content'] + + list_item = Nokogiri::XML::Node.new('li', dest) + list_item.add_child(link_node) + + list.first_element_child.after(list_item) + end + end + end + class TagMover def filter(src,dest) move_tags(src, dest, 'script', :must_have => ['src']) @@ -245,7 +264,8 @@ module Slimmer processors = [ TitleInserter.new(), TagMover.new(), - BodyInserter.new() + BodyInserter.new(), + SectionInserter.new() ] self.process(processors,body,template('wrapper'))
Set up "breadcrumbs" appropriately If a page has the meta tags x-section-name and x-section-link we can build the appropriate content for the "breadcrumb" trail
alphagov_slimmer
train
rb
50697c341deef6c0f394874baf294bb2081dc730
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -41,7 +41,7 @@ function Genius(accessToken) { if (typeof options === "function") { callback = options; } - + var request = { url: "https://api.genius.com/artists/" + artistId + "/songs", headers: { "Authorization": "Bearer " + this.accessToken }, @@ -50,13 +50,15 @@ function Genius(accessToken) { _makeRequest(request, callback); }; - + this.getSong = function(songId, options, callback) { + if (typeof options === "function") { + callback = options; + } - this.getSong = function(songId, callback) { var request = { url: "https://api.genius.com/songs/" + songId, headers: { "Authorization": "Bearer " + this.accessToken }, - qs: { "text_format": "plain" } + qs: options }; _makeRequest(request, callback); };
added options arg to getSong function
bookercodes_node-genius
train
js
385ccaa1dc61e33ce2b0ed2668d07b8e84c2db14
diff --git a/lib/sshkit/backends/netssh.rb b/lib/sshkit/backends/netssh.rb index <HASH>..<HASH> 100644 --- a/lib/sshkit/backends/netssh.rb +++ b/lib/sshkit/backends/netssh.rb @@ -1,6 +1,18 @@ require 'net/ssh' require 'net/scp' +module Net + module SSH + class Config + class << self + def default_files + @@default_files + [File.join(Dir.pwd, '.ssh/config')] + end + end + end + end +end + module SSHKit class Logger diff --git a/test/unit/backends/test_netssh.rb b/test/unit/backends/test_netssh.rb index <HASH>..<HASH> 100644 --- a/test/unit/backends/test_netssh.rb +++ b/test/unit/backends/test_netssh.rb @@ -26,6 +26,11 @@ module SSHKit assert_equal %w(/home/user/.ssh/id_rsa), backend.config.ssh_options[:keys] assert_equal false, backend.config.ssh_options[:forward_agent] assert_equal %w(publickey password), backend.config.ssh_options[:auth_methods] + + end + + def test_netssh_ext + assert_includes Net::SSH::Config.default_files, "#{Dir.pwd}/.ssh/config" end end end
Look for ./.ssh/config in local directory
capistrano_sshkit
train
rb,rb
c2d4e3ee62ece72639ec3cd59a33332704ff5247
diff --git a/lib/Phactory.php b/lib/Phactory.php index <HASH>..<HASH> 100755 --- a/lib/Phactory.php +++ b/lib/Phactory.php @@ -34,7 +34,7 @@ class Phactory return new HasOneRelationship($name, $type, $override); } - public function uses($dependancy) + public static function uses($dependancy) { return new Dependency($dependancy); } @@ -46,7 +46,7 @@ class Phactory return self::create_blueprint($name, $type, $override); } - public function create_blueprint($name, $type, $override=array()) + public static function create_blueprint($name, $type, $override=array()) { if (self::fixtures()->has_fixture($name, $type)) return self::fixtures()->get_fixture($name, $type); @@ -86,7 +86,7 @@ class Phactory return isset(self::$fixtures) ? self::$fixtures : self::$fixtures = new Fixtures; } - public function triggers($triggers=null) + public static function triggers($triggers=null) { if (is_object($triggers)) self::$triggers = new Triggers($triggers);
Fix E_STRICT errors in PHactory
rbone_phactory
train
php
4ac9f445719a2ed8b522d4246938129c265bcfe4
diff --git a/src/Composer/DependencyResolver/PoolBuilder.php b/src/Composer/DependencyResolver/PoolBuilder.php index <HASH>..<HASH> 100644 --- a/src/Composer/DependencyResolver/PoolBuilder.php +++ b/src/Composer/DependencyResolver/PoolBuilder.php @@ -265,8 +265,7 @@ class PoolBuilder $constraint = $rootRequires[$name]; } - // Not yet loaded or already marked for a reload, override the existing constraint - // (either it's a new one to load, or it has already been extended above) + // Not yet loaded or already marked for a reload, set the constraint to be loaded if (!isset($this->loadedPackages[$name])) { // Maybe it was already marked before but not loaded yet. In that case // we have to extend the constraint (we don't check if they are identical because
Clear up PoolBuilder comment after code move
composer_composer
train
php
0c70df90150db603101801b988cb002787869f65
diff --git a/doradus-server/src/com/dell/doradus/search/FieldSetCreator.java b/doradus-server/src/com/dell/doradus/search/FieldSetCreator.java index <HASH>..<HASH> 100644 --- a/doradus-server/src/com/dell/doradus/search/FieldSetCreator.java +++ b/doradus-server/src/com/dell/doradus/search/FieldSetCreator.java @@ -129,10 +129,13 @@ public class FieldSetCreator { for(String f: scalarFields) { if(f.equals(CommonDefs.ID_FIELD)) continue; else if(f.equals("*")) { - for(String field: entity.getAllFields()) { - String value = entity.get(field); - if(value != null) result.scalars.put(field, value); - } + Iterable<String> allFields = entity.getAllFields(); + if(allFields != null) { + for(String field: allFields) { + String value = entity.get(field); + if(value != null) result.scalars.put(field, value); + } + } }else { String v = entity.get(f); if(v != null) result.scalars.put(f, v);
Spider: fixed NPE when getting fields for non-existing object
QSFT_Doradus
train
java
25b885a16ecd04ee5bc1ee9545041367b4e98127
diff --git a/java/integration-tests/src/test/java/io/joynr/integration/AccessControllerEnd2EndTest.java b/java/integration-tests/src/test/java/io/joynr/integration/AccessControllerEnd2EndTest.java index <HASH>..<HASH> 100644 --- a/java/integration-tests/src/test/java/io/joynr/integration/AccessControllerEnd2EndTest.java +++ b/java/integration-tests/src/test/java/io/joynr/integration/AccessControllerEnd2EndTest.java @@ -28,6 +28,7 @@ import java.util.Properties; import org.junit.After; import org.junit.Assert; import org.junit.Before; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -112,6 +113,8 @@ public class AccessControllerEnd2EndTest { runtime.shutdown(true); } + // TODO enable again when backend services are fixed + @Ignore @Test public void testAllowedRPCCallSucceeds() { createDefaultGDACEntries(TEST_DOMAIN, @@ -127,6 +130,8 @@ public class AccessControllerEnd2EndTest { assertEquals(15, result.intValue()); } + // TODO enable again when backend services are fixed + @Ignore @Test public void testForbiddenRPCCallFails() { createDefaultGDACEntries(TEST_DOMAIN,
[Java] Temporarily disable AccessControllerEnd2EndTest * AccessControllerEnd2EndTest is failing because joynr providers in the joynr backend services are not registered reliably. * Temporarily disable affected tests until the problem is fully understood and fixed.
bmwcarit_joynr
train
java
3a753ffb42cc2b701e643b7ce81e4561384ebc5b
diff --git a/dispute.go b/dispute.go index <HASH>..<HASH> 100644 --- a/dispute.go +++ b/dispute.go @@ -77,10 +77,11 @@ type DisputeEvidenceParams struct { // DisputeListParams is the set of parameters that can be used when listing disputes. // For more details see https://stripe.com/docs/api#list_disputes. type DisputeListParams struct { - ListParams `form:"*"` - Charge *string `form:"charge"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` + ListParams `form:"*"` + Charge *string `form:"charge"` + Created *int64 `form:"created"` + CreatedRange *RangeQueryParams `form:"created"` + PaymentIntent *string `form:"payment_intent"` } // Dispute is the resource representing a Stripe dispute.
Add payment_intent filter for listing disputes
stripe_stripe-go
train
go
237c8f1c762b3a60e29959b08784dcc35b5dd4e9
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -42,7 +42,8 @@ var JSCSFilter = function(inputTree, _options) { if (this.enabled) { this.rules = config.load(this.configPath || '.jscsrc') || this.config || {}; - if (!(this.bypass = !Object.keys(this.rules).length)) { + this.bypass = Object.keys(this.rules).length === 0; + if (!this.bypass) { var checker = new jscs({ esnext: !!this.esnext }); checker.registerDefaultRules(); checker.configure(this.rules);
Simplify bypass assignment No need to be so cryptic here
kellyselden_broccoli-jscs
train
js
34c43896fa91a3b4d90632d380a0d985ba7f8744
diff --git a/lib/logger.js b/lib/logger.js index <HASH>..<HASH> 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -18,9 +18,9 @@ Logger.prototype = { log: function (msg, type) { if (this.backend == 'stdout') { if (!type) { - type = 'DEBUG: '; + type = 'DEBUG'; } - this.util.log(type + msg); + this.util.log(type + ": " + msg); } else { if (!type) { type = this.level
Tweak logging to add space and colon between type and msg
statsd_statsd
train
js
0e37e19707e42f1d313947eaad7b1f549fdee667
diff --git a/ext/psych/extconf.rb b/ext/psych/extconf.rb index <HASH>..<HASH> 100644 --- a/ext/psych/extconf.rb +++ b/ext/psych/extconf.rb @@ -41,6 +41,7 @@ if yaml_source Dir.mkdir(yaml) unless File.directory?(yaml) unless system(yaml_configure, "-q", "--enable-#{$enable_shared || !$static ? 'shared' : 'static'}", + "--host=#{RbConfig::CONFIG['host']}", *(["CFLAGS=-w"] if RbConfig::CONFIG["GCC"] == "yes"), chdir: yaml) raise "failed to configure libyaml"
Propagate the host configuration to libyaml
ruby_psych
train
rb
fba178ddbf3ef2706cb1ea1565412ec6ed08c82f
diff --git a/build/client.js b/build/client.js index <HASH>..<HASH> 100644 --- a/build/client.js +++ b/build/client.js @@ -2,6 +2,7 @@ // Dependencies var Fs = require("fs") , GitHubColors = require("github-colors") + , UglifyJS = require("uglify-js") ; const TEMPLATE = "(function (root) {\n" @@ -16,7 +17,7 @@ var ghPolyglot = Fs.readFileSync(__dirname + "/../lib/index.js", "utf-8") , lines = ghPolyglot.split("\n") , replace = { __GITHUB_POLYGLOT__: lines.slice(lines.indexOf("/**")).join("\n") - , __GITHUB_COLORS__: "{ get: " + GitHubColors.get.toString() + "\n" + , __GITHUB_COLORS__: "{ get: " + GitHubColors.get.toString() + ",\n" + "colors: " + JSON.stringify(GitHubColors.colors) + "}" } , client = TEMPLATE @@ -27,3 +28,4 @@ Object.keys(replace).forEach(function (c) { }); Fs.writeFileSync(__dirname + "/../dist/gh-polyglot.js", client); +Fs.writeFileSync(__dirname + "/../dist/gh-polyglot.min.js", UglifyJS.minify(client, { fromString: true }).code);
Syntax and uglify code
IonicaBizau_node-gh-polyglot
train
js
352a6f17e822dec8e6570e87840e716acd743437
diff --git a/tests/frontend/org/voltdb/regressionsuites/TestSaveRestoreSysprocSuite.java b/tests/frontend/org/voltdb/regressionsuites/TestSaveRestoreSysprocSuite.java index <HASH>..<HASH> 100644 --- a/tests/frontend/org/voltdb/regressionsuites/TestSaveRestoreSysprocSuite.java +++ b/tests/frontend/org/voltdb/regressionsuites/TestSaveRestoreSysprocSuite.java @@ -467,7 +467,7 @@ public class TestSaveRestoreSysprocSuite extends SaveRestoreBase { int num_replicated_items = 1000; int num_partitioned_items = 126; - LocalCluster lc = new LocalCluster( JAR_NAME, 2, 2, 0, BackendTarget.NATIVE_EE_JNI); + LocalCluster lc = new LocalCluster( JAR_NAME, 2, 3, 0, BackendTarget.NATIVE_EE_JNI); lc.setHasLocalServer(false); SaveRestoreTestProjectBuilder project = new SaveRestoreTestProjectBuilder(); @@ -488,7 +488,7 @@ public class TestSaveRestoreSysprocSuite extends SaveRestoreBase { saveTablesWithDefaultOptions(client); boolean skipFirst = true; - for (File f : lc.listFiles(new File("/tmp"))) { + for (File f : lc.listFiles(new File(TMPDIR))) { if (f.getName().startsWith(TESTNONCE + "-REPLICATED")) { if (skipFirst) { skipFirst = false;
For ENG-<I>, fix test case and modify to cover another type of restore bug
VoltDB_voltdb
train
java
b0a8dfa9bb24756c1dd0cc14369d9084fe920ad3
diff --git a/js/date-picker/js/lumx.date_picker_directive.js b/js/date-picker/js/lumx.date_picker_directive.js index <HASH>..<HASH> 100644 --- a/js/date-picker/js/lumx.date_picker_directive.js +++ b/js/date-picker/js/lumx.date_picker_directive.js @@ -32,12 +32,14 @@ angular.module('lumx.date-picker', []) this.updateModel = function(val) { - $scope.model = val; + if (angular.isDefined(val)) { + $scope.model = val; - $scope.selectedDate = { - date: moment($scope.model).locale(locale), - formatted: moment($scope.model).locale(locale).format('LL') - }; + $scope.selectedDate = { + date: moment($scope.model).locale(locale), + formatted: moment($scope.model).locale(locale).format('LL') + }; + } }; $scope.previousMonth = function() @@ -151,10 +153,7 @@ angular.module('lumx.date-picker', []) ctrl.init(element); scope.$watch('model', function (newVal) { - if (angular.isDefined(newVal)) - { - ctrl.updateModel(newVal); - } + ctrl.updateModel(newVal); }); } };
fix date-picker: move isDefined checking to controller
lumapps_lumX
train
js
1afa648cbc980a0832cb2261f4401dffe9b00fe8
diff --git a/bioutils/accessions.py b/bioutils/accessions.py index <HASH>..<HASH> 100644 --- a/bioutils/accessions.py +++ b/bioutils/accessions.py @@ -60,10 +60,6 @@ def chr22XY(c): 'chrX' >>> chr22XY("M") 'chrM' - >>> chr22XY("å") - 'chrå' - >>> chr22XY("β") - 'chrβ' """ c = str(c)
removed unicode chr<I>XY() doctests
biocommons_bioutils
train
py
658f71cf144b365bbcec295756aa2c41c215d4fd
diff --git a/src/ORM/EagerLoader.php b/src/ORM/EagerLoader.php index <HASH>..<HASH> 100644 --- a/src/ORM/EagerLoader.php +++ b/src/ORM/EagerLoader.php @@ -368,8 +368,8 @@ class EagerLoader { $contain = $meta['associations']; $alias = $meta['instance']->source()->alias(); - $isSelect = $meta['instance']->strategy() === $meta['instance']::STRATEGY_SELECT; - if ($isSelect && empty($collected[$alias])) { + $requiresKeys = $meta['instance']->requiresKeys($meta['config']); + if ($requiresKeys && empty($collected[$alias])) { continue; }
Using the API instead of re-implementing
cakephp_cakephp
train
php
84763b1257c82beb71b1063fd980698fe7f3b2ff
diff --git a/crispy_forms/utils.py b/crispy_forms/utils.py index <HASH>..<HASH> 100644 --- a/crispy_forms/utils.py +++ b/crispy_forms/utils.py @@ -81,7 +81,8 @@ def render_field(field, form, form_style, context, template=None, labelclass=Non # We save the Layout object's bound fields in the layout object's `bound_fields` list if layout_object is not None: layout_object.bound_fields.append(bound_field) - - html = template.render(Context({'field': bound_field, 'labelclass': labelclass})) + + context.update({'field': bound_field, 'labelclass': labelclass}) + html = template.render(context) return html
Passing full context to the field rendering Otherwise we don't have access to helper variables in the field rendering. We might want to add some helper variable that determines field rendering behavior.
django-crispy-forms_django-crispy-forms
train
py
82a77b7af4b605c7deac1eca6ce5b6e4f3a36077
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index <HASH>..<HASH> 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -8,7 +8,7 @@ describe User do @user.delete end it "should have a login" do - @user.login.should == "testuser" + @user.login.should == "jilluser" end describe "#groups" do
fixing user spec to use new login
samvera_hyrax
train
rb
f7fd1f310e2f41291bfc1d6427dff3971da23ab3
diff --git a/loader.js b/loader.js index <HASH>..<HASH> 100644 --- a/loader.js +++ b/loader.js @@ -48,13 +48,17 @@ module.exports = function(source, inputSourceMap) { if (sourceMapEnabled && inputSourceMap) { if (annotateResult.map) { var annotateMap = JSON.parse(annotateResult.map); - annotateMap.sources[0] = inputSourceMap.file; + //Sources array should be filled somehow to work with source-map package + annotateMap.sources[0] = filename; var generator = SourceMapGenerator.fromSourceMap(new SourceMapConsumer(annotateMap)); generator.applySourceMap(new SourceMapConsumer(inputSourceMap)); outputSourceMap = generator.toJSON(); outputSourceMap.sources = inputSourceMap.sources; + //Should be set to avoid '../../file is not in SourceMap error https://github.com/huston007/ng-annotate-loader/pull/11' + outputSourceMap.sourceRoot = ''; + //Copy file name from incoming file because it is empty by some unknown reaon outputSourceMap.file = inputSourceMap.file; } else { outputSourceMap = inputSourceMap;
#<I> fix some build-stopper issues after merge
huston007_ng-annotate-loader
train
js
21440c837471d39c07d48855810e3cd84cfba50f
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -22,8 +22,8 @@ function getLocale(locale) { if (!locale && ['LANG', 'LANGUAGE'].some(Object.hasOwnProperty, process.env)) { return (process.env.LANG || process.env.LANGUAGE || - Object.create(null)).replace(/[.:].*/, '') - .replace('_', '-') + String()).replace(/[.:].*/, '') + .replace('_', '-') } return locale
fix would-be TypeError phew. had this clause ever hit, it would have been a TypeError. you cant regex place on an Object.
moimikey_locale2
train
js
d7ef0224fcd17edee621abfe8ece8c37b6d5b8ba
diff --git a/plugins/Monolog/Formatter/LineMessageFormatter.php b/plugins/Monolog/Formatter/LineMessageFormatter.php index <HASH>..<HASH> 100644 --- a/plugins/Monolog/Formatter/LineMessageFormatter.php +++ b/plugins/Monolog/Formatter/LineMessageFormatter.php @@ -76,6 +76,9 @@ class LineMessageFormatter implements FormatterInterface { $strTrace = ''; for ($i = 0; $i < $numLevels; $i++) { + if (!isset($trace[$i])) { + continue; + } $level = $trace[$i]; if (isset($level['file'], $level['line'])) { $levelTrace = '#' . $i . (str_replace(PIWIK_DOCUMENT_ROOT, '', $level['file'])) . '(' . $level['line'] . ')';
Fix possible notice in lineMessageFormatter when trace has less than <I> records (#<I>)
matomo-org_matomo
train
php
3060c8b0f9d3186f379f9afea68a9aa4244bcc86
diff --git a/src/merchant/Collection.php b/src/merchant/Collection.php index <HASH>..<HASH> 100644 --- a/src/merchant/Collection.php +++ b/src/merchant/Collection.php @@ -12,6 +12,7 @@ namespace hipanel\modules\finance\merchant; use hipanel\modules\finance\models\Merchant; +use hiqdev\hiart\ErrorResponseException; use Yii; class Collection extends \hiqdev\yii2\merchant\Collection @@ -36,9 +37,20 @@ class Collection extends \hiqdev\yii2\merchant\Collection 'username' => Yii::$app->user->identity->username, ], (array) $params); - foreach (Merchant::perform('PrepareInfo', $params, true) as $name => $merchant) { + try { + $merchants = Merchant::perform('PrepareInfo', $params, true); + } catch (ErrorResponseException $e) { + if ($e->response === null) { + Yii::info('No available payment methods found', 'hipanel/finance'); + $merchants = []; + } else { + throw $e; + } + } + + foreach ($merchants as $name => $merchant) { if ($merchant['system'] === 'wmdirect') { - continue; // WebMoney Direct is not a merchant indeed + continue; // WebMoney Direct is not a merchant indeed. TODO: remove } $merchants[$name] = $this->convertMerchant($merchant); }
Collection::fetchMerchants() - added a check for a case, when no available payment methods found
hiqdev_hipanel-module-finance
train
php
1303a8812f1f35f76053c35494df357b20657756
diff --git a/bin/user-config.js b/bin/user-config.js index <HASH>..<HASH> 100644 --- a/bin/user-config.js +++ b/bin/user-config.js @@ -10,7 +10,7 @@ function getConfig() { } return config; } catch (err) { - console.error('No configuration file provided, using defaults.', err); + console.warn('No configuration file found, using defaults.'); return {}; } }
do not report error in case of no config provided
bdefore_universal-redux
train
js
b79e31e5a52b73b445ee27c5272a0ad213f26ae8
diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js index <HASH>..<HASH> 100644 --- a/lib/handlebars/compiler/javascript-compiler.js +++ b/lib/handlebars/compiler/javascript-compiler.js @@ -1,4 +1,4 @@ -import { COMPILER_REVISION, REVISION_CHANGES, log } from "../base"; +import { COMPILER_REVISION, REVISION_CHANGES } from "../base"; import Exception from "../exception"; function Literal(value) { @@ -62,8 +62,6 @@ JavaScriptCompiler.prototype = { this.trackIds = this.options.trackIds; this.precompile = !asObject; - log('debug', this.environment.disassemble() + "\n\n"); - this.name = this.environment.name; this.isChild = !!context; this.context = context || {
Remove disassemble log statement Fixes #<I>
wycats_handlebars.js
train
js
a73adccc4d0519a6ba19c4cde0305ff681ad3e09
diff --git a/cumulusci/core/tasks.py b/cumulusci/core/tasks.py index <HASH>..<HASH> 100644 --- a/cumulusci/core/tasks.py +++ b/cumulusci/core/tasks.py @@ -151,7 +151,7 @@ class BaseTask(object): tags = {"task class": self.__class__.__name__} if self.org_config: tags["org username"] = self.org_config.username - tags["scratch org"] = self.org_config.scratch == True + tags["scratch org"] = self.org_config.scratch is True for key, value in list(self.options.items()): tags["option_" + key] = value self.project_config.sentry.tags_context(tags)
Make flake8 happy with cci.py
SFDO-Tooling_CumulusCI
train
py
303de520cef5a46d61a7a8646e9d83aa079af20a
diff --git a/mac.js b/mac.js index <HASH>..<HASH> 100644 --- a/mac.js +++ b/mac.js @@ -95,7 +95,8 @@ module.exports = { }) } - series(operations, function () { + series(operations, function (err) { + if (err) return callback(err) common.moveApp(opts, tempPath, callback) }) }) diff --git a/win32.js b/win32.js index <HASH>..<HASH> 100644 --- a/win32.js +++ b/win32.js @@ -32,7 +32,8 @@ module.exports = { }) } - series(operations, function () { + series(operations, function (err) { + if (err) return callback(err) common.moveApp(opts, tempPath, callback) }) })
Restore error reporting for darwin and win<I> targets
electron-userland_electron-packager
train
js,js
ca2986694c6479cd9902c4805400226f03237289
diff --git a/command/auth.go b/command/auth.go index <HASH>..<HASH> 100644 --- a/command/auth.go +++ b/command/auth.go @@ -87,6 +87,9 @@ func (c *AuthCommand) Run(args []string) int { return 1 } + c.Ui.Output(fmt.Sprintf( + "Successfully authenticated!")) + return 0 } diff --git a/command/meta.go b/command/meta.go index <HASH>..<HASH> 100644 --- a/command/meta.go +++ b/command/meta.go @@ -77,7 +77,26 @@ func (m *Meta) Client() (*api.Client, error) { config.HttpClient = &client } - return api.NewClient(config) + // Build the client + client, err := api.NewClient(config) + if err != nil { + return nil, err + } + + // If we have a token, then set that + tokenHelper, err := m.TokenHelper() + if err != nil { + return nil, err + } + token, err := tokenHelper.Get() + if err != nil { + return nil, err + } + if token != "" { + client.SetToken(token) + } + + return client, nil } // Config loads the configuration and returns it. If the configuration
command/meta: add token to client if we have it
hashicorp_vault
train
go,go
b58d98a6f5d824747cee0ee1fd724bff90b35b0c
diff --git a/src/Resize-Handler.js b/src/Resize-Handler.js index <HASH>..<HASH> 100644 --- a/src/Resize-Handler.js +++ b/src/Resize-Handler.js @@ -1,17 +1,17 @@ class ResizeHandler { constructor() { this._queue = [] - this.update = this.update.bind(this) + this._isTicking = false this.create() } create() { - window.addEventListener('resize', this.update) + window.addEventListener('resize', this._resizeHandler) } destroy() { this._queue = [] - window.removeEventListener('resize', this.update) + window.removeEventListener('resize', this._resizeHandler) } add(component) { @@ -25,10 +25,18 @@ class ResizeHandler { } } - update() { + _resizeHandler = () => { + if(!this.isTicking) { + window.requestAnimationFrame(this.update) + } + this.isTicking = true + } + + update = () => { for (let i = this._queue.length; i--;) { this._queue[i].position() } + this.isTicking = false } }
added requestAnimationFrame to resize handler
souporserious_react-drop
train
js
7bfe5565aa545600ef623166e4b3c2dacfc4d68c
diff --git a/lib/mongoid/multi_parameter_attributes.rb b/lib/mongoid/multi_parameter_attributes.rb index <HASH>..<HASH> 100644 --- a/lib/mongoid/multi_parameter_attributes.rb +++ b/lib/mongoid/multi_parameter_attributes.rb @@ -52,6 +52,7 @@ module Mongoid if attrs errors = [] attributes = attrs.class.new + attributes.permitted = true if attrs.respond_to?(:permitted?) && attrs.permitted? multi_parameter_attributes = {} attrs.each_pair do |key, value|
inherited attrs permit status
mongodb_mongoid
train
rb
17c5befd8202e16df21a4691f66fe30c8bf6227f
diff --git a/polls/models.py b/polls/models.py index <HASH>..<HASH> 100644 --- a/polls/models.py +++ b/polls/models.py @@ -4,6 +4,12 @@ from django.db import models class Poll(models.Model): question = models.CharField(max_length=255) + def __unicode__(self): + return self.question + class Choice(models.Model): poll = models.ForeignKey(Poll) choice = models.CharField(max_length=255) + + def __unicode__(self): + return self.choice
add unicode function to poll and choice models
byteweaver_django-polls
train
py
b1701b09bdd95b07cd11fea77d54117383bb4397
diff --git a/createWebpackConfig.js b/createWebpackConfig.js index <HASH>..<HASH> 100644 --- a/createWebpackConfig.js +++ b/createWebpackConfig.js @@ -29,11 +29,24 @@ module.exports = function createWebpackConfig(_options) { config.output.filename = options.filename; if (options.minify) { - config.plugins.push(new webpack.optimize.UglifyJsPlugin({ - compressor: { - screw_ie8: true, - }, - })); + config.plugins.push( + new webpack.optimize.UglifyJsPlugin({ + compressor: { + screw_ie8: true, + warnings: false, + }, + }) + ); + } + + if (options.env) { + config.plugins.push( + new webpack.DefinePlugin({ + 'process.env': { + NODE_ENV: JSON.stringify(options.env), + }, + }) + ); } return config; diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -76,6 +76,7 @@ gulp.task('webpack:standalone:min', function() { var config = createWebpackConfig({ filename: 'updeep-standalone.min.js', minify: true, + env: 'production', }); return gulp.src('lib/index.js')
Build the minified version in production mode This is probably not the way to do this, I may want to just have multiple versions, dev+production * full+min
substantial_updeep
train
js,js
a1be6bfb503bbfbf51748ebc86c9c5cbba9a4a69
diff --git a/thermo/utils/t_dependent_property.py b/thermo/utils/t_dependent_property.py index <HASH>..<HASH> 100644 --- a/thermo/utils/t_dependent_property.py +++ b/thermo/utils/t_dependent_property.py @@ -1706,7 +1706,8 @@ class TDependentProperty(object): @method.setter def method(self, method): if method not in self.all_methods and method != POLY_FIT and method is not None: - raise ValueError("The given method is not available for this chemical") + raise ValueError("Method '%s' is not available for this chemical; " + "available methods are %s" %(method, self.all_methods)) self.T_cached = None self._method = method
a few more details in method setter error
CalebBell_thermo
train
py
4fe1980e1a13df9543327d2894feac266aa7acec
diff --git a/lib/drizzlepac/tweakreg.py b/lib/drizzlepac/tweakreg.py index <HASH>..<HASH> 100644 --- a/lib/drizzlepac/tweakreg.py +++ b/lib/drizzlepac/tweakreg.py @@ -12,8 +12,8 @@ import util # of the modules below, so that those modules can use the values # from these variable definitions, allowing the values to be designated # in one location only. -__version__ = '1.1.0' -__vdate__ = '10-Dec-2012' +__version__ = '1.1.1' +__vdate__ = '14-Dec-2012' import tweakutils import imgclasses
This update corrects memory problems in the C extension function for building the 2D histogram matrix. (File with new version id checked in now.) git-svn-id: <URL>
spacetelescope_drizzlepac
train
py
4496e03bcdad28c89e76fdd11d1d36f07f6fff31
diff --git a/Trustly/Api/signed.php b/Trustly/Api/signed.php index <HASH>..<HASH> 100644 --- a/Trustly/Api/signed.php +++ b/Trustly/Api/signed.php @@ -1201,6 +1201,28 @@ class Trustly_Api_Signed extends Trustly_Api { } /** + * Call the getWithdrawals API Method. + * + * Get a list of withdrawals from an executed order. + * + * @see https://trustly.com/en/developer/api#/getwithdrawals + * + * @param integer $orderid The OrderID of the order to query + * + * @return Trustly_Data_JSONRPCSignedResponse + */ + public function getWithdrawals($orderid) { + + $data = array( + 'OrderID' => $orderid, + ); + + $request = new Trustly_Data_JSONRPCRequest('getWithdrawals', $data); + return $this->call($request); + } + + + /** * Basic communication test to the API. * * @return Trustly_Data_JSONRPCResponse Response from the API
Add the getwithdrawals() signed api call for GetWithdrawals.
trustly_trustly-client-php
train
php
f1f88e255620569f40d237ccdb4c0e5786f06c0e
diff --git a/activesupport/lib/active_support/lazy_load_hooks.rb b/activesupport/lib/active_support/lazy_load_hooks.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/lazy_load_hooks.rb +++ b/activesupport/lib/active_support/lazy_load_hooks.rb @@ -68,7 +68,7 @@ module ActiveSupport if options[:yield] block.call(base) else - if base.is_a?(Class) || base.is_a?(Module) + if base.is_a?(Module) base.class_eval(&block) else base.instance_eval(&block)
A Class is a Module so we remove one conditional
rails_rails
train
rb
b5d1ce76601c98c0f3228da937e90492e62ecfac
diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index <HASH>..<HASH> 100755 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -30,13 +30,13 @@ class Configuration implements ConfigurationInterface $rootNode ->children() - ->arrayNode('directories') + ->arrayNode('bundle') ->children() - ->scalarNode('root')->end() - ->scalarNode('schema')->end() - ->scalarNode('data')->end() + ->scalarNode('schema_dir')->end() + ->scalarNode('data_dir')->end() ->end() ->end() + ->scalarNode('generate_dir')->end() ->end(); return $treeBuilder;
CampaignChain/campaignchain-custom#7 Refactor Update scripts
CampaignChain_update
train
php
f1e7405836be9518c48924871fc02a5c99962a3a
diff --git a/lib/codemirror.js b/lib/codemirror.js index <HASH>..<HASH> 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -1226,7 +1226,7 @@ var CodeMirror = (function() { var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)]; if (!match) return; var ch = match.charAt(0), forward = match.charAt(1) == ">", d = forward ? 1 : -1, st = line.styles; - for (var off = forward ? pos + 1 : pos, i = 0, e = st.length; i < st; i+=2) + for (var off = forward ? pos + 1 : pos, i = 0, e = st.length; i < e; i+=2) if ((off -= st[i].length) <= 0) {var style = st[i+1]; break;} var stack = [line.text.charAt(pos)], re = /[(){}[\]]/;
small fix in matchBrackets
codemirror_CodeMirror
train
js
d966ece6f65eea31c412415606672b6ec50d8038
diff --git a/executor.go b/executor.go index <HASH>..<HASH> 100644 --- a/executor.go +++ b/executor.go @@ -547,7 +547,7 @@ func resolveField(eCtx *ExecutionContext, parentType *Object, source interface{} returnType = fieldDef.Type resolveFn := fieldDef.Resolve if resolveFn == nil { - resolveFn = defaultResolveFn + resolveFn = DefaultResolveFn } // Build a map of arguments from the field.arguments AST, using the @@ -824,7 +824,7 @@ func defaultResolveTypeFn(p ResolveTypeParams, abstractType Abstract) *Object { // which takes the property of the source object of the same name as the field // and returns it as the result, or if it's a function, returns the result // of calling that function. -func defaultResolveFn(p ResolveParams) (interface{}, error) { +func DefaultResolveFn(p ResolveParams) (interface{}, error) { // try to resolve p.Source as a struct first sourceVal := reflect.ValueOf(p.Source) if sourceVal.IsValid() && sourceVal.Type().Kind() == reflect.Ptr {
Expose DefaultResolveFn to make it wrappable outside the library.
graphql-go_graphql
train
go
df2894e3744da9e64010c62c1f9de76838307918
diff --git a/test/test_func.py b/test/test_func.py index <HASH>..<HASH> 100644 --- a/test/test_func.py +++ b/test/test_func.py @@ -1,14 +1,10 @@ import os import unittest -from django.conf import settings from logilab.common import testlib from pylint.testutils import make_tests, LintTestUsingModule, LintTestUsingFile, cb_test_gen, linter -settings.configure(SECRET_KEY='pylint-django-test', DEBUG=True) - - HERE = os.path.dirname(os.path.abspath(__file__))
Removing the spurious django settings configuration. It was added to attempt to get astroid to correctly infer and resolve the name "models" but did not in fact help
PyCQA_pylint-django
train
py
c55dec8b4c504b2411e1b5f375386fe03ac1f143
diff --git a/src/pybel/canonicalize.py b/src/pybel/canonicalize.py index <HASH>..<HASH> 100644 --- a/src/pybel/canonicalize.py +++ b/src/pybel/canonicalize.py @@ -246,7 +246,7 @@ def to_bel_lines(graph): # sort by citation, then supporting text qualified_edges_iter = filter_provenance_edges(graph) - qualified_edges = sorted(qualified_edges_iter, key=hash_edge) + qualified_edges = sorted(qualified_edges_iter, key=lambda edge: hash_edge(*edge)) for citation, citation_edges in itt.groupby(qualified_edges, key=lambda t: flatten_citation(t[3][CITATION])): yield 'SET Citation = {{{}}}'.format(citation)
Fix tuple unpacking
pybel_pybel
train
py
ec5b20c6547e30fec6210b26eb3991d676e21b94
diff --git a/scss/tool.py b/scss/tool.py index <HASH>..<HASH> 100644 --- a/scss/tool.py +++ b/scss/tool.py @@ -17,7 +17,7 @@ def complete(text, state): else: state -= 1 -def main(): +def main(argv=None): try: import atexit @@ -67,7 +67,7 @@ The location of the generated CSS can be set using a colon: '-W', '--no-warnings', action='store_false', dest='warn', help="Disable warnings.") - opts, args = p.parse_args() + opts, args = p.parse_args(argv or sys.argv[1:]) precache = opts.cache if opts.shell:
added argv param to main command function for passing args optionally
klen_python-scss
train
py
1fc35b215cdc1587476fbbcebab2308ef95b65ce
diff --git a/write.go b/write.go index <HASH>..<HASH> 100644 --- a/write.go +++ b/write.go @@ -85,9 +85,12 @@ func (n *Narcissus) writeMapField(field reflect.Value, fieldType reflect.StructF if value.Kind() == reflect.Struct { err := n.writeSimpleField(k, p, fieldType.Tag) if err != nil { - return fmt.Errorf("failed to write map value: %v", err) + return fmt.Errorf("failed to write map key: %v", err) + } + err = n.writeStruct(value, p) + if err != nil { + return fmt.Errorf("failed to write map struct value: %v", err) } - n.writeStruct(value, p) } else { err := n.writeSimpleField(value, p, fieldType.Tag) if err != nil {
Check errors when writing map structs
raphink_narcissus
train
go
818d3512ae26f7137b629303b83f8312e3334c97
diff --git a/system/modules/generalDriver/DcGeneral/Data/ModelInterface.php b/system/modules/generalDriver/DcGeneral/Data/ModelInterface.php index <HASH>..<HASH> 100644 --- a/system/modules/generalDriver/DcGeneral/Data/ModelInterface.php +++ b/system/modules/generalDriver/DcGeneral/Data/ModelInterface.php @@ -14,6 +14,13 @@ namespace DcGeneral\Data; use DcGeneral\Exception\DcGeneralInvalidArgumentException; +/** + * Interface ModelInterface. + * + * This interface describes a model used in data providers. + * + * @package DcGeneral\Data + */ interface ModelInterface extends \IteratorAggregate { /** @@ -73,9 +80,9 @@ interface ModelInterface extends \IteratorAggregate /** * Update the property value in the model. * - * @param string $strPropertyName + * @param string $strPropertyName The property name to be set. * - * @param mixed $varValue + * @param mixed $varValue The value to be set. * * @return void */ @@ -126,7 +133,7 @@ interface ModelInterface extends \IteratorAggregate * * @return ModelInterface * - * @throws DcGeneralInvalidArgumentException + * @throws DcGeneralInvalidArgumentException When a property in the value bag has been marked as invalid. */ public function readFromPropertyValueBag(PropertyValueBagInterface $valueBag);
phpDoc in ModelInterface.
contao-community-alliance_dc-general
train
php
7b251b2ea7faca8fe626ace46abe7fea1f8811d3
diff --git a/lib/mk_time/consts.rb b/lib/mk_time/consts.rb index <HASH>..<HASH> 100644 --- a/lib/mk_time/consts.rb +++ b/lib/mk_time/consts.rb @@ -39,6 +39,7 @@ module MkTime ["20120701", -35], ["20150701", -36], ["20170101", -37], + ["20190101", 0] # (<= Provisional end-point) ].freeze # Leap Second's adjustment DUT1S = [ ["19880317", 0.2], @@ -179,6 +180,7 @@ module MkTime ["20170330", 0.4], ["20170629", 0.3], ["20171130", 0.2], + ["20180228", 0.0] # (<= Provisional end-point) ].freeze # DUT1 adjustment end end
UPD: Changed a treaty of newest data.
komasaru_mk_time
train
rb
6463baa6d697059b4232b6321f6adf1c6d0a7b77
diff --git a/Model/FilePayload.php b/Model/FilePayload.php index <HASH>..<HASH> 100644 --- a/Model/FilePayload.php +++ b/Model/FilePayload.php @@ -788,7 +788,7 @@ class FilePayload 'value' => (int) $this->contactClient->getId(), ]; $filter['force'][] = [ - 'column' => 'f.file', + 'column' => 'q.file', 'expr' => 'eq', 'value' => (int) $this->file->getId(), ];
Correct alias in queue filter.
TheDMSGroup_mautic-contact-client
train
php
d28535b3dc90812acc46703f1a9b05bfe70e8686
diff --git a/lib/chef/knife/community_release.rb b/lib/chef/knife/community_release.rb index <HASH>..<HASH> 100644 --- a/lib/chef/knife/community_release.rb +++ b/lib/chef/knife/community_release.rb @@ -40,6 +40,12 @@ module KnifeCommunity :boolean => true, :description => "Odd-numbered development cycle. Bump minor version & commit for development" + option :git_push, + :long => "--[no-]git-push", + :boolean => true, + :default => true, + :description => "Indicates whether the commits and tags should be pushed to pushed to the default git remote." + option :site_share, :long => "--[no-]site-share", :boolean => true, @@ -65,8 +71,11 @@ module KnifeCommunity set_new_cb_version commit_new_cb_version tag_new_cb_version - git_push_commits - git_push_tags + + if config[:git_push] + git_push_commits + git_push_tags + end if config[:site_share] share_new_version
Make pushing to git remote optional (push will still happen by default) You may want to delay pushing release commit/tag to configure remote.
miketheman_knife-community
train
rb
a3d42800486a5ad74e0b603391ce71c0e16456d1
diff --git a/register.go b/register.go index <HASH>..<HASH> 100644 --- a/register.go +++ b/register.go @@ -60,4 +60,27 @@ type TestFunction struct { // This is the most general registration mechanism. Most users will want // RegisterTestSuite, which is a wrapper around this function that requires // less boilerplate. -func Register(suite *TestSuite) +// +// Panics on invalid input. +func Register(suite TestSuite) { + // Make sure the suite is legal. + if suite.Name == "" { + panic("Test suites must have names.") + } + + for _, tf := range suite.TestFunctions { + if tf.Name == "" { + panic("Test functions must have names.") + } + + if tf.Run == nil { + panic("Test functions must have non-nil run fields.") + } + } + + // Save the suite for later. + registeredSuites = append(registeredSuites, suite) +} + +// The list of test suites previously registered. +var registeredSuites []TestSuite
Implemented Register. The registered suites are currently ignored.
jacobsa_ogletest
train
go
3ed4da0b3f3ab045d2dbbbc2ec9ae7ba05b9343b
diff --git a/classes/controller/cms/assets.php b/classes/controller/cms/assets.php index <HASH>..<HASH> 100755 --- a/classes/controller/cms/assets.php +++ b/classes/controller/cms/assets.php @@ -11,6 +11,30 @@ class Controller_Cms_Assets extends Controller_Cms { /** + * Show assets by tag + * + * @todo Use the tag MPTT tree to find assets which are tagged with child tags of the supplied tag. + */ + public function by_tag() + { + $tag_id = $this->request->param( 'id' ); + $tag = ORM::factory( 'tag', $tag_id ); + + // Check that the tag exists. + if ($tag->loaded()) + { + $assets = ORM::factory( 'asset' ) + ->join( 'tagged_object', 'inner' ) + ->on( 'tag_id', '=', $tag->id ) + ->where( 'object_type', '=', Model_Tagged_Object::OBJECT_TYPE_ASSET ) + ->find_all(); + + // Output the data. + // Need to find out which format this needs to be done in. + } + } + + /** * Delete controller * Allows deleting multiple assets *
Added cms assets controller method to find assets which have had a tag applied to them
boomcms_boom-core
train
php
83d2d0f7ca27d0bc9ac109f388307221401399c9
diff --git a/lib/request.js b/lib/request.js index <HASH>..<HASH> 100644 --- a/lib/request.js +++ b/lib/request.js @@ -63,7 +63,7 @@ function request(session, action, options, callback) { jar: cookiejar, // Preserve Cookies rejectUnauthorized: false // Ignore invalid (expired, self-signed) certificates // requestCert: true, // Let's go with default; this seems to cause failures - }).get(url, options) + }).get(url, options, function(){}) .on('response', function(res){ debug('cookies', cookiejar.getCookies(url));
Adding hoop function to request so response body is captured.
retsr_rets.js
train
js
5bd793cd25fc6e22f52645e1d0562b0098c17c4f
diff --git a/lib/page-object.rb b/lib/page-object.rb index <HASH>..<HASH> 100644 --- a/lib/page-object.rb +++ b/lib/page-object.rb @@ -3,6 +3,7 @@ require 'page-object/accessors' require 'page-object/platforms' require 'page-object/element_locators' require 'page-object/nested_elements' +require 'page-object/page_factory' require 'page-object/page_populator' require 'page-object/javascript_framework_facade' require 'page-object/indexed_properties'
Ensure gem loads the PageFactory module. Since the page-object.rb base file wasn't loading the PageFactory module, attempting to include PageObject::PageFactory would throw an error.
cheezy_page-object
train
rb
0357c36fffc7243dd87a0f257903a79215a4f252
diff --git a/rest_framework_jwt/views.py b/rest_framework_jwt/views.py index <HASH>..<HASH> 100644 --- a/rest_framework_jwt/views.py +++ b/rest_framework_jwt/views.py @@ -1,7 +1,5 @@ from rest_framework.views import APIView from rest_framework import status -from rest_framework import parsers -from rest_framework import renderers from rest_framework.response import Response from rest_framework_jwt.settings import api_settings @@ -21,8 +19,6 @@ class JSONWebTokenAPIView(APIView): throttle_classes = () permission_classes = () authentication_classes = () - parser_classes = (parsers.FormParser, parsers.JSONParser,) - renderer_classes = (renderers.JSONRenderer,) def get_serializer_context(self): """
Removed parser_classes and renderer_classes from JSONWebTokenAPIView
GetBlimp_django-rest-framework-jwt
train
py
7fe6e45fdd44b58825aeea31bec752046abfdb74
diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index <HASH>..<HASH> 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -2294,7 +2294,7 @@ func (kl *Kubelet) syncLoopIteration(configCh <-chan kubetypes.PodUpdate, handle glog.V(2).Infof("SyncLoop (ADD, %q): %q", u.Source, format.Pods(u.Pods)) // After restarting, kubelet will get all existing pods through // ADD as if they are new pods. These pods will then go through the - // admission process and *may* be rejcted. This can be resolved + // admission process and *may* be rejected. This can be resolved // once we have checkpointing. handler.HandlePodAdditions(u.Pods) case kubetypes.UPDATE:
Fix typo: rejcted -> rejected
kubernetes_kubernetes
train
go
73f019d1bea85649721faf166ab822fa22169f47
diff --git a/keyring.go b/keyring.go index <HASH>..<HASH> 100644 --- a/keyring.go +++ b/keyring.go @@ -58,6 +58,17 @@ func NewKeyring(keys [][]byte, primaryKey []byte) (*Keyring, error) { return keyring, nil } +// ValidateKey will check to see if the key is valid and returns an error if not. +// +// key should be either 16, 24, or 32 bytes to select AES-128, +// AES-192, or AES-256. +func ValidateKey(key []byte) error { + if l := len(key); l != 16 && l != 24 && l != 32 { + return fmt.Errorf("key size must be 16, 24 or 32 bytes") + } + return nil +} + // AddKey will install a new key on the ring. Adding a key to the ring will make // it available for use in decryption. If the key already exists on the ring, // this function will just return noop. @@ -65,8 +76,8 @@ func NewKeyring(keys [][]byte, primaryKey []byte) (*Keyring, error) { // key should be either 16, 24, or 32 bytes to select AES-128, // AES-192, or AES-256. func (k *Keyring) AddKey(key []byte) error { - if l := len(key); l != 16 && l != 24 && l != 32 { - return fmt.Errorf("key size must be 16, 24 or 32 bytes") + if err := ValidateKey(key); err != nil { + return err } // No-op if key is already installed
Expose a method to validate a gossip encryption key before use.
hashicorp_memberlist
train
go
221a6c054df862afb6c5a16b09eee6b4f144a274
diff --git a/packages/building-webpack/modern-and-legacy-config.js b/packages/building-webpack/modern-and-legacy-config.js index <HASH>..<HASH> 100644 --- a/packages/building-webpack/modern-and-legacy-config.js +++ b/packages/building-webpack/modern-and-legacy-config.js @@ -126,7 +126,7 @@ function createConfig(options, legacy) { new WebpackIndexHTMLPlugin( merge( { - multiBuild: production, + multiBuild: true, legacy, polyfills: { coreJs: true,
fix(building-webpack): always multi-build in dev mode (#<I>)
open-wc_open-wc
train
js
1f8ec96cfdd9201f4f3c586a09ec60f5348bb14d
diff --git a/tests/adapter/mongo/test_event_handling.py b/tests/adapter/mongo/test_event_handling.py index <HASH>..<HASH> 100644 --- a/tests/adapter/mongo/test_event_handling.py +++ b/tests/adapter/mongo/test_event_handling.py @@ -584,6 +584,32 @@ def test_remove_hpo(hpo_database, institute_obj, case_obj, user_obj): # THEN an event should have been created assert adapter.event_collection.find().count() == 2 +def test_comment(real_variant_database, institute_obj, case_obj, user_obj): + adapter = real_variant_database + content = 'specific comment for a variant' + # GIVEN a populated database with variants + assert adapter.variant_collection.find().count() > 0 + + # And an empty event database collection + assert adapter.event_collection.find().count() == 0 + + # Get a random variant from variants collection + variant = adapter.variant_collection.find_one() + + # WHEN commenting on a variant + updated_variant = adapter.comment( + institute=institute_obj, + case=case_obj, + user=user_obj, + link='commentlink', + variant=variant, + content=content, + comment_level='specific' + ) + # THEN the variant should have comments + event = adapter.event_collection.find_one() + assert event['content'] == content + def test_comment_level_events(populated_database, institute_obj, case_obj, user_obj): adapter = populated_database
reintroduced a comment event test I wrongly removed
Clinical-Genomics_scout
train
py
c060ee893f361a62e22da48b9c0ec3eac050f730
diff --git a/hazelcast/src/main/java/com/hazelcast/nio/tcp/TcpIpConnectionManager.java b/hazelcast/src/main/java/com/hazelcast/nio/tcp/TcpIpConnectionManager.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/nio/tcp/TcpIpConnectionManager.java +++ b/hazelcast/src/main/java/com/hazelcast/nio/tcp/TcpIpConnectionManager.java @@ -184,11 +184,13 @@ public class TcpIpConnectionManager implements ConnectionManager { } // just for testing + @edu.umd.cs.findbugs.annotations.SuppressWarnings({"EI_EXPOSE_REP" }) public InSelectorImpl[] getInSelectors() { return inSelectors; } // just for testing + @edu.umd.cs.findbugs.annotations.SuppressWarnings({"EI_EXPOSE_REP" }) public OutSelectorImpl[] getOutSelectors() { return outSelectors; }
Resolved findbugs issue TcpIpConnectionManager (exposing array is supressed)
hazelcast_hazelcast
train
java
8154ba71c0071c89f25a42e19becc18579073779
diff --git a/src/hamster/utils/i18n.py b/src/hamster/utils/i18n.py index <HASH>..<HASH> 100644 --- a/src/hamster/utils/i18n.py +++ b/src/hamster/utils/i18n.py @@ -6,7 +6,7 @@ import locale, gettext def setup_i18n(): #determine location of po files try: - import defs + from .. import defs except: defs = None
defs have moved one level up (or rather we have moved one level depeer) - doing relative import
projecthamster_hamster
train
py
d9ca37c0de9b14ba8a5254983cb96dfaed5d2881
diff --git a/examples/basic_get_options.py b/examples/basic_get_options.py index <HASH>..<HASH> 100644 --- a/examples/basic_get_options.py +++ b/examples/basic_get_options.py @@ -1 +1,5 @@ from webpype.client import WebPypeClient + +if __name__ == '__main__': + webpipe = WebPypeClient() + webpipe.print_options("http://status-code-retriever.herokuapp.com")
Added code for basic_get_options.py
ajvb_webpype
train
py
0246a69729418ec915fd3f571113033ba801cb56
diff --git a/rt.py b/rt.py index <HASH>..<HASH> 100644 --- a/rt.py +++ b/rt.py @@ -104,6 +104,13 @@ class ActorOwnManualLoop(AbstractActor): return eventloop.individual_loop_step(self.queue, self) -#Actor = ActorOwnLoop +class Wait(ActorOwnManualLoop): + + @initial_behavior + def wait_beh(self, message): + return message + + +Actor = ActorOwnLoop #Actor = ActorGlobalLoop -Actor = ActorManualLoop \ No newline at end of file +#Actor = ActorManualLoop \ No newline at end of file
Add simple actor for synchronization Sync with main thread by replying to the Wait actor and then making it 'act'.
waltermoreira_tartpy
train
py
db9adef945b1cbd50549b5d08b09f4ff11b8c0ef
diff --git a/script/jekyllmarkdowngen.py b/script/jekyllmarkdowngen.py index <HASH>..<HASH> 100644 --- a/script/jekyllmarkdowngen.py +++ b/script/jekyllmarkdowngen.py @@ -481,7 +481,7 @@ class JekyllMarkdownGenerator(MarkdownGenerator): ref = type_curie.split('/')[-1] type_uri = f"https://biolink.github.io/biolinkml/docs/types/{ref}" type_curie = f"metatype:{ref}" - if type_uri.startswith('https://w3id.org/biolink/vocab/'): + elif type_uri.startswith('https://w3id.org/biolink/vocab/'): ref = type_curie.split('/')[-1] type_uri = f"https://w3id.org/biolink/vocab/types/{ref}" if typ.imported_from and 'biolinkml:types' in typ.imported_from:
code review fix - change to elif
biolink_biolink-model
train
py
efd87248d257998736f30a8d9118f5b0452c05c3
diff --git a/suds/transport/https.py b/suds/transport/https.py index <HASH>..<HASH> 100644 --- a/suds/transport/https.py +++ b/suds/transport/https.py @@ -91,9 +91,9 @@ class WindowsHttpAuthenticated(HttpAuthenticated): def u2handlers(self): # try to import ntlm support try: - from ntlm import HTTPNtlmAuthHandler + from ntlm3 import HTTPNtlmAuthHandler except ImportError: - raise Exception("Cannot import python-ntlm module") + raise Exception("Cannot import python-ntlm3 module") handlers = HttpTransport.u2handlers(self) handlers.append(HTTPNtlmAuthHandler.HTTPNtlmAuthHandler(self.pm)) return handlers
Added NTLM compatibility for Python 3 Changed the ntlm package to the ntlm3 package which is python3 compatible
cackharot_suds-py3
train
py