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
52c2a5731f308ebe6998792a4c7785c8e2f37412
diff --git a/etcdserver/metrics.go b/etcdserver/metrics.go index <HASH>..<HASH> 100644 --- a/etcdserver/metrics.go +++ b/etcdserver/metrics.go @@ -47,7 +47,7 @@ var ( fileDescriptorUsed = prometheus.NewGauge(prometheus.GaugeOpts{ Namespace: "etcd", Subsystem: "server", - Name: "file_descriptors_used_totol", + Name: "file_descriptors_used_total", Help: "The total number of file descriptors used.", }) )
etcdserver: fix typo in metrics.go
etcd-io_etcd
train
go
9757107c4dd4c9f14a4ae2e2a83759e453f02f93
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -1,4 +1,5 @@ /* global it, beforeEach, afterEach */ +'use strict' const assert = require('assert') const fs = require('fs') @@ -67,8 +68,8 @@ function processCss (outputTree) { let content = fs.readFileSync(path.join(builder.outputPath, 'output.css'), 'utf8') let sourceMap = JSON.parse(fs.readFileSync(path.join(builder.outputPath, 'output.css.map'), 'utf8')) - assert.strictEqual(content.trim(), 'body {\n color: rgb(102, 51, 153)\n}') - assert.strictEqual(sourceMap.mappings, 'AAAA;EACE,wBAAoB;CACrB') + assert.strictEqual(content.trim(), 'body {\n color: #639\n}') + assert.strictEqual(sourceMap.mappings, 'AAAA;EACE,WAAoB;CACrB') assert.deepEqual(warnings, []) }) }
update tests with new css for rebeccapurple
jeffjewiss_broccoli-postcss-single
train
js
89977985d8d30c7daf0377fcd997795ed63b7680
diff --git a/src/stream/filter.js b/src/stream/filter.js index <HASH>..<HASH> 100644 --- a/src/stream/filter.js +++ b/src/stream/filter.js @@ -20,7 +20,7 @@ var * Filter stream * * @param {Function} filter filter function - * @constructor gpf.stream.BufferedRead + * @constructor gpf.stream.Filter * @implements {gpf.interfaces.IReadableStream} * @implements {gpf.interfaces.IWritableStream} * @implements {gpf.interfaces.IFlushableStream}
Documentation (#<I>)
ArnaudBuchholz_gpf-js
train
js
ffe1601bcb6ae6809ed1174c33107cf148cc50c7
diff --git a/src/main/python/rlbot/utils/game_state_util.py b/src/main/python/rlbot/utils/game_state_util.py index <HASH>..<HASH> 100644 --- a/src/main/python/rlbot/utils/game_state_util.py +++ b/src/main/python/rlbot/utils/game_state_util.py @@ -151,7 +151,7 @@ class GameState: self.boosts = boosts def convert_to_flat(self, builder=None): - if self.ball is None and self.cars is None: + if self.ball is None and self.cars is None and self.boosts is None: return None if builder is None:
new DLL and fixed state not sending at some times
RLBot_RLBot
train
py
10d8bacc375da416c9c701035114ad94000b8836
diff --git a/src/main/java/org/primefaces/extensions/component/waypoint/WaypointRenderer.java b/src/main/java/org/primefaces/extensions/component/waypoint/WaypointRenderer.java index <HASH>..<HASH> 100755 --- a/src/main/java/org/primefaces/extensions/component/waypoint/WaypointRenderer.java +++ b/src/main/java/org/primefaces/extensions/component/waypoint/WaypointRenderer.java @@ -25,7 +25,6 @@ import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.context.ResponseWriter; import java.io.IOException; -import org.primefaces.expression.SearchExpressionHint; /** * WaypointRenderer. @@ -49,7 +48,7 @@ public class WaypointRenderer extends CoreRenderer { // try to get context (which scrollable element the waypoint belongs to and acts within) String context = SearchExpressionFacade.resolveClientIds(fc, waypoint, waypoint.getForContext()); - String target = SearchExpressionFacade.resolveClientIds(fc, waypoint, waypoint.getFor(), SearchExpressionHint.PARENT_FALLBACK); + String target = SearchExpressionFacade.resolveClientIds(fc, waypoint, waypoint.getFor(), SearchExpressionFacade.Options.PARENT_FALLBACK); final String widgetVar = waypoint.resolveWidgetVar();
Fixed SearchExpressionHint.PARENT_FALLBACK to SearchExpressionFacade.Options.PARENT_FALLBACK based on PF <I> changes
primefaces-extensions_core
train
java
3103b864fe1939e6078221a8617a370f8443563f
diff --git a/classes/Gems/Tracker/Model/FieldMaintenanceModel.php b/classes/Gems/Tracker/Model/FieldMaintenanceModel.php index <HASH>..<HASH> 100644 --- a/classes/Gems/Tracker/Model/FieldMaintenanceModel.php +++ b/classes/Gems/Tracker/Model/FieldMaintenanceModel.php @@ -237,7 +237,7 @@ class FieldMaintenanceModel extends \MUtil_Model_UnionModel ); $this->set('htmlUse', - 'elementClass', 'Exhibitor', + 'elementClass', 'Exhibitor', 'nohidden', true, 'value', \MUtil_Html::create('h3', $this->_('Field use')) ); $this->set('gtf_to_track_info', 'label', $this->_('In description'), @@ -260,7 +260,7 @@ class FieldMaintenanceModel extends \MUtil_Model_UnionModel ); $this->set('htmlCalc', - 'elementClass', 'None', + 'elementClass', 'None', 'nohidden', true, 'value', \MUtil_Html::create('h3', $this->_('Field calculation')) );
#<I> Fixed h3 labels after changing the field type
GemsTracker_gemstracker-library
train
php
a7ba1bd72415d9191b17bc2c276aa893b4ecef48
diff --git a/tests/tests/kernel/classes/clusterfilehandlers/ezdbfilehandler_test.php b/tests/tests/kernel/classes/clusterfilehandlers/ezdbfilehandler_test.php index <HASH>..<HASH> 100644 --- a/tests/tests/kernel/classes/clusterfilehandlers/ezdbfilehandler_test.php +++ b/tests/tests/kernel/classes/clusterfilehandlers/ezdbfilehandler_test.php @@ -39,10 +39,6 @@ class eZDBFileHandlerTest extends eZDBBasedClusterFileHandlerAbstractTest $backend = 'eZDBFileHandlerMysqliBackend'; break; - case 'postgresql': - $backend = 'eZDBFileHandlerPostgresqlBackend'; - break; - default: $this->markTestSkipped( "Unsupported database type '{$dsn['phptype']}'" ); }
Fixed eZDBFileHandlerTest to not run against postgresql
ezsystems_ezpublish-legacy
train
php
149a78aa2d80ccfb8890adec5a4003b56b27dd5d
diff --git a/salt/states/pip_state.py b/salt/states/pip_state.py index <HASH>..<HASH> 100644 --- a/salt/states/pip_state.py +++ b/salt/states/pip_state.py @@ -339,7 +339,7 @@ def installed(name, __env__=__env__ ) - if pip_install_call and (pip_install_call['retcode'] == 0): + if pip_install_call and (pip_install_call.get('retcode', 1) == 0): ret['result'] = True if requirements or editable: @@ -375,8 +375,11 @@ def installed(name, ret['comment'] = 'Package was successfully installed' elif pip_install_call: ret['result'] = False - error = 'Error: {0} {1}'.format(pip_install_call['stdout'], - pip_install_call['stderr']) + if 'stdout' in pip_install_call: + error = 'Error: {0} {1}'.format(pip_install_call['stdout'], + pip_install_call['stderr']) + else: + error = 'Error: {0}'.format(pip_install_call['comment']) if requirements or editable: comments = []
Properly handle requirements files not found. If a requirements file is not found, the `pip` salt module does not even execute the `cmd` call, so, there's not `retcode`, `stdout` or `stderr`.
saltstack_salt
train
py
a987db262aaf501217588cc8f4ee7d152a3919a2
diff --git a/openTSNE/tsne.py b/openTSNE/tsne.py index <HASH>..<HASH> 100644 --- a/openTSNE/tsne.py +++ b/openTSNE/tsne.py @@ -1154,18 +1154,6 @@ class TSNE(BaseEstimator): self.random_state = random_state self.verbose = verbose - @property - def neighbors_method(self): - import warnings - - warnings.warn( - f"The `neighbors_method` attribute has been deprecated and will be " - f"removed in future versions. Please use the new `neighbors` " - f"attribute", - category=FutureWarning, - ) - return self.neighbors - def fit(self, X=None, affinities=None, initialization=None): """Fit a t-SNE embedding for a given data set.
Remove deprecated neighbors_method property
pavlin-policar_openTSNE
train
py
5c0a9b330ab8240d8a0786154dfb1bd929dbb1ad
diff --git a/zappa/handler.py b/zappa/handler.py index <HASH>..<HASH> 100644 --- a/zappa/handler.py +++ b/zappa/handler.py @@ -291,6 +291,12 @@ class LambdaHandler(object): arn = None if 'Sns' in record: + try: + message = json.loads(record['Sns']['Message']) + if message.get('command'): + return message['command'] + except ValueError: + pass arn = record['Sns'].get('TopicArn') elif 'dynamodb' in record or 'kinesis' in record: arn = record.get('eventSourceARN')
Run command if receive one in an SNS event
Miserlou_Zappa
train
py
c2473e4c48cd3d3eedd0656aa19149827dafa5ce
diff --git a/lib/gemstash/api_key_authorization.rb b/lib/gemstash/api_key_authorization.rb index <HASH>..<HASH> 100644 --- a/lib/gemstash/api_key_authorization.rb +++ b/lib/gemstash/api_key_authorization.rb @@ -8,7 +8,7 @@ module Gemstash end def self.protect(app, &block) - key = app.request.env["HTTP_AUTHORIZATION"] + key = parse_authorization(app.request.env) app.auth = new(key) yield rescue Gemstash::NotAuthorizedError => e @@ -16,6 +16,12 @@ module Gemstash app.halt 401, e.message end + def self.parse_authorization(request_env) + http_auth = Rack::Auth::Basic::Request.new(request_env) + return http_auth.credentials.first if http_auth.provided? && http_auth.basic? + request_env["HTTP_AUTHORIZATION"] + end + def check(permission) Gemstash::Authorization.check(@key, permission) end
parse http basic auth for private gems
bundler_gemstash
train
rb
4fd752d2dda5ed76890f80a4f417ffa9a4be4532
diff --git a/views/js/qtiCreator/widgets/helpers/modalFeedbackRule.js b/views/js/qtiCreator/widgets/helpers/modalFeedbackRule.js index <HASH>..<HASH> 100644 --- a/views/js/qtiCreator/widgets/helpers/modalFeedbackRule.js +++ b/views/js/qtiCreator/widgets/helpers/modalFeedbackRule.js @@ -75,6 +75,9 @@ define([ name : 'choices', label : __('choices'), init : function initChoice(fbRule, $select){ + + $select.siblings('.feedbackRule-compared-value').hide(); + var condition = this.name; //@TODO : create the choice selecter @@ -92,7 +95,7 @@ define([ cSelector.on('change', function(){ //on change, assign selected choices (identifiers) - var selectedChoices = ['choice_1', 'choice_3', 'choice_ABC']; + var selectedChoices = ['choice_1', 'choice_3', 'choice_2']; response.setCondition(fbRule, condition, selectedChoices); }).trigger('change');
fixed compared score input visibility in the match choices mode
oat-sa_extension-tao-itemqti
train
js
4f4e7a4565b68cfe312ac4f3aa5b397acca664c2
diff --git a/framework/Mvc/Renderers/TwigExtensions.php b/framework/Mvc/Renderers/TwigExtensions.php index <HASH>..<HASH> 100644 --- a/framework/Mvc/Renderers/TwigExtensions.php +++ b/framework/Mvc/Renderers/TwigExtensions.php @@ -63,6 +63,7 @@ class TwigExtensions { return [ new \Twig_SimpleFilter('repeat', 'str_repeat'), + new \Twig_SimpleFilter('unique', 'array_unique'), new \Twig_SimpleFilter('count', 'count'), new \Twig_SimpleFilter('sum', function ($val) {return is_array($val) ? array_sum($val) : 0;}), new \Twig_SimpleFilter('basename', 'basename'),
+ 'unique' filter is added
pr-of-it_t4
train
php
8e89ccc5d5a4801d5424ab9ad511573d2ef94d55
diff --git a/lib/restclient/exceptions.rb b/lib/restclient/exceptions.rb index <HASH>..<HASH> 100644 --- a/lib/restclient/exceptions.rb +++ b/lib/restclient/exceptions.rb @@ -107,6 +107,10 @@ module RestClient end end + def http_headers + @response.headers if @response + end + def http_body @response.body if @response end
Add Exception#http_headers for parallelism. This closely matches the behavior of `#http_body`. Though I suspect we have a documentation problem if people aren't aware of `#response`.
rest-client_rest-client
train
rb
a45baf3e7f4d00807a9b1f2b8b58683e85dd18dc
diff --git a/lib/guard/jekyll-plus.rb b/lib/guard/jekyll-plus.rb index <HASH>..<HASH> 100755 --- a/lib/guard/jekyll-plus.rb +++ b/lib/guard/jekyll-plus.rb @@ -4,14 +4,13 @@ require 'guard' require 'guard/guard' require 'jekyll' -begin - require 'rack' - @use_rack = true -rescue LoadError -end - module Guard class Jekyllplus < Guard + begin + require 'rack' + @@use_rack = true + rescue LoadError + end def initialize (watchers=[], options={}) super @@ -57,7 +56,7 @@ module Guard # Create a Jekyll site # @site = ::Jekyll::Site.new @config - @rack = ::Rack::Server.new(rack_config(@destination)) if @use_rack + @rack = ::Rack::Server.new(rack_config(@destination)) if @@use_rack end
Correct scoping issue with rack usage detection.
imathis_guard-jekyll-plus
train
rb
5b084ce8e74ddaf4fb9a70980f4a802e4625d165
diff --git a/tests/Unit/CachedBuilderTest.php b/tests/Unit/CachedBuilderTest.php index <HASH>..<HASH> 100644 --- a/tests/Unit/CachedBuilderTest.php +++ b/tests/Unit/CachedBuilderTest.php @@ -618,4 +618,25 @@ class CachedBuilderTest extends TestCase $this->assertTrue($cachedResults->contains($author)); $this->assertTrue($liveResults->contains($author)); } + + public function testRelationshipQueriesAreCached() + { + $books = (new Author) + ->first() + ->books() + ->get(); + $key = 'genealabslaravelmodelcachingtestsfixturesbook-books.author_id_1-books.author_id_notnull'; + $tags = [ + 'genealabslaravelmodelcachingtestsfixturesbook' + ]; + + $cachedResults = cache()->tags($tags)->get($key); + $liveResults = (new UncachedAuthor) + ->first() + ->books() + ->get(); + + $this->assertTrue($cachedResults->diffAssoc($books)->isEmpty()); + $this->assertTrue($liveResults->diffAssoc($books)->isEmpty()); + } }
Add test to check that nested relationship queries are cached
GeneaLabs_laravel-model-caching
train
php
934e63ba82f4fec4eeb59afda3437a3d169b35c3
diff --git a/concrete/src/Application/Service/FileManager.php b/concrete/src/Application/Service/FileManager.php index <HASH>..<HASH> 100644 --- a/concrete/src/Application/Service/FileManager.php +++ b/concrete/src/Application/Service/FileManager.php @@ -60,7 +60,7 @@ class FileManager <div class="ccm-file-selector" data-file-selector="{$id}"></div> <script type="text/javascript"> $(function() { - $('[data-file-selector={$id}]').concreteFileSelector({$args}); + $('[data-file-selector="{$id}"]').concreteFileSelector({$args}); }); </script> EOL;
Escape element selector for adding file selector
concrete5_concrete5
train
php
f488ae7861bb214699a3cc7b186334a63120fe66
diff --git a/thumbor/engines/pil.py b/thumbor/engines/pil.py index <HASH>..<HASH> 100644 --- a/thumbor/engines/pil.py +++ b/thumbor/engines/pil.py @@ -116,6 +116,11 @@ class Engine(BaseEngine): if quality is None: options['quality'] = 'keep' + if self.image.mode == 'L': + self.image = self.image.convert('RGB') + if quality is None: + options['quality'] = None + if options['quality'] is None: options['quality'] = self.context.config.QUALITY diff --git a/vows/handler_images_vows.py b/vows/handler_images_vows.py index <HASH>..<HASH> 100644 --- a/vows/handler_images_vows.py +++ b/vows/handler_images_vows.py @@ -294,3 +294,12 @@ class GetImageWithAutoWebP(BaseContext): def should_be_200(self, response): code, _ = response expect(code).to_equal(200) + + class WithMonochromaticJPEG(BaseContext): + def topic(self): + response = self.get('/unsafe/wellsford.jpg') + return (response.code, response.headers) + + def should_be_200(self, response): + code, _ = response + expect(code).to_equal(200)
Fix #<I>. Monochromatic JPG images were being handled incorrectly. Now it works as expected.
thumbor_thumbor
train
py,py
db82c0317193bc3fd3ba511328c117760cc013e1
diff --git a/docs/assets/js/models.js b/docs/assets/js/models.js index <HASH>..<HASH> 100644 --- a/docs/assets/js/models.js +++ b/docs/assets/js/models.js @@ -332,6 +332,7 @@ }; const editions = [ + 'Spark NLP 3.0', 'Spark NLP 2.7', 'Spark NLP 2.6', 'Spark NLP 2.5',
Add "Spark NLP <I>" option to the filters
JohnSnowLabs_spark-nlp
train
js
8b9117c28f06575e9516b66c5c3b0d9cf419e6e5
diff --git a/code/model/Address.php b/code/model/Address.php index <HASH>..<HASH> 100644 --- a/code/model/Address.php +++ b/code/model/Address.php @@ -56,7 +56,7 @@ class Address extends DataObject{ */ function getFormFields($nameprefix = "", $showhints = false){ $countries = SiteConfig::current_site_config()->getCountriesList(); - $countryfield = (count($countries)) ? new DropdownField($nameprefix."Country",_t('Address.COUNTRY','Country'),$countries) : new ReadonlyField("Country",_t('Address.COUNTRY','Country')); + $countryfield = (count($countries)) ? new DropdownField($nameprefix."Country",_t('Address.COUNTRY','Country'),$countries) : new ReadonlyField($nameprefix."Country",_t('Address.COUNTRY','Country')); $countryfield->setHasEmptyDefault(true); $fields = new FieldSet( $countryfield,
BUG: added missing prefix string for country drop down when read-only
silvershop_silvershop-core
train
php
c6d6926116bff6acbdddda098a1e97ec745e9d1c
diff --git a/src/database/migrations/2019_11_12_220840_drop_groups_table.php b/src/database/migrations/2019_11_12_220840_drop_groups_table.php index <HASH>..<HASH> 100644 --- a/src/database/migrations/2019_11_12_220840_drop_groups_table.php +++ b/src/database/migrations/2019_11_12_220840_drop_groups_table.php @@ -215,14 +215,15 @@ class DropGroupsTable extends Migration 'updated_at' => carbon(), ]); - $id = 0; - DB::table('users')->get()->each(function ($user) use (&$id) { - //$id++; - DB::table('users') - ->where('main_character_id', $user->main_character_id) - ->update([ - 'id' => ++$id, - ]); + DB::table('users') + ->whereNull('id') + ->get() + ->each(function ($user, $key) { + DB::table('users') + ->where('main_character_id', $user->main_character_id) + ->update([ + 'id' => ($key + 2), + ]); }); // switch id field from simple integer to auto-increment field
fix: ensure users table is starting with ID 2
eveseat_web
train
php
50b8dfd6699fe69ac619e7996716c5919ef7c24a
diff --git a/ella/newman/context_processors.py b/ella/newman/context_processors.py index <HASH>..<HASH> 100644 --- a/ella/newman/context_processors.py +++ b/ella/newman/context_processors.py @@ -6,8 +6,10 @@ def newman_media(request): settings, if not available, use MEDIA_URL + 'newman_media/' combination """ uri = getattr(settings, 'NEWMAN_MEDIA_PREFIX', None) + debug = settings.DEBUG if not uri: uri = getattr(settings, 'MEDIA_URL') + 'newman_media/' return { - 'NEWMAN_MEDIA_URL' : uri + 'NEWMAN_MEDIA_URL' : uri, + 'DEBUG': False }
Added DEBUG to context.
ella_ella
train
py
e95df5d2a7ad104b5702390042fa897503eafcfb
diff --git a/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php b/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php index <HASH>..<HASH> 100644 --- a/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php +++ b/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php @@ -53,7 +53,7 @@ class StubIntlDateFormatterTest extends LocaleTestCase /* general */ array('y-M-d', 0, '1970-1-1'), array("yyyy.MM.dd G 'at' HH:mm:ss zzz", 0, '1970.01.01 AD at 00:00:00 GMT+00:00'), - array("EEE, MMM d, ''yy", 0, "Thu, Jan 1, '00"), + array("EEE, MMM d, ''yy", 0, "Thu, Jan 1, '70"), array('h:mm a', 0, '12:00 AM'), array('K:mm a, z', 0, '0:00 AM, GMT+00:00'), array('yyyyy.MMMM.dd GGG hh:mm aaa', 0, '01970.January.01 AD 12:00 AM'),
[Locale] fix failing test case
symfony_symfony
train
php
3f390622f7e2ff71bb36c52015f5be40e0f08228
diff --git a/tools/functional-tester/agent/handler.go b/tools/functional-tester/agent/handler.go index <HASH>..<HASH> 100644 --- a/tools/functional-tester/agent/handler.go +++ b/tools/functional-tester/agent/handler.go @@ -292,9 +292,7 @@ func (srv *Server) handleKillEtcd() (*rpcpb.Response, error) { } func (srv *Server) handleFailArchive() (*rpcpb.Response, error) { - // TODO: stop/restart proxy? - // for now, just keep using the old ones - // if len(srv.advertisePortToProxy) > 0 + srv.stopProxy() // exit with stackstrace srv.logger.Info("killing etcd process", zap.String("signal", syscall.SIGQUIT.String()))
functional-tester/agent: stop proxy on "fail archive"
etcd-io_etcd
train
go
7700253bd01a2a3b264461b044e25740a738548c
diff --git a/securesystemslib/gpg/functions.py b/securesystemslib/gpg/functions.py index <HASH>..<HASH> 100644 --- a/securesystemslib/gpg/functions.py +++ b/securesystemslib/gpg/functions.py @@ -47,7 +47,8 @@ def gpg_sign_object(content, keyid=None, homedir=None): Path to the gpg keyring. If not passed the default keyring is used. <Exceptions> - None. + ValueError: if the gpg command failed to create a valid signature. + OSError: if the gpg command is not present or non-executable. <Side Effects> None.
DOC:gpg:functions: update exception docstrings The gpg_sign_object did not mention two possible exceptions to raise when trying to sign an object. Mention those two exceptions and the reasons as to why they may be raised in the docstrings.
secure-systems-lab_securesystemslib
train
py
857b3432b359538df9ebb6b96690f380513c8220
diff --git a/public/examples/scripts/mobilehacks.js b/public/examples/scripts/mobilehacks.js index <HASH>..<HASH> 100644 --- a/public/examples/scripts/mobilehacks.js +++ b/public/examples/scripts/mobilehacks.js @@ -44,11 +44,14 @@ define(function() { } }; - // When the device re-orients, at least on iOS, the page is scrolled down :( - window.addEventListener('orientationchange', function() { + var fixupAfterSizeChange = function() { window.scrollTo(0, 0); fixHeightHack(); - }, false); + }; + + // When the device re-orients, at least on iOS, the page is scrolled down :( + window.addEventListener('orientationchange', fixupAfterSizeChange, false); + window.addEventListener('resize', fixupAfterSizeChange, false); // Prevents the browser from sliding the page when the user slides their finger. // At least on iOS.
call fixheight hack on resize
greggman_HappyFunTimes
train
js
c45d6bab23a0b6f78e6d3c74e79293cf33f6543f
diff --git a/lang/tr/lang.php b/lang/tr/lang.php index <HASH>..<HASH> 100644 --- a/lang/tr/lang.php +++ b/lang/tr/lang.php @@ -27,6 +27,7 @@ 'states' => 'States', 'main_price_type' => 'Main price', 'price_include_tax' => 'Price includes taxes', + 'discount_price' => 'Discount price', ], 'menu' => [ 'main' => 'Catalog',
New translations lang.php (Turkish)
lovata_oc-shopaholic-plugin
train
php
f7ee3f06fe52710d18e679d7fc19a6baec611139
diff --git a/logger_windows.go b/logger_windows.go index <HASH>..<HASH> 100644 --- a/logger_windows.go +++ b/logger_windows.go @@ -11,8 +11,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +build windows - package logger import (
Update logger_windows.go removed unneeded // +build windows (it would need to be at the top anyway)
google_logger
train
go
4a1a54b0b4f585b8d06774f2fa143a80f696fd7e
diff --git a/cloudmesh/common/Shell.py b/cloudmesh/common/Shell.py index <HASH>..<HASH> 100755 --- a/cloudmesh/common/Shell.py +++ b/cloudmesh/common/Shell.py @@ -310,7 +310,6 @@ class Shell(object): return subprocess.check_output(*args, **kwargs) @classmethod - # @NotImplementedInWindows def ls(cls, match="."): """ executes ls with the given arguments
ls is implemented for windows via glob
cloudmesh_cloudmesh-common
train
py
88f62bfe62531bed69f871425d21d8c4e3203ecf
diff --git a/setuptools/dist.py b/setuptools/dist.py index <HASH>..<HASH> 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -276,6 +276,12 @@ class Distribution(_Distribution): ver = packaging.version.Version(self.metadata.version) normalized_version = str(ver) if self.metadata.version != normalized_version: + warnings.warn( + "Normalizing '%s' to '%s'" % ( + self.metadata.version, + normalized_version, + ) + ) self.metadata.version = normalized_version except (packaging.version.InvalidVersion, TypeError): warnings.warn(
soften normalized version warning indicate that normalization is happening, but don't be pushy about changing valid versions. --HG-- branch : no-normalize-warning
pypa_setuptools
train
py
6662f3b868d927eb838202b5fcc1e8150dff346f
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/timemachine_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/timemachine_controller.rb index <HASH>..<HASH> 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/timemachine_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/timemachine_controller.rb @@ -149,15 +149,22 @@ class Api::TimemachineController < Api::ApiController xml.snapshots do snapshots.each do |snapshot| - snapshot_to_xml(xml, snapshot, measures_by_sid[snapshot.id]) + snapshot_to_xml(xml, snapshot, measures_by_sid[snapshot.id], metric_keys) end end end - def snapshot_to_xml(xml, snapshot, measures) + def snapshot_to_xml(xml, snapshot, measures, metric_keys) + values_by_key = {} + measures.each do |measure| + values_by_key[measure.metric.name] = measure.value.to_f if measure.value + end + xml.snapshot do xml.date(format_datetime(snapshot.created_at)) - # TODO measures + metric_keys.each do |metric| + xml.measure(values_by_key[metric]) + end end end
SONAR-<I>: New Web Service to get history of measures (time machine)
SonarSource_sonarqube
train
rb
6bceaad514f7edaa8b18108e80d794f571adea2c
diff --git a/res/tiles/plato.js b/res/tiles/plato.js index <HASH>..<HASH> 100644 --- a/res/tiles/plato.js +++ b/res/tiles/plato.js @@ -7,7 +7,8 @@ gpf.require.define({ }, function (require) { "use strict"; - var dom = require.dom, + var HTTP_NOTFOUND = 404, + dom = require.dom, metrics = require.config.metrics; return gpf.define({ @@ -22,7 +23,7 @@ gpf.require.define({ getDynamicContent: function () { return gpf.http.get("/tmp/plato/report.json") .then(function (response) { - if (response.status === 404) { + if (response.status === HTTP_NOTFOUND) { return []; } return JSON.parse(response.responseText);
no-magic-numbers (#<I>)
ArnaudBuchholz_gpf-js
train
js
e33ec3f78ae8037d912809c826d44332c1783631
diff --git a/lib/transpec/syntax/method_stub.rb b/lib/transpec/syntax/method_stub.rb index <HASH>..<HASH> 100644 --- a/lib/transpec/syntax/method_stub.rb +++ b/lib/transpec/syntax/method_stub.rb @@ -69,15 +69,7 @@ module Transpec end def build_allow_expression(message_node, return_value_node = nil, keep_form_around_arg = true) - expression = '' - - expression << if any_instance? - class_source = class_node_of_any_instance.loc.expression.source - "allow_any_instance_of(#{class_source})" - else - "allow(#{subject_range.source})" - end - + expression = allow_source expression << range_in_between_subject_and_selector.source expression << 'to receive' expression << (keep_form_around_arg ? range_in_between_selector_and_arg.source : '(') @@ -92,6 +84,15 @@ module Transpec expression end + def allow_source + if any_instance? + class_source = class_node_of_any_instance.loc.expression.source + "allow_any_instance_of(#{class_source})" + else + "allow(#{subject_range.source})" + end + end + def message_source(node) message_source = node.loc.expression.source message_source.prepend(':') if node.type == :sym && !message_source.start_with?(':')
Refactor MethodStub#build_allow_expression
yujinakayama_transpec
train
rb
0dc94873be8e525f23b182bca3798dc83e736067
diff --git a/kerncraft/models/ecm.py b/kerncraft/models/ecm.py index <HASH>..<HASH> 100755 --- a/kerncraft/models/ecm.py +++ b/kerncraft/models/ecm.py @@ -556,14 +556,19 @@ class ECMCPU: cl_latency = block_latency*block_to_cl_ratio # Compile most relevant information - if self._args.latency: - T_OL = cl_latency - else: - T_OL = max( - [v for k, v in port_cycles.items() if k in self.machine['overlapping ports']]) + T_OL = max( + [v for k, v in port_cycles.items() if k in self.machine['overlapping ports']]) T_nOL = max( [v for k, v in port_cycles.items() if k in self.machine['non-overlapping ports']]) + # Use IACA throughput prediction if it is slower then T_nOL + if T_nOL < cl_throughput: + T_OL = cl_throughput + + # Use latency if requested + if self._args.latency: + T_OL = cl_latency + # Create result dictionary self.results = { 'port cycles': port_cycles,
using IACA throughput if it is slower then T_nOL
RRZE-HPC_kerncraft
train
py
d7f5d8ba43abf6312240a88b1af0759e7dee0348
diff --git a/DM_IO/dm3_image_utils.py b/DM_IO/dm3_image_utils.py index <HASH>..<HASH> 100644 --- a/DM_IO/dm3_image_utils.py +++ b/DM_IO/dm3_image_utils.py @@ -255,7 +255,7 @@ def save_image(data, dimensional_calibrations, intensity_calibration, metadata, timezone_str = " " + timezone_str if timezone_str is not None else "" date_str = modified.strftime("%x") time_str = modified.strftime("%X") + timezone_str - ret["ImageSourceList"] = {"Acquisition Date": date_str, "Acquisition Time": time_str} + ret["DataBar"] = {"Acquisition Date": date_str, "Acquisition Time": time_str} # I think ImageSource list creates a mapping between ImageSourceIds and Images ret["ImageSourceList"] = [{"ClassName": "ImageSource:Simple", "Id": [0], "ImageRef": 0}] # I think this lists the sources for the DocumentObjectlist. The source number is not
Ugh. Wrong tag. Fixed.
nion-software_nionswift-io
train
py
4b32ecf85f9607188106cafe6d6dd7a02ae6cab6
diff --git a/lib/gli/commands/help_modules/full_synopsis_formatter.rb b/lib/gli/commands/help_modules/full_synopsis_formatter.rb index <HASH>..<HASH> 100644 --- a/lib/gli/commands/help_modules/full_synopsis_formatter.rb +++ b/lib/gli/commands/help_modules/full_synopsis_formatter.rb @@ -27,10 +27,11 @@ module GLI def sub_options_doc(sub_options) sub_options_doc = sub_options.map { |_,option| - option.names_and_aliases.map { |name| + doc = option.names_and_aliases.map { |name| CommandLineOption.name_as_string(name,false) + (option.kind_of?(Flag) ? " #{option.argument_name }" : '') }.join('|') - }.map { |invocations| "[#{invocations}]" }.sort.join(' ').strip + option.required?? doc : "[#{doc}]" + }.sort.join(' ').strip end private
Don't mark required options with brackets in full synopsis
davetron5000_gli
train
rb
08f7ac51566209cf784a2e5132113393cfda17c5
diff --git a/pythonforandroid/toolchain.py b/pythonforandroid/toolchain.py index <HASH>..<HASH> 100644 --- a/pythonforandroid/toolchain.py +++ b/pythonforandroid/toolchain.py @@ -467,6 +467,10 @@ class ToolchainCL(object): self.args = args + if args.subparser_name is None: + parser.print_help() + exit(1) + setup_color(args.color) if args.debug:
Added command handling if p4a is run with no arguments
kivy_python-for-android
train
py
b4b553a257246b4da0083a2607c6ac063ed6965b
diff --git a/tests/UrlTest.php b/tests/UrlTest.php index <HASH>..<HASH> 100644 --- a/tests/UrlTest.php +++ b/tests/UrlTest.php @@ -154,7 +154,7 @@ class UrlTest extends TestCase /** @var Url $new */ $new = $url->$method($value); - $this->assertSame($psr2, $new->getUri()); + $this->assertSame($psr2, $new->psr()); } /**
Fix deprecated getUri() method usage.
neat-php_http
train
php
f684eaf12b0fb433e9e98c81182c7b1e561fcc37
diff --git a/src/Uuid/IUuidGenerator.php b/src/Uuid/IUuidGenerator.php index <HASH>..<HASH> 100644 --- a/src/Uuid/IUuidGenerator.php +++ b/src/Uuid/IUuidGenerator.php @@ -40,5 +40,5 @@ interface IUuidGenerator { * * @return String Valid v5 UUID. */ - public function generateV5($str, $namespace = NULL); + public function generateV5($name, $namespace = NULL); }
Why am I changing the variable name in the interface?
Islandora-CLAW_chullo
train
php
48ceae54b7edf064dcb2ad508705b254b9e89545
diff --git a/modeltranslation/tests/__init__.py b/modeltranslation/tests/__init__.py index <HASH>..<HASH> 100644 --- a/modeltranslation/tests/__init__.py +++ b/modeltranslation/tests/__init__.py @@ -1549,6 +1549,21 @@ class TranslationAdminTest(ModeltranslationTestBase): for field, css in fields.items(): self.assertEqual(build_css_class(field), css) + def test_multitable_inheritance(self): + class MultitableModelAAdmin(admin.TranslationAdmin): + pass + + class MultitableModelBAdmin(admin.TranslationAdmin): + pass + + maa = MultitableModelAAdmin(models.MultitableModelA, self.site) + mab = MultitableModelBAdmin(models.MultitableModelB, self.site) + + self.assertEqual(maa.get_form(request).base_fields.keys(), + ['titlea_de', 'titlea_en']) + self.assertEqual(mab.get_form(request).base_fields.keys(), + ['titlea_de', 'titlea_en', 'titleb_de', 'titleb_en']) + class TestManager(ModeltranslationTestBase): def setUp(self):
Added admin test for multitable inheritance to verify that issue #<I> was resolved by pull request #<I>.
deschler_django-modeltranslation
train
py
c4532230456c0ac48524f6b0e63234fe141b484d
diff --git a/src/main/java/reactor/ipc/netty/channel/PooledClientContextHandler.java b/src/main/java/reactor/ipc/netty/channel/PooledClientContextHandler.java index <HASH>..<HASH> 100644 --- a/src/main/java/reactor/ipc/netty/channel/PooledClientContextHandler.java +++ b/src/main/java/reactor/ipc/netty/channel/PooledClientContextHandler.java @@ -266,12 +266,10 @@ final class PooledClientContextHandler<CHANNEL extends Channel> pool.release(c) .addListener(f -> { - if (f.isSuccess()) { - onReleaseEmitter.onComplete(); - } - else { - onReleaseEmitter.onError(f.cause()); - } + if (log.isDebugEnabled() && !f.isSuccess()){ + log.debug("Failed cleaning the channel from pool", f.cause()); + } + onReleaseEmitter.onComplete(); }); }
Fix IllegalArgumentException: Channel [...] was not acquired from this ChannelPool
reactor_reactor-netty
train
java
351cfa115302311bdf6d279b1dffe18a9ecb494a
diff --git a/server.go b/server.go index <HASH>..<HASH> 100644 --- a/server.go +++ b/server.go @@ -132,6 +132,16 @@ type Server struct { // By default unlimited number of requests served per connection. MaxRequestsPerConn int + // Aggressively reduces memory usage at the cost of higher CPU usage + // if set to true. + // + // Try enabling this option only if the server consumes too much memory + // serving mostly idle keep-alive connections. This may reduce memory + // usage by up to 50%. + // + // Aggressive memory usage reduction is disabled by default. + ReduceMemoryUsage bool + // Logger, which is used by RequestCtx.Logger(). // // By default standard logger from log package is used. @@ -693,7 +703,7 @@ func (s *Server) serveConn(c net.Conn) error { break } } - if ctx.lastReadDuration < time.Second || br != nil { + if !(s.ReduceMemoryUsage || ctx.lastReadDuration > time.Second) || br != nil { if br == nil { br = acquireReader(ctx) }
Added ReduceMemoryUsage option to Server
valyala_fasthttp
train
go
b2397a4755f813d4f0c2cbaaf9e285436eb1242f
diff --git a/src/Core/Config.php b/src/Core/Config.php index <HASH>..<HASH> 100644 --- a/src/Core/Config.php +++ b/src/Core/Config.php @@ -97,7 +97,13 @@ class Config { return $this->loaded[ $filename ]; } - $contents = file_get_contents( $this->path . 'config/' . $filename . '.json' ); + $config = $this->path . 'config/' . $filename . '.json'; + + if ( ! file_exists( $config ) ) { + return null; + } + + $contents = file_get_contents( $config ); if ( false === $contents ) { return null;
Better handling of potentially null config file Check if the file exists first before loading.
intraxia_jaxion
train
php
14c5fe29f0066d726434fd5320ec85daefcc8740
diff --git a/ugali/observation/mask.py b/ugali/observation/mask.py index <HASH>..<HASH> 100644 --- a/ugali/observation/mask.py +++ b/ugali/observation/mask.py @@ -223,7 +223,7 @@ class Mask: if method == 'step': func = lambda delta: (delta > 0).astype(float) elif method == 'erf': - # Trust the ERD??? + # Trust the SDSS EDR??? # 95% completeness: def func(delta): # Efficiency at bright end (assumed to be 100%) @@ -232,6 +232,14 @@ class Mask: width = 0.2 # This should be the halfway point in the curve return (e/2.0)*(1/np.sqrt(2*width))*(np.sqrt(2*width)-scipy.special.erf(-delta)) + elif method = 'flemming': + # Functional form taken from Fleming et al. AJ 109, 1044 (1995) + # http://adsabs.harvard.edu/abs/1995AJ....109.1044F + # f = 1/2 [1 - alpha(V - Vlim)/sqrt(1 + alpha^2 (V - Vlim)^2)] + # CAREFUL: This definition is for Vlim = 50% completeness + def func(delta): + alpha = 2.0 + return 0.5 * (1 - (alpha * delta)/np.sqrt(1+alpha**2 * delta**2)) else: raise Exception('...') return func(delta)
Added Flemming completeness function
DarkEnergySurvey_ugali
train
py
25f5eeff3b3cbeb846c18ffa68ed3b7496a411fc
diff --git a/src/Vinelab/Minion/Client.php b/src/Vinelab/Minion/Client.php index <HASH>..<HASH> 100644 --- a/src/Vinelab/Minion/Client.php +++ b/src/Vinelab/Minion/Client.php @@ -60,4 +60,13 @@ class Client extends \Thruway\Peer\Client { } } } + + /** + * Start the transport + * + * @return void + */ + public function start() + { + } }
override the client's start method
Vinelab_minion
train
php
78dd84112bad05d7b713f250f7cc229acb31f868
diff --git a/lib/svtplay/service/urplay.py b/lib/svtplay/service/urplay.py index <HASH>..<HASH> 100644 --- a/lib/svtplay/service/urplay.py +++ b/lib/svtplay/service/urplay.py @@ -11,7 +11,7 @@ from svtplay.hls import download_hls class Urplay(): def handle(self, url): - return "urplay.se" in url + return ("urplay.se" in url) or ("ur.se" in url) def get(self, options, url): data = get_http_data(url)
urplay: adding support for ur.se
spaam_svtplay-dl
train
py
20c16941b1f65f15293427c648edcd933423d86a
diff --git a/nearley-make.js b/nearley-make.js index <HASH>..<HASH> 100644 --- a/nearley-make.js +++ b/nearley-make.js @@ -1,6 +1,5 @@ 'use strict' -const fs = require('fs') const nearley = require('nearley') const nearleyg = require('nearley/lib/nearley-language-bootstrapped.js') const nearleyc = require('nearley/lib/compile.js') @@ -39,4 +38,4 @@ module.exports = function nearleyMake(grammar, args) { parser = new nearley.Parser(grammar.ParserRules, grammar.ParserStart) return parser -} \ No newline at end of file +}
Remove unused require('fs') call (resolves #4)
nanaian_nearley-make
train
js
f9aa76225a3a67fdef818ce56f338461ccf5ece1
diff --git a/jest-common/src/test/java/io/searchbox/client/JestResultTest.java b/jest-common/src/test/java/io/searchbox/client/JestResultTest.java index <HASH>..<HASH> 100644 --- a/jest-common/src/test/java/io/searchbox/client/JestResultTest.java +++ b/jest-common/src/test/java/io/searchbox/client/JestResultTest.java @@ -88,7 +88,7 @@ public class JestResultTest { result.setPathToResult("_source"); result.setSucceeded(true); - Comment actual = result.getSourceAsObject(Comment.class); + SimpleComment actual = result.getSourceAsObject(SimpleComment.class); assertNotNull(actual); assertEquals(new Long(Integer.MAX_VALUE + 10l), actual.getSomeIdName()); @@ -577,4 +577,27 @@ public class JestResultTest { } } + class SimpleComment { + + @JestId + Long someIdName; + + String message; + + public Long getSomeIdName() { + return someIdName; + } + + public void setSomeIdName(Long someIdName) { + this.someIdName = someIdName; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + } }
ensure raw class works as well with meta annotations
searchbox-io_Jest
train
java
6b1cb214ebb93e24bc439766202735792aac0b75
diff --git a/elasticmock/fake_elasticsearch.py b/elasticmock/fake_elasticsearch.py index <HASH>..<HASH> 100644 --- a/elasticmock/fake_elasticsearch.py +++ b/elasticmock/fake_elasticsearch.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import json +import sys from elasticsearch import Elasticsearch from elasticsearch.client.utils import query_params @@ -9,6 +10,11 @@ from elasticsearch.exceptions import NotFoundError from elasticmock.utilities import get_random_id +PY3 = sys.version_info[0] == 3 +if PY3: + unicode = str + + class FakeElasticsearch(Elasticsearch): __documents_dict = None
Make FakeElasticsearch work with modern python 3 As unicode() is not there anymore
vrcmarcos_elasticmock
train
py
b4f956cc2f6728838b74a67d02ede006799c7182
diff --git a/alib/src/main/java/net/darkmist/alib/str/URLEscape.java b/alib/src/main/java/net/darkmist/alib/str/URLEscape.java index <HASH>..<HASH> 100644 --- a/alib/src/main/java/net/darkmist/alib/str/URLEscape.java +++ b/alib/src/main/java/net/darkmist/alib/str/URLEscape.java @@ -1,7 +1,5 @@ package net.darkmist.alib.str; -// never in qcomm - import java.io.UnsupportedEncodingException; import org.apache.commons.logging.Log;
remove never in qcomm comment
schallee_alib4j
train
java
aeaa47db136e588c0028e97b71997dfff83eae51
diff --git a/src/main/java/org/apache/accumulo/accismus/api/mapreduce/AccismusInputFormat.java b/src/main/java/org/apache/accumulo/accismus/api/mapreduce/AccismusInputFormat.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/apache/accumulo/accismus/api/mapreduce/AccismusInputFormat.java +++ b/src/main/java/org/apache/accumulo/accismus/api/mapreduce/AccismusInputFormat.java @@ -30,8 +30,8 @@ import org.apache.accumulo.accismus.api.config.AccismusProperties; import org.apache.accumulo.accismus.impl.Configuration; import org.apache.accumulo.accismus.impl.OracleClient; import org.apache.accumulo.accismus.impl.TransactionImpl; +import org.apache.accumulo.core.client.mapreduce.AbstractInputFormat.RangeInputSplit; import org.apache.accumulo.core.client.mapreduce.AccumuloInputFormat; -import org.apache.accumulo.core.client.mapreduce.InputFormatBase.RangeInputSplit; import org.apache.accumulo.core.client.security.tokens.PasswordToken; import org.apache.accumulo.core.data.ArrayByteSequence; import org.apache.accumulo.core.data.ByteSequence;
Make compile against latest <I>-SNAPSHOT
apache_fluo
train
java
3749e031a01377ffc0b66ba7a02838a4deb488c4
diff --git a/src/CoreBundle/EventListener/DcGeneral/Table/AbstractPaletteRestrictionListener.php b/src/CoreBundle/EventListener/DcGeneral/Table/AbstractPaletteRestrictionListener.php index <HASH>..<HASH> 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Table/AbstractPaletteRestrictionListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Table/AbstractPaletteRestrictionListener.php @@ -12,6 +12,7 @@ * * @package MetaModels/core * @author Christian Schiffler <c.schiffler@cyberspectrum.de> + * @author David Molineus <david.molineus@netzmacht.de> * @copyright 2012-2019 The MetaModels team. * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later * @filesource @@ -47,6 +48,10 @@ class AbstractPaletteRestrictionListener */ protected function getLegend($name, $palette, $prevLegend = null) { + if (strpos($name, '+') === 0) { + $name = substr($name, 1); + } + if (!$palette->hasLegend($name)) { $palette->addLegend(new Legend($name), $prevLegend); }
Check if legend name starts with an + sign to fix #<I>
MetaModels_core
train
php
56317b4c9499ff5d084dfaba233a5a6408a3391d
diff --git a/test/rake_test_setup.rb b/test/rake_test_setup.rb index <HASH>..<HASH> 100644 --- a/test/rake_test_setup.rb +++ b/test/rake_test_setup.rb @@ -18,25 +18,7 @@ if RUBY_VERSION >= "1.9.0" end module TestMethods - if RUBY_VERSION >= "1.9.0" - def assert_no_match(expected_pattern, actual, msg=nil) - refute_match(expected_pattern, actual, msg) - end - def assert_not_equal(expected, actual, msg=nil) - refute_equal(expected, actual, msg) - end - def assert_nothing_raised - yield - end - def assert_not_nil(actual, msg=nil) - refute_nil(actual, msg) - end - def assert_exception(ex, msg=nil, &block) - assert_raises(ex, msg, &block) - end - elsif RUBY_VERSION >= "1.8.0" - def assert_exception(ex, msg=nil, &block) - assert_raise(ex, msg, &block) - end + def assert_exception(ex, msg=nil, &block) + assert_raise(ex, msg, &block) end end
modified to work with revert of mini/test
ruby_rake
train
rb
005db8e122a85d585b65c147a9e8a503d2fb36ad
diff --git a/classes/fields/pick.php b/classes/fields/pick.php index <HASH>..<HASH> 100644 --- a/classes/fields/pick.php +++ b/classes/fields/pick.php @@ -176,7 +176,7 @@ class PodsField_Pick extends PodsField { 'dropdown' => __( 'Drop Down', 'pods' ), 'radio' => __( 'Radio Buttons', 'pods' ), 'autocomplete' => __( 'Autocomplete', 'pods' ), - 'list' => __( 'List View (with reordering)', 'pods' ), + 'list' => __( 'List View (single value)', 'pods' ), ] ), 'pick_show_select_text' => 0, 'dependency' => true, @@ -187,7 +187,7 @@ class PodsField_Pick extends PodsField { 'depends-on' => [ static::$type . '_format_type' => 'multi', ], - 'default' => 'checkbox', + 'default' => 'list', 'required' => true, 'type' => 'pick', 'data' => apply_filters( 'pods_form_ui_field_pick_format_multi_options', [
Set default relationship multi input as list view
pods-framework_pods
train
php
2232a972053430df9523df792b96db397ac57b5d
diff --git a/src/adapt/layout.js b/src/adapt/layout.js index <HASH>..<HASH> 100644 --- a/src/adapt/layout.js +++ b/src/adapt/layout.js @@ -2097,6 +2097,9 @@ adapt.layout.Column.prototype.saveEdgeAndCheckForOverflow = function(nodeContext if (!nodeContext) { return false; } + if (this.isOrphan(nodeContext.viewNode)) { + return false; + } var edge = adapt.layout.calculateEdge(nodeContext, this.clientLayout, 0, this.vertical); var fc = nodeContext.after ? (nodeContext.parent && nodeContext.parent.formattingContext) : nodeContext.formattingContext; @@ -2195,6 +2198,17 @@ adapt.layout.Column.prototype.isBFC = function(formattingContext) { }; /** + * @param {Node} node + * @return {boolean} + */ +adapt.layout.Column.prototype.isOrphan = function(node) { + while( node ) { + if (node.parentNode === node.ownerDocument) return false; + node = node.parentNode; + } + return true; +} +/** * Skips positions until either the start of unbreakable block or inline content. * Also sets breakBefore on the result combining break-before and break-after * properties from all elements that meet at the edge.
Fix bug where incorrect page breaking was done at the beginning of the table when `writing-mode: vertical` - Calling `Column#saveEdgeAndCheckForOverflow` with an element deleted by the mechanism of `TableLayoutStrategy.ignoreList` causes edge to be 0, so it was always judged as overflow in the vertical writing mode.
vivliostyle_vivliostyle.js
train
js
3c25c945d488c3179b2140dd679379ff42f485ca
diff --git a/lib/processMultipart.js b/lib/processMultipart.js index <HASH>..<HASH> 100644 --- a/lib/processMultipart.js +++ b/lib/processMultipart.js @@ -60,7 +60,8 @@ module.exports = (options, req, res, next) => { const writePromise = options.useTempFiles ? getWritePromise().catch(err => { - uploadTimer.clear(); + req.unpipe(busboy); + req.resume(); cleanup(); next(err); }) : getWritePromise();
Fixes richardgirges/express-fileupload#<I>. Unpipe busboy after error and skip further stream processing.
richardgirges_express-fileupload
train
js
14520904ee7fad852e9c147f7ec2ed6d515f6321
diff --git a/hazelcast/src/test/java/com/hazelcast/map/impl/mapstore/writebehind/WriteBehindFlushTest.java b/hazelcast/src/test/java/com/hazelcast/map/impl/mapstore/writebehind/WriteBehindFlushTest.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/test/java/com/hazelcast/map/impl/mapstore/writebehind/WriteBehindFlushTest.java +++ b/hazelcast/src/test/java/com/hazelcast/map/impl/mapstore/writebehind/WriteBehindFlushTest.java @@ -72,7 +72,7 @@ public class WriteBehindFlushTest extends HazelcastTestSupport { .mapName(mapName) .withMapStore(mapStore) .withNodeCount(nodeCount) - .withBackupCount(2) + .withBackupCount(1) .withConfig(getConfig()) .withNodeFactory(factory) .withWriteDelaySeconds(300);
Fixes test by decreasing backup count
hazelcast_hazelcast
train
java
44bca0786e51f41c718df7b99fb6432ea3f39184
diff --git a/core/src/test/java/com/orientechnologies/common/collection/OMVRBTreeCompositeTest.java b/core/src/test/java/com/orientechnologies/common/collection/OMVRBTreeCompositeTest.java index <HASH>..<HASH> 100644 --- a/core/src/test/java/com/orientechnologies/common/collection/OMVRBTreeCompositeTest.java +++ b/core/src/test/java/com/orientechnologies/common/collection/OMVRBTreeCompositeTest.java @@ -543,9 +543,7 @@ public class OMVRBTreeCompositeTest { assertEquals(entry.getKey(), compositeKey(2.0, 9.0)); } - @SuppressWarnings("unchecked") private OCompositeKey compositeKey(Comparable<?>... params) { - return new OCompositeKey((List<? extends Comparable<OCompositeKey>>) Arrays.asList(params)); + return new OCompositeKey((List<Comparable<?>>) Arrays.asList(params)); } - }
Resolved last compilation problem with Javac (Eclipse compiled)
orientechnologies_orientdb
train
java
539b2a767f604dd561a7da09ae26114e8cfc065a
diff --git a/src/core/lombok/javac/apt/LombokFileObjects.java b/src/core/lombok/javac/apt/LombokFileObjects.java index <HASH>..<HASH> 100644 --- a/src/core/lombok/javac/apt/LombokFileObjects.java +++ b/src/core/lombok/javac/apt/LombokFileObjects.java @@ -116,7 +116,15 @@ final class LombokFileObjects { if (Class.forName("com.sun.tools.javac.util.BaseFileObject") == null) throw new NullPointerException(); return Compiler.JAVAC6; } catch (Exception e) {} - return null; + + StringBuilder sb = new StringBuilder(jfmClassName); + if (jfm != null) { + sb.append(" extends ").append(jfm.getClass().getSuperclass().getName()); + for (Class<?> cls : jfm.getClass().getInterfaces()) { + sb.append(" implements ").append(cls.getName()); + } + } + throw new IllegalArgumentException(sb.toString()); } static JavaFileObject createEmpty(Compiler compiler, String name, Kind kind) {
[jdk9] added debugging information for when we cannot determine the compiler
rzwitserloot_lombok
train
java
1204c9981b22933ab9eead53535a69c06babe5e1
diff --git a/config.js b/config.js index <HASH>..<HASH> 100644 --- a/config.js +++ b/config.js @@ -146,53 +146,6 @@ module.exports = { }, // Custom indicator of vendor service. isSauceLabs: true - }, - "safari7-mac": { - desiredCapabilities: { - browserName: "safari", - platform: "OS X 10.9", - version: "7" - } - }, - "chrome-win7": { - desiredCapabilities: { - browserName: "chrome", - platform: "Windows 7" - } - }, - "firefox-win7": { - desiredCapabilities: { - browserName: "firefox", - platform: "Windows 7" - } - }, - "ie8-winxp": { - desiredCapabilities: { - browserName: "internet explorer", - platform: "Windows XP", - version: "8" - } - }, - "ie9-win7": { - desiredCapabilities: { - browserName: "internet explorer", - platform: "Windows 7", - version: "9" - } - }, - "ie10-win7": { - desiredCapabilities: { - browserName: "internet explorer", - platform: "Windows 7", - version: "10" - } - }, - "ie11-win8": { - desiredCapabilities: { - browserName: "internet explorer", - platform: "Windows 8.1", - version: "11" - } } },
Removing unneeded sauce definitions from config.js
FormidableLabs_rowdy
train
js
f48c487ac02fffe16f102f5f325b37adae70b9ef
diff --git a/yandextank/plugins/Monitoring/agent/agent.py b/yandextank/plugins/Monitoring/agent/agent.py index <HASH>..<HASH> 100755 --- a/yandextank/plugins/Monitoring/agent/agent.py +++ b/yandextank/plugins/Monitoring/agent/agent.py @@ -82,8 +82,8 @@ class CpuStat(AbstractMetric): # TODO: change to simple file reading output = subprocess.Popen('cat /proc/stat | grep -E "^(ctxt|intr|cpu) "', shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - except Exception, exc: - logger.error("Problems running popen", traceback.format_exc(exc)) + except Exception: + logger.exception("Problems running popen") result.append([empty] * 9) else: err = output.stderr.read() @@ -147,8 +147,8 @@ class CpuStat(AbstractMetric): for cmd2 in command: try: output = subprocess.Popen(cmd2, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - except Exception, exc: - logger.error("Problems running popen", traceback.format_exc(exc)) + except Exception: + logger.exception("Problems running popen") result.append(empty) else: err = output.stderr.read()
log exceptions in pythonic way
yandex_yandex-tank
train
py
961c45acedd6e269c324693af4fd82300469394d
diff --git a/yfinance/utils.py b/yfinance/utils.py index <HASH>..<HASH> 100644 --- a/yfinance/utils.py +++ b/yfinance/utils.py @@ -64,7 +64,7 @@ def get_json(url, proxy=None): def camel2title(o): - return [_re.sub("([a-z])([A-Z])", "\g<1> \g<2>", i).title() for i in o] + return [_re.sub("([a-z])([A-Z])", r"\g<1> \g<2>", i).title() for i in o] def auto_adjust(data):
Fix deprecation warnings due to invalid escape sequences.
ranaroussi_fix-yahoo-finance
train
py
cf89ea3ec5852d75e98762f2e142440b19e4e82c
diff --git a/src/main/java/graphql/execution/instrumentation/tracing/TracingInstrumentation.java b/src/main/java/graphql/execution/instrumentation/tracing/TracingInstrumentation.java index <HASH>..<HASH> 100644 --- a/src/main/java/graphql/execution/instrumentation/tracing/TracingInstrumentation.java +++ b/src/main/java/graphql/execution/instrumentation/tracing/TracingInstrumentation.java @@ -77,10 +77,10 @@ public class TracingInstrumentation extends SimpleInstrumentation { Map<Object, Object> currentExt = executionResult.getExtensions(); TracingSupport tracingSupport = parameters.getInstrumentationState(); - Map<Object, Object> tracingMap = new LinkedHashMap<>(currentExt == null ? Collections.emptyMap() : currentExt); - tracingMap.put("tracing", tracingSupport.snapshotTracingData()); + Map<Object, Object> withTracingExt = new LinkedHashMap<>(currentExt == null ? Collections.emptyMap() : currentExt); + withTracingExt.put("tracing", tracingSupport.snapshotTracingData()); - return CompletableFuture.completedFuture(new ExecutionResultImpl(executionResult.getData(), executionResult.getErrors(), tracingMap)); + return CompletableFuture.completedFuture(new ExecutionResultImpl(executionResult.getData(), executionResult.getErrors(), withTracingExt)); } @Override
minor fix (#<I>)
graphql-java_graphql-java
train
java
e5af53dfb93f5377f907ce75aeba8a94c23b4af9
diff --git a/closure/goog/fx/dragger.js b/closure/goog/fx/dragger.js index <HASH>..<HASH> 100644 --- a/closure/goog/fx/dragger.js +++ b/closure/goog/fx/dragger.js @@ -209,14 +209,14 @@ goog.tagUnsealableClass(goog.fx.Dragger); /** * Whether setCapture is supported by the browser. - * IE and Gecko after 1.9.3 has setCapture. - * Microsoft Edge doesn't have setCapture. - * WebKit does not yet: https://bugs.webkit.org/show_bug.cgi?id=27330. * @type {boolean} * @private */ goog.fx.Dragger.HAS_SET_CAPTURE_ = - goog.global.document.documentElement.setCapture != null; + // IE and Gecko after 1.9.3 has setCapture + // WebKit does not yet: https://bugs.webkit.org/show_bug.cgi?id=27330 + goog.userAgent.IE || + goog.userAgent.GECKO && goog.userAgent.isVersionOrHigher('1.9.3'); /**
Automated g4 rollback of changelist <I>. *** Reason for rollback *** Broke headless tests *** Original change description *** Merge pull request #<I> from Znegl/bugfix-dragger-setcapture Fixed IE Edge bug in goog.fx.Dragger ------------- Created by MOE: <URL>
google_closure-library
train
js
eb258248f5a78658807ad2b45f0e149f354c4d7c
diff --git a/spec/bitbucket_rest_api/core_ext/hash_spec.rb b/spec/bitbucket_rest_api/core_ext/hash_spec.rb index <HASH>..<HASH> 100644 --- a/spec/bitbucket_rest_api/core_ext/hash_spec.rb +++ b/spec/bitbucket_rest_api/core_ext/hash_spec.rb @@ -25,6 +25,9 @@ describe Hash do it 'should convert nested keys to symbols' do expect(@nested_hash.symbolize_keys!).to eq @symbols + + @nested_hash_with_array = { 'a' => { 'b' => [{'c' => 1}] } } + expect(@nested_hash_with_array.symbolize_keys!).to eq({:a=>{:b=>[{:c=>1}]}}) end end
test symbolize_keys! when value is array in hash_spec
bitbucket-rest-api_bitbucket
train
rb
e0c4357cc4198fbf69cd76513c79de50f187ef18
diff --git a/mqlight/src/main/java/com/ibm/mqlight/api/impl/SubscriptionTopic.java b/mqlight/src/main/java/com/ibm/mqlight/api/impl/SubscriptionTopic.java index <HASH>..<HASH> 100644 --- a/mqlight/src/main/java/com/ibm/mqlight/api/impl/SubscriptionTopic.java +++ b/mqlight/src/main/java/com/ibm/mqlight/api/impl/SubscriptionTopic.java @@ -59,7 +59,7 @@ public class SubscriptionTopic { return topic; } - public String[] crack() { + public String[] split() { final String methodName = "crack"; logger.entry(methodName);
fix compilation issue with misnamed method SubscriptionTopic.crack should be split
mqlight_java-mqlight
train
java
14a0211b6af41b05096413e1712eafe367ac0bb1
diff --git a/lib/tern.js b/lib/tern.js index <HASH>..<HASH> 100644 --- a/lib/tern.js +++ b/lib/tern.js @@ -453,7 +453,8 @@ if (query.end == null) throw new Error("missing .query.end field"); var wordStart = resolvePos(file, query.end), wordEnd = wordStart, text = file.text; while (wordStart && /\w$/.test(text.charAt(wordStart - 1))) --wordStart; - while (wordEnd < text.length && /\w$/.test(text.charAt(wordEnd))) ++wordEnd; + if (query.expandWordForward !== false) + while (wordEnd < text.length && /\w$/.test(text.charAt(wordEnd))) ++wordEnd; var word = text.slice(wordStart, wordEnd), completions = []; var wrapAsObjs = query.types || query.depths || query.docs || query.urls || query.origins;
Add expandWordForward option to completions query interface Issue #<I>
ternjs_tern
train
js
3e0ce6079cd4a3945c95ba97f6c632e4f9a19057
diff --git a/blog/edit_form.php b/blog/edit_form.php index <HASH>..<HASH> 100644 --- a/blog/edit_form.php +++ b/blog/edit_form.php @@ -38,11 +38,12 @@ class blog_edit_form extends moodleform { $mform->addElement('header', 'general', get_string('general', 'form')); - $mform->addElement('text', 'subject', get_string('entrytitle', 'blog'), 'size="60"'); + $mform->addElement('text', 'subject', get_string('entrytitle', 'blog'), array('size' => 60, 'maxlength' => 128)); $mform->addElement('editor', 'summary_editor', get_string('entrybody', 'blog'), null, $summaryoptions); $mform->setType('subject', PARAM_TEXT); $mform->addRule('subject', get_string('emptytitle', 'blog'), 'required', null, 'client'); + $mform->addRule('subject', get_string('maximumchars', '', 128), 'maxlength', 128, 'client'); $mform->setType('summary_editor', PARAM_RAW); $mform->addRule('summary_editor', get_string('emptybody', 'blog'), 'required', null, 'client');
MDL-<I> Blog: Added maxlength rule to subject field
moodle_moodle
train
php
4409d626405db63c8dd919e9dbe0574b0e4557e9
diff --git a/docs/source/conf.py b/docs/source/conf.py index <HASH>..<HASH> 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -55,9 +55,9 @@ author = u'Osvaldo Santana Neto' # built documents. # # The short X.Y version. -version = '0.3.2' +version = '0.3.3' # The full version, including alpha/beta/rc tags. -release = '0.3.2' +release = '0.3.3' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.
Fix release number at conf.py
osantana_prettyconf
train
py
a987ba457fd9321dacdfc35b750bd464c5a5cdef
diff --git a/packages/tyranid/src/express.js b/packages/tyranid/src/express.js index <HASH>..<HASH> 100644 --- a/packages/tyranid/src/express.js +++ b/packages/tyranid/src/express.js @@ -79,7 +79,7 @@ class Serializer { if (field.link) { this.newline(); - this.file += 'link: "'; + this.file += this.k('link') + ': "'; this.file += field.link.def.name; this.file += '",'; }
work on compiling fields into Fields for fieldsFor()
tyranid-org_tyranid
train
js
1ae0bdb57615fa9ddab4305eaedef2b29f466284
diff --git a/lib/main.js b/lib/main.js index <HASH>..<HASH> 100644 --- a/lib/main.js +++ b/lib/main.js @@ -241,6 +241,8 @@ function convertResource(data, dir, props, opts) { let packageData = { package_version: spec.version, type: props.container_type, + // TRICKY: resource.modified_at comes from the format.modified_at in resource.formats. + // we assume this to have been normalized before hand. modified_at: props.resource.modified_at, content_mime_type: mimeType, language: props.language, @@ -412,12 +414,27 @@ function typeToMime(container_type) { return 'application/ts+' + type; } +/** + * Reads the resource container info without opening it. + * + * @param container_path {string} path to the container archive or directory + * @returns {Promise.<{}>} the resource container info (package.json) + */ +function inspectContainer(container_path) { + return new Promise(function(resolve, reject) { + // TODO: look in the container and get the package info + throw new Error('Not implemented'); + // return {}; + }); +} + module.exports = { load: loadContainer, make: makeContainer, open: openContainer, close: closeContainer, tools: { + inspect: inspectContainer, convertResource: convertResource, makeSlug: containerSlug, mimeToType: mimeToType,
stubbed out inspecting a container
unfoldingWord-dev_node-resource-container
train
js
b6c50bf13ce07ebb65c19659984d785fe5361ad3
diff --git a/bsp-gonk/vendor/silk/silk-camera/index.js b/bsp-gonk/vendor/silk/silk-camera/index.js index <HASH>..<HASH> 100644 --- a/bsp-gonk/vendor/silk/silk-camera/index.js +++ b/bsp-gonk/vendor/silk/silk-camera/index.js @@ -47,7 +47,7 @@ type FrameReplacer = { * @property height height of the object rectangle * @memberof silk-camera */ -type Rect = { +export type Rect = { x: number; y: number; width: number; @@ -105,7 +105,7 @@ export type CameraFrameSize = 'low' | 'normal' | 'high' | 'full'; * The camera frame size * @memberof silk-camera */ -type SizeType = { +export type SizeType = { width: number; height: number; };
Export flow types from silk-camera
silklabs_silk
train
js
1c6a5eb33b9e8618b34e0c78b9b2e1ea092f5647
diff --git a/hawkular-wildfly-agent-itest-parent/hawkular-wildfly-agent-itest/src/test/java/org/hawkular/cmdgw/ws/test/AbstractCommandITest.java b/hawkular-wildfly-agent-itest-parent/hawkular-wildfly-agent-itest/src/test/java/org/hawkular/cmdgw/ws/test/AbstractCommandITest.java index <HASH>..<HASH> 100644 --- a/hawkular-wildfly-agent-itest-parent/hawkular-wildfly-agent-itest/src/test/java/org/hawkular/cmdgw/ws/test/AbstractCommandITest.java +++ b/hawkular-wildfly-agent-itest-parent/hawkular-wildfly-agent-itest/src/test/java/org/hawkular/cmdgw/ws/test/AbstractCommandITest.java @@ -239,7 +239,7 @@ public abstract class AbstractCommandITest { InventoryJacksonConfig.configure(mapper); this.client = new OkHttpClient(); - trace(OperationBuilder.class); + // trace(OperationBuilder.class); setLogger("org.hawkular.agent.monitor.cmd", Level.TRACE); }
Do not trace OperationBuilder during itests
hawkular_hawkular-agent
train
java
52e879550fdd052727c6eecdfe6d43028de39805
diff --git a/nornir/plugins/functions/text/__init__.py b/nornir/plugins/functions/text/__init__.py index <HASH>..<HASH> 100644 --- a/nornir/plugins/functions/text/__init__.py +++ b/nornir/plugins/functions/text/__init__.py @@ -2,6 +2,8 @@ import logging import pprint import threading from typing import List, Optional, cast +from collections import OrderedDict +import json from colorama import Fore, Style, init @@ -61,7 +63,10 @@ def _print_individual_result( # for consistency between py3.6 and py3.7 print(f"{x.__class__.__name__}{x.args}") elif x and not isinstance(x, str): - pprint.pprint(x, indent=2) + if isinstance(x, OrderedDict): + print(json.dumps(x, indent=2)) + else: + pprint.pprint(x, indent=2) elif x: print(x)
Print result (#<I>) * Add support for OrderedDict to print_result() * Add support for OrderedDict in print_result()
nornir-automation_nornir
train
py
08df92755f45b7d8f16a9efc7dd7514cb1ab9cf2
diff --git a/lib/utils.js b/lib/utils.js index <HASH>..<HASH> 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -97,7 +97,8 @@ function collectInterestingProperties (properties, interestingKeys) { return properties.reduce((parsedProps, prop) => { const keyValue = module.exports.getKeyName(prop); if (interestingKeys.has(keyValue)) { - parsedProps[keyValue] = prop.value; + // In TypeScript, unwrap any usage of `{} as const`. + parsedProps[keyValue] = prop.value.type === 'TSAsExpression' ? prop.value.expression : prop.value; } return parsedProps; }, {}); diff --git a/tests/lib/utils.js b/tests/lib/utils.js index <HASH>..<HASH> 100644 --- a/tests/lib/utils.js +++ b/tests/lib/utils.js @@ -139,6 +139,13 @@ describe('utils', () => { isNewStyle: true, }, + // Util function with "{} as const". + 'export default createESLintRule({ create() {}, meta: {} as const });': { + create: { type: 'FunctionExpression' }, + meta: { type: 'ObjectExpression' }, + isNewStyle: true, + }, + // Util function from util object 'export default util.createRule<Options, MessageIds>({ create() {}, meta: {} });': { create: { type: 'FunctionExpression' },
Fix: Handle `meta: {} as const` for TypeScript rules (#<I>)
not-an-aardvark_eslint-plugin-eslint-plugin
train
js,js
8b2248c708cd21cde8cc4905fdccea63a174b693
diff --git a/diff_cover/tests/test_snippets.py b/diff_cover/tests/test_snippets.py index <HASH>..<HASH> 100644 --- a/diff_cover/tests/test_snippets.py +++ b/diff_cover/tests/test_snippets.py @@ -1,5 +1,5 @@ -import mock from __future__ import unicode_literals +import mock import os import tempfile from pygments.token import Token
Fix future import in snippet tests
Bachmann1234_diff-cover
train
py
4e1d373bef435ce3ad8c5eeec206ef0ae0c6e4c1
diff --git a/pyvex/block.py b/pyvex/block.py index <HASH>..<HASH> 100644 --- a/pyvex/block.py +++ b/pyvex/block.py @@ -206,7 +206,7 @@ class IRSB(VEXObject): data = stat.data elif isinstance(stat, stmt.Put) and stat.offset == reg_next: data = stat.data - if data.result_size != reg_next_size: + if data.result_size(self.tyenv) != reg_next_size: return None elif isinstance(stat, stmt.LoadG) and stat.dst == tmp_next: return None @@ -221,7 +221,7 @@ class IRSB(VEXObject): elif isinstance(data, expr.Get): tmp_next = None reg_next = data.offset - reg_next_size = data.result_size + reg_next_size = data.result_size(self.tyenv) else: return None
More fixes after the latest PR. Make sure .result_size is changed to .result_size(irsb.tyenv) everywhere.
angr_pyvex
train
py
9e936bf08ccdb305c62dce01dd8ae7bd5437b749
diff --git a/lib/rules/disallow-emberkeys.js b/lib/rules/disallow-emberkeys.js index <HASH>..<HASH> 100644 --- a/lib/rules/disallow-emberkeys.js +++ b/lib/rules/disallow-emberkeys.js @@ -20,7 +20,7 @@ module.exports.prototype.check = function(file, errors) { helpers.findEmberFunction('keys', 0).forEach(function(node) { errors.add( 'Ember.keys is deprecated in Ember 1.13', - node.loc.start + node.callee.property.loc.start ); }); }; diff --git a/test/lib/rules/disallow-emberkeys.js b/test/lib/rules/disallow-emberkeys.js index <HASH>..<HASH> 100644 --- a/test/lib/rules/disallow-emberkeys.js +++ b/test/lib/rules/disallow-emberkeys.js @@ -36,7 +36,7 @@ describe('lib/rules/disallow-embertrycatch', function () { Ember.keys(); }, errors: [{ - column: 0, line: 1, filename: 'input', rule: 'disallowEmberKeys', fixed: undefined, + column: 6, line: 1, filename: 'input', rule: 'disallowEmberKeys', fixed: undefined, message: 'Ember.keys is deprecated in Ember 1.13' }] }, {
Ember.keys() warnings should point at .keys() invocation, not Ember object
minichate_jscs-ember-deprecations
train
js,js
a265d8e5bc2b7bbd56a6b12897c14d32923d4ce2
diff --git a/lib/graphql/relay/relation_connection.rb b/lib/graphql/relay/relation_connection.rb index <HASH>..<HASH> 100644 --- a/lib/graphql/relay/relation_connection.rb +++ b/lib/graphql/relay/relation_connection.rb @@ -76,7 +76,9 @@ module GraphQL def create_order_condition(table, column, value, direction_marker) table_name = ActiveRecord::Base.connection.quote_table_name(table) name = ActiveRecord::Base.connection.quote_column_name(column) - if (ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR >= 2) || ActiveRecord::VERSION::MAJOR > 4 + if ActiveRecord::VERSION::MAJOR == 5 + casted_value = object.table.able_to_type_cast? ? object.table.type_cast_for_database(column, value) : value + elsif ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR >= 2 casted_value = object.table.engine.columns_hash[column].cast_type.type_cast_from_user(value) else casted_value = object.table.engine.columns_hash[column].type_cast(value)
Added support for type casting in AR5
rmosolgo_graphql-ruby
train
rb
68b4070dfca280a7db03e0da1b10c3e1725d7cf0
diff --git a/src/edit/commands.js b/src/edit/commands.js index <HASH>..<HASH> 100644 --- a/src/edit/commands.js +++ b/src/edit/commands.js @@ -398,7 +398,7 @@ defineCommand("deleteCharAfter", { label: "Delete a character after the cursor", run(pm) { let {head, empty} = pm.selection - if (!empty || head.offset == 0) return false + if (!empty || head.offset == pm.doc.path(head.path).maxOffset) return false let to = moveForward(pm.doc.path(head.path), head.offset, "char") return pm.apply(pm.tr.delete(head, new Pos(head.path, to)), andScroll) }, @@ -409,7 +409,7 @@ defineCommand("deleteWordAfter", { label: "Delete a character after the cursor", run(pm) { let {head, empty} = pm.selection - if (!empty || head.offset == 0) return false + if (!empty || head.offset == pm.doc.path(head.path).maxOffset) return false let to = moveForward(pm.doc.path(head.path), head.offset, "word") return pm.apply(pm.tr.delete(head, new Pos(head.path, to)), andScroll) },
Fix deleteCharAfter not working at start of textblock
ProseMirror_prosemirror-markdown
train
js
f0301025fcc94fda2be927c0198a5f7fcdf5f5c7
diff --git a/src/Shared/ModuleConstantsRule.php b/src/Shared/ModuleConstantsRule.php index <HASH>..<HASH> 100644 --- a/src/Shared/ModuleConstantsRule.php +++ b/src/Shared/ModuleConstantsRule.php @@ -43,6 +43,8 @@ class ModuleConstantsRule extends AbstractRule implements InterfaceAware foreach ($node->findChildrenOfType('ConstantDeclarator') as $constant) { $value = $constant->getValue()->getValue(); + $value = $this->trimBundleNamePrefix($value); + if ($constant->getImage() === $value) { continue; } @@ -65,4 +67,18 @@ class ModuleConstantsRule extends AbstractRule implements InterfaceAware } } + /** + * @param mixed $constantValue + * + * @return mixed + */ + private function trimBundleNamePrefix($constantValue) + { + if (!is_string($constantValue)) { + return $constantValue; + } + + return preg_replace('/[A-Z0-9_]+:/', '', $constantValue); + } + }
Remove bundle prefix from constant value before comparing to constant name
spryker_architecture-sniffer
train
php
4933a3c6d3d0b12fc623ceb1f11ca0cf6127a977
diff --git a/src/Illuminate/Contracts/Pagination/Paginator.php b/src/Illuminate/Contracts/Pagination/Paginator.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Contracts/Pagination/Paginator.php +++ b/src/Illuminate/Contracts/Pagination/Paginator.php @@ -10,6 +10,23 @@ interface Paginator { public function url($page); /** + * Add a set of query string values to the paginator. + * + * @param array|string $key + * @param string $value + * @return $this + */ + public function appends($key, $value = null); + + /** + * Get / set the URL fragment to be appended to URLs. + * + * @param string|null $fragment + * @return $this|string + */ + public function fragment($fragment = null); + + /** * The the URL for the next page, or null. * * @return string|null
Add a few methods to contract.
laravel_framework
train
php
4c1c6529addc7840b86675c3acb3a98ff3b29a3a
diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index <HASH>..<HASH> 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -355,7 +355,7 @@ module Linguist disambiguate ".php" do |data| if data.include?("<?hh") Language["Hack"] - elsif /<?[^h]/.match(data) + elsif /<\?[^h]/.match(data) Language["PHP"] end end
fix php disambiguation regex (#<I>) Because of an error in the regular expression, disambiguation rule for the .php matched any non-empty file as PHP, except for Hack files.
github_linguist
train
rb
9e93c05cbc5b7eaf2e02a49d9062d45f418f2aa5
diff --git a/Neos.Flow/Classes/Security/Context.php b/Neos.Flow/Classes/Security/Context.php index <HASH>..<HASH> 100644 --- a/Neos.Flow/Classes/Security/Context.php +++ b/Neos.Flow/Classes/Security/Context.php @@ -171,8 +171,8 @@ class Context protected $sessionManager; /** - * @Flow\Inject - * @var PsrSecurityLoggerInterface + * @Flow\Inject(name="Neos.Flow:SecurityLogger") + * @var \Psr\Log\LoggerInterface */ protected $securityLogger;
TASK: Use virtual object injection for security logger
neos_flow-development-collection
train
php
07a3fb782623914faa20f41ac04030bfb48df966
diff --git a/src/test/java/com/treasuredata/client/TestServerFailures.java b/src/test/java/com/treasuredata/client/TestServerFailures.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/treasuredata/client/TestServerFailures.java +++ b/src/test/java/com/treasuredata/client/TestServerFailures.java @@ -58,6 +58,7 @@ public class TestServerFailures public void setUp() throws Exception { + // NOTICE. This jetty server does not accept SSL connection. So use http in TDClient server = new Server(); port = TestProxyAccess.findAvailablePort(); http = new ServerConnector(server);
Add a note on jetty server (a mock of TD API)
treasure-data_td-client-java
train
java
c7cc66d1f725583fd5235fcf72c81412996e0041
diff --git a/tests/test_invenio_accounts.py b/tests/test_invenio_accounts.py index <HASH>..<HASH> 100644 --- a/tests/test_invenio_accounts.py +++ b/tests/test_invenio_accounts.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # This file is part of Invenio. -# Copyright (C) 2015 CERN. +# Copyright (C) 2015, 2016 CERN. # # Invenio is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public License as @@ -121,3 +121,10 @@ def test_view(app): with app.test_client() as client: res = client.get(login_url) assert res.status_code == 200 + + +def test_configuration(app): + """Test configuration.""" + app.config['ACCOUNTS_USE_CELERY'] = 'deadbeef' + InvenioAccounts(app) + assert 'deadbeef' == app.config['ACCOUNTS_USE_CELERY']
tests: respect ACCOUNTS_USE_CELERY configuration * Checks that value in ACCOUNTS_USE_CELERY configuration is respected. (closes #<I>)
inveniosoftware_invenio-accounts
train
py
6c03ee14c19c59c8a45e85bf81d3d4f90c229b75
diff --git a/djcelery/schedulers.py b/djcelery/schedulers.py index <HASH>..<HASH> 100644 --- a/djcelery/schedulers.py +++ b/djcelery/schedulers.py @@ -125,6 +125,15 @@ class DatabaseScheduler(Scheduler): def schedule_changed(self): if self._last_timestamp is not None: + # If MySQL is running with transaction isolation level + # REPEATABLE-READ (default), then we won't see changes done by + # other transactions until the current transaction is + # committed (Issue #41). + try: + transaction.commit() + except transaction.TransactionManagementError: + pass # not in transaction management. + ts = self.Changes.last_change() if not ts or ts < self._last_timestamp: return False
DatabaseScheduler would not react to changes when using MySQL and REPEATABLE-READ. Closes #<I>
celery_django-celery
train
py
8dbc8544d9d006b03222750e412243de28cd375c
diff --git a/pyvex/block.py b/pyvex/block.py index <HASH>..<HASH> 100644 --- a/pyvex/block.py +++ b/pyvex/block.py @@ -120,7 +120,7 @@ class IRSB(VEXObject): irsb.statements = stmts irsb.next = next_expr irsb.jumpkind = jumpkind - irsb.direct_next = irsb._is_defaultexit_direct_jump() + irsb._direct_next = irsb._is_defaultexit_direct_jump() return irsb
Fixed incorrect attribute name in IRSB construction method.
angr_pyvex
train
py
51b4c2c3c5388215fb67573a4d09beb1e3914ca5
diff --git a/src/XeroPHP/Models/Accounting/ExpenseClaim.php b/src/XeroPHP/Models/Accounting/ExpenseClaim.php index <HASH>..<HASH> 100644 --- a/src/XeroPHP/Models/Accounting/ExpenseClaim.php +++ b/src/XeroPHP/Models/Accounting/ExpenseClaim.php @@ -2,9 +2,11 @@ namespace XeroPHP\Models\Accounting; use XeroPHP\Remote; +use XeroPHP\Traits\AttachmentTrait; class ExpenseClaim extends Remote\Model { + use AttachmentTrait; /** * Xero identifier
Adds attachments to ExpenseClaim
calcinai_xero-php
train
php
283b99b367efaacd076bb1ff6d4977f46a2090b6
diff --git a/tests/src/Verifier/PasswordVerifierTest.php b/tests/src/Verifier/PasswordVerifierTest.php index <HASH>..<HASH> 100644 --- a/tests/src/Verifier/PasswordVerifierTest.php +++ b/tests/src/Verifier/PasswordVerifierTest.php @@ -3,16 +3,16 @@ namespace Aura\Auth\Verifier; class PasswordVerifierTest extends \PHPUnit_Framework_TestCase { - public function test() + protected function setUp() { - if (defined('PASSWORD_BCRYPT')) { - // use the real password_hash() - $algo = PASSWORD_BCRYPT; - } else { - // use the fake password_hash() - $this->markTestIncomplete("password_hash functionality not available. Install ircmaxell/password-compat for 5.3+"); + if (! defined('PASSWORD_BCRYPT')) { + $this->markTestSkipped("password_hash functionality not available. Install ircmaxell/password-compat for 5.3+"); } + } + public function test() + { + $algo = PASSWORD_BCRYPT; $verifier = new PasswordVerifier($algo); $plaintext = 'password'; $encrypted = password_hash($plaintext, $algo);
check password_hash() existence in setup
auraphp_Aura.Auth
train
php
69582cac9fa920849b55114923b6d2b3955f04bf
diff --git a/src/main/java/org/jfrog/hudson/release/scm/perforce/PerforceCoordinator.java b/src/main/java/org/jfrog/hudson/release/scm/perforce/PerforceCoordinator.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jfrog/hudson/release/scm/perforce/PerforceCoordinator.java +++ b/src/main/java/org/jfrog/hudson/release/scm/perforce/PerforceCoordinator.java @@ -63,8 +63,7 @@ public class PerforceCoordinator extends AbstractScmCoordinator { labelChangeListId = currentChangeListId + ""; perforce.commitWorkingCopy(currentChangeListId, releaseAction.getDefaultReleaseComment()); } else { - perforce.commitWorkingCopy(currentChangeListId, releaseAction.getDefaultReleaseComment()); - perforce.deleteChangeList(currentChangeListId); + safeRevertWorkingCopy(); currentChangeListId = perforce.getDefaultChangeListId(); }
HAP-<I> - Support Perforce in release management * Reverting local copy in case of unchanged files Conflicts: src/main/java/org/jfrog/hudson/release/scm/perforce/PerforceCoordinator.java
jenkinsci_artifactory-plugin
train
java
8fbcf33c4c5e850c471498303ea2b49cfeb9a73a
diff --git a/source/convertToJson.js b/source/convertToJson.js index <HASH>..<HASH> 100644 --- a/source/convertToJson.js +++ b/source/convertToJson.js @@ -147,15 +147,15 @@ export function parseValue(value, schemaEntry, options) { return result } if (result.value !== null) { - try { - if (schemaEntry.oneOf && schemaEntry.oneOf.indexOf(result.value) < 0) { - return { error: 'invalid' } - } - if (schemaEntry.validate) { + if (schemaEntry.oneOf && schemaEntry.oneOf.indexOf(result.value) < 0) { + return { error: 'invalid' } + } + if (schemaEntry.validate) { + try { schemaEntry.validate(result.value) + } catch (error) { + return { error: error.message } } - } catch (error) { - return { error: error.message } } } return result
Added `oneOf` schema property (refactored)
catamphetamine_read-excel-file
train
js
701a309650b5ea8d61235fb1045e60a29120ccb1
diff --git a/devel/dataset/transform_file_structure.py b/devel/dataset/transform_file_structure.py index <HASH>..<HASH> 100644 --- a/devel/dataset/transform_file_structure.py +++ b/devel/dataset/transform_file_structure.py @@ -2,8 +2,16 @@ def prepare_pilsen_pigs_dataset(input_dir, output_dir, output_format=".mhd"): + from google_drive_downloader import GoogleDriveDownloader as gdd + import io3d + from pathlib import Path import SimpleITK + # teoretické načtení složky T040 + imput_dir = Path(r'G:\.shortcut-targets-by-id\1Vq6QAiJ7cHDJUdgKXjUxx5iw7zk6MMPI\transplantation') + dp = io3d.read(list(imput_dir.glob('*040D_V*'))[0]) + f_name = list(imput_dir.glob('*040D_V*'))[0] + pass
Update transform_file_structure.py Import and donwland of a file V_<I>
mjirik_io3d
train
py
985334eef8054e46de92a90c1c74de1dec3e9a83
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,9 @@ setup( # Indicate who your project is intended for 'Intended Audience :: Developers', - 'Topic :: Software Development :: Build Tools', + 'Topic :: Scientific/Engineering :: Artificial Intelligence', + 'Topic :: Scientific/Engineering :: Information Analysis', + 'Topic :: Scientific/Engineering :: Human Machine Interfaces', # Pick your license as you wish (should match "license" above) 'License :: OSI Approved :: MIT License', @@ -64,7 +66,7 @@ setup( ], # What does your project relate to? - keywords='nlp naturallanguage text classification development', + keywords='nlp nlu naturallanguage text classification development', # You can just specify the packages manually here if your project is # simple. Or you can use find_packages().
Tweaked setup.py.
wiseman_pyluis
train
py
8badfa2e0735af3c7ff10343ef51ac705134f8ca
diff --git a/features/gtf.py b/features/gtf.py index <HASH>..<HASH> 100644 --- a/features/gtf.py +++ b/features/gtf.py @@ -1,10 +1,10 @@ -from ebias.resource import Resource +from ebias.resource import Resource, Target from lhc.file_format.gtf_.iterator import GtfIterator as GtfIteratorParser from lhc.file_format.gtf_.set_ import GtfSet as GtfSetParser from lhc.file_format.gtf_.index import IndexedGtfFile -class GtfIterator(Resource): +class GtfIterator(Target): EXT = ['.gtf', '.gtf.gz'] TYPE = 'gene_model' diff --git a/run_ebias.py b/run_ebias.py index <HASH>..<HASH> 100755 --- a/run_ebias.py +++ b/run_ebias.py @@ -27,4 +27,3 @@ def getParser(): if __name__ == '__main__': import sys sys.exit(main()) -
gtf iterator is now a target
childsish_sofia
train
py,py
3629926e8cccdc0f5248f006d8bee6e0b51fbfe1
diff --git a/lib/router/alias.js b/lib/router/alias.js index <HASH>..<HASH> 100644 --- a/lib/router/alias.js +++ b/lib/router/alias.js @@ -84,9 +84,13 @@ var alias = { we.express.bind(this)(req, res); } else { // is a target how have alias then redirect to it - res.setHeader('Cache-Control', 'public, max-age=345600'); - res.setHeader('Expires', new Date(Date.now() + 345600000).toUTCString()); - return res.redirect(307, urlAlias.alias); + res.writeHead(307, { + 'Location': urlAlias.alias, + 'Content-Type': 'multipart/form-data', + 'Cache-Control':'public, max-age=345600', + 'Expires': new Date(Date.now() + 345600000).toUTCString() + }); + return res.end(); } } else { we.log.verbose('ulrAlias not found for:', path);
fix url alias redirect to use http methods
wejs_we-core
train
js
8b710b31c14bfa18a40b98939399eaa95063a10a
diff --git a/src/ChannelDefinition.js b/src/ChannelDefinition.js index <HASH>..<HASH> 100644 --- a/src/ChannelDefinition.js +++ b/src/ChannelDefinition.js @@ -16,7 +16,7 @@ var defaultConfiguration = { }; var ChannelDefinition = function(exchange, topic) { - this.configuration = defaultConfiguration; + this.configuration = _.extend(defaultConfiguration { exchange: exchange, topic: topic }); } ; ChannelDefinition.prototype = {
Fixing bugs I introduced in last commit
postaljs_postal.js
train
js
0aca72fbd6400767f0bbf34f4fed337868474969
diff --git a/growler/middleware_chain.py b/growler/middleware_chain.py index <HASH>..<HASH> 100644 --- a/growler/middleware_chain.py +++ b/growler/middleware_chain.py @@ -4,12 +4,16 @@ """ """ +from collections import namedtuple + class MiddlewareChain: """ Class handling the storage and retreival of growler middleware functions. """ + middleware_tuple = namedtuple('middleware', ['func', 'path']) + def __init__(self): self.mw_list = [] @@ -25,10 +29,11 @@ class MiddlewareChain: """ Add a function to the middleware chain, listening on func """ - self.mw_list.append((func,)) + self.mw_list.append(self.middleware_tuple(func=func, + path=path,)) def __contains__(self, func): for mw in self.mw_list: - if func == mw[0]: + if func is mw.func: return True return False
growler.middleware_chain: Uses a namedtuple to store middleware information in the list
pyGrowler_Growler
train
py
e869b0e58bd95a537828c371f2cb5f2a360136e4
diff --git a/lib/active_scaffold/actions/field_search.rb b/lib/active_scaffold/actions/field_search.rb index <HASH>..<HASH> 100644 --- a/lib/active_scaffold/actions/field_search.rb +++ b/lib/active_scaffold/actions/field_search.rb @@ -58,7 +58,7 @@ module ActiveScaffold::Actions if search_conditions.blank? @filtered = false else - @filtered = human_conditions.nil? ? true : human_conditions.compact.join(' and ') + @filtered = human_conditions.nil? ? true : human_conditions.compact.join(I18n.t('support.array.two_words_connector')) end includes_for_search_columns = columns.collect{ |column| column.includes}.flatten.uniq.compact
human_conditions: use two words connector for proper I<I>n
activescaffold_active_scaffold
train
rb
844994b97a27c67e6696d707e6123d5808ec1bf2
diff --git a/src/microkernel-1-version.js b/src/microkernel-1-version.js index <HASH>..<HASH> 100644 --- a/src/microkernel-1-version.js +++ b/src/microkernel-1-version.js @@ -29,7 +29,7 @@ const yaml = require("js-yaml") /* the mixin class */ module.exports = class MicrokernelVersion { version () { - const VERSION = yaml.safeLoad(fs.readFileSync(path.join(__dirname, "..", "VERSION.yml"), "utf8")) + const VERSION = yaml.load(fs.readFileSync(path.join(__dirname, "..", "VERSION.yml"), "utf8")) return { major: VERSION.major, minor: VERSION.minor,
upgrade to newer js-yaml API
rse_microkernel
train
js